David
I would like to include the labels outside, close to the end of the bars and centered. How do I do it with the following code,
ItemLabelPosition position = new ItemLabelPosition(
ItemLabelAnchor.INSIDE3, TextAnchor.CENTER_RIGHT, TextAnchor.CENTER_RIGHT, 0.0);
Note: I’m using horizontal bars.
Rgds
Luis
SurveyResultsDemo3
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The first argument (an ItemLabelAnchor) controls the general location of the label relative to the bars. The numbers roughly correspond to the hours on a clockface, so you can use ItemLabelAnchor.OUTSIDE3 to get a label at the right of the bar, on the outside:
The next argument (a TextAnchor) controls which point on the label gets aligned to the item label anchor, and the final two arguments control the rotation of the label.
Code: Select all
ItemLabelPosition p = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT, TextAnchor.CENTER, 0.0
);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

