0

Please consider following graph : enter image description here

The above bar graph is built using jfreechart. I have two questions:

1) Values (1,5,4 etc.)are printed on the top but within the bars.How to display these on the top but above the bars?

2)Each value is printed on the bars in horizontal manner. How to display them in proper vertical manner?

Thanks...

a Learner
  • 4,944
  • 10
  • 53
  • 89

2 Answers2

3

You should take a look at ItemLabelPosition, as explained here.

It is a property on the BarRenderer for the given chart. Try experimenting with the different values for the desired result.

Jes
  • 2,748
  • 18
  • 22
2

Expanding on @Jes's helpful suggestion, you can see how ChartFactory.createBarChart() uses ItemLabelPosition in the relevant source code. More on the label generator parameters may be found here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045