3

I have a jqplot barchart rendering correctly. The chart has 2 series of data, one is is rendered blue and the other is rendered red. When I enable the pointLabels plugin to output the bar value above the bar the text is rendered in the default page font colour. I would like the font to use the colour of the bar each time.

Thanks.

Brian Scott
  • 9,221
  • 6
  • 47
  • 68

1 Answers1

3

It looks like the point labels are given classes based on their series. So point labels in the first series will have a class called jqplot-series-0, the second series will have jqplot-series-1 and so on. Just target them with some CSS and it should work.

.jqplot-series-0 {
    color: red;
}
Chris
  • 4,393
  • 1
  • 27
  • 33
  • 2
    This works for the color. However `font-size` is ignored. I wonder how to set the font-size for point labels. Using `fontSize` in jqPlot pointLabel options does not work either. – Stefan May 21 '12 at 18:22
  • 2
    @Stefan pointLabel font-size style is defined in `.jqplot-point-label` class. – LukeP Aug 12 '12 at 01:39