Selected XY series legend item font

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Gotcha
Posts: 7
Joined: Wed Oct 15, 2008 9:13 am

Selected XY series legend item font

Post by Gotcha » Wed Oct 15, 2008 9:26 am

Hi,
I need to highlight selected series in XY line chart legend using bold font (highlighting lines using thicker ones works correctly). I've implemented ChartMouseListener so I can get LegendItemEntity and then LegendItem (from chart). I've tried to use method setLabelFont but the legend font is not changed.
Can you help me, please?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Oct 15, 2008 9:34 am

In JFreeChart 1.0.11, you should be able to use the following method in the renderer to set the legend item font:

Code: Select all

public void setLegendTextFont(int series, Font font);
It wasn't available prior to version 1.0.11.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked