Hi ,
Im creating a TimeSeriesChart and setting the lItemLabel to true.
The item label for the last item of the chart is not visible.
Its partially visible and when i zoom in i can see it clearly.
I s there any way by which i can view that itemlabel clearly.
Thanks in advance
Karthik
Item Label not visible goes outside chartpanel
-
- Posts: 11
- Joined: Thu Jul 13, 2006 11:38 am
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
At the moment, the auto axis range calculation does not take into account the item labels, so the only way to avoid some labels being chopped off is to set the axis margins to a larger size so that there is sufficient space for the labels to be displayed. That's not a great workaround, but it is the only way at present.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 10
- Joined: Mon Jun 22, 2009 2:42 pm
Re: Item Label not visible goes outside chartpanel
I have the same problem with a stacked bar chart. Is there a better way to solve it yet?
Thanks
Itai
Thanks
Itai
-
- Posts: 10
- Joined: Mon Jun 22, 2009 2:42 pm
Re: Item Label not visible goes outside chartpanel
In addition, If I want to solve it myself, where exactly in the code should I change/extend it?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Item Label not visible goes outside chartpanel
I think this is tricky to fix, because of the API changes that would be needed. The auto-range calculation orchestrated by the plot uses the findDomainBounds() and findRangeBounds() methods in the renderer interface to ask the renderer what data bounds it needs to fully display the data items in the given dataset (this gives the renderer a chance to include wider bounds if it draws error bars or whatever - and this could potentially include item labels). Now the problem is that the findRangeBounds() method only passes in the dataset, but to compute the data bounds required by the itemLabels, we also need to know the dataArea that is being used (so you can convert the font bounds in Java2D space back into data space). And this isn't provided for in the API (yet).
It's all do-able I think, but not trivial. It'd be great if you try though.
It's all do-able I think, but not trivial. It'd be great if you try though.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Re: Item Label not visible goes outside chartpanel
any solution for this issue?