How can i add text in category plot?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Sarika
Posts: 17
Joined: Sat Apr 02, 2005 6:18 am

How can i add text in category plot?

Post by Sarika » Tue May 31, 2005 12:32 pm

In chart if some values plotted are null then i want to print
some message or text before category axis label.

Like if in bar chart if value is null then i want to print "null"
Help me to solve this problem

David sir can u plz suggest some ideas

Thanx

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 » Tue May 31, 2005 5:27 pm

You'll need to customise the renderer (in the drawItem() method). Most renderers just return when a null value is found, which results in nothing being drawn. If you modify the code, you can check for that case and draw whatever you want to represent null.
David Gilbert
JFreeChart Project Leader

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

Sarika
Posts: 17
Joined: Sat Apr 02, 2005 6:18 am

Post by Sarika » Wed Jun 01, 2005 6:44 am

Thanx David that's nice idea.
But in my code there is separate class for error messages.
and i want to print those error messages.
It will be complicated in that case.
So i have found other solution.

I extended LabelGenerator class and shown null message where
null values found.

but labelposition class is not setting the given label positions
if i try to add label positions it is not working i.e null message is not shown.

what i have to do in that case

Locked