Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
dnschnur opened this Issue · 3 comments

3 participants

@dnschnur
Owner

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

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

Line 1769, add/amend:

if (s.labelColor) {
var labelColor = s.labelColor;
}
else {
var labelColor = s.color;
}
fragments.push(
'<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
Owner

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

+1 for

labelColor: #000

@Dieterbe

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
Something went wrong with that request. Please try again.