custom text & color for axis & data labels

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
DavidThi808
Posts: 106
Joined: Fri May 27, 2005 7:44 pm
Location: Boulder, CO
Contact:

custom text & color for axis & data labels

Post by DavidThi808 » Tue Sep 29, 2009 1:11 am

Hi;

Can someone point me to a url that shows the best way to tell JFreeChart how to format the text and set the color for the axis and data labels?

thanks - dave

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

Re: custom text & color for axis & data labels

Post by david.gilbert » Tue Sep 29, 2009 10:11 pm

The axis classes have setTickLabelFont() and setTickLabelPaint() methods. For the data labels, the renderers have setBaseItemLabelFont()/setSeriesItemLabelFont() and setBaseItemLabelPaint()/setSeriesItemLabelPaint() methods.
David Gilbert
JFreeChart Project Leader

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

DavidThi808
Posts: 106
Joined: Fri May 27, 2005 7:44 pm
Location: Boulder, CO
Contact:

Re: custom text & color for axis & data labels

Post by DavidThi808 » Tue Sep 29, 2009 10:43 pm

thanks you!

DavidThi808
Posts: 106
Joined: Fri May 27, 2005 7:44 pm
Location: Boulder, CO
Contact:

Re: custom text & color for axis & data labels

Post by DavidThi808 » Mon Oct 12, 2009 4:34 am

To render the text for a tick label (ie for a number I may want $1 234,56) - is the best way to call setTickUnit(new NumberTickUnit(double, new MyFormatter()))?

thanks - dave

Locked