Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add labelColor option for specifying color of series in legend #416

dnschnur opened this Issue Sep 28, 2012 · 3 comments


None yet
3 participants

dnschnur commented Sep 28, 2012

Original author: djrumc...@gmail.com (April 26, 2010 13:01:09)

I suggest adding a "labelColor" option in order to specify a custom label

Line 1769, add/amend:

if (s.labelColor) {
var labelColor = s.labelColor;
else {
var labelColor = s.color;
'<td class="legendColorBox"><div style="border:1px solid ' +
options.legend.labelBoxBorderColor + ';padding:1px"><div
style="width:4px;height:0;border:5px solid ' + labelColor +
';overflow:hidden"></div></div></td>' + '<td class="legendLabel">' + label

  • '</td>');

It can be specified as such:
hoverable: true,
label: 'Highlight',
labelColor: 'rgb(255,255,0)',
data: [ ...

This is useful for point data sets because flot currently takes the outer
colour, rather than the fill colour as uses it for labels.

Original issue: http://code.google.com/p/flot/issues/detail?id=337


dnschnur commented Sep 28, 2012

From olau%iol...@gtempaccount.com on December 13, 2010 15:44:02
I was going to implement this but it occurs to me that I would probably rather have an outline color that one can set (so you set the outline color rather than the series color), then people would be less confused on what to set on bars. Do you think that would work for you?

thejae commented Dec 4, 2012

+1 for

labelColor: #000

Dieterbe commented Dec 6, 2012

just to clarify, is this to color the text labels for the series, or the color of the series themselves? because I couldn't find a way to alter the color of the text labels in the legend, so i hope it's about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment