Jump to content

Showing Label on top and outside of bars in Bar Chart


daad.madhusudan
Go to solution Solved by daad.madhusudan,

Recommended Posts

I am working on a jasper report and I am generating a bar chart. 

What I generated using ireport designer and customizer(to show labels) is:

BarChart.PNG.00580d54f2afabb5652b9fa9629c33eb.PNG

Here I want to show the labels outside the bars. How can i do it? Is there any way using customizer?

Also for second bar because of small size label is not visible, in this case what can I do?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Solution

I got the solution :)

In my customizer class I am adding following lines:

CategoryPlot categoryPlot = (CategoryPlot) chart.getPlot();
categoryPlot.getRenderer().setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER));

Its working :)

Link to comment
Share on other sites

  • 1 year later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...