user1126937
user1126937

Reputation: 51

Displaying labels vertically on bars in barCharts in JFreeChart

I was unable to find a way to display the labels (the corresponding values of y axis) vertically. By default it displays horizontally but if values are big it gets overlapped. Please I am not looking to vertically display the labels of domain axis (x axis) but to display corresponding y values as a label on top of bar horizontally.

Upvotes: 1

Views: 1707

Answers (1)

trashgod
trashgod

Reputation: 205785

BarChartDemo7 among the demos is an example.

Crowding can be a problem, but changing ItemLabelPosition or the ItemLabelAnchor may not solve the problem. As an alternative, consider using a tooltip generator, discussed here. For more complex rendering needs, add a ChartMouseListener, mentioned here, and update an adjacent component with the details.

Upvotes: 1

Related Questions