Forums Register Login

Display Bar Values in JFreeChart

+Pie Number of slices to send: Send
I have a bar chart I created using the ChartFactory for bar chart method. I don't see any parameter to turn on the bar value labels. Can someone help with this?
+Pie Number of slices to send: Send
Not all possible parameters can be passed in via those convenience methods. The general approach would be something like:

CategoryItemrenderer render = ((CategoryPlot) myChart.getPlot()).getRenderer()

The rest is similar to what we discussed in https://coderanch.com/t/432205/Other-Open-Source-Projects/Display-Bar-Values-Chart
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:
CategoryItemrenderer render = ((CategoryPlot) myChart.getPlot()).getRenderer()



Can this be used with the ChartFactory method or do I have to back up and design the chart from scratch?
+Pie Number of slices to send: Send
You'd use the chart instance created by the ChartFactory method. Before the chart is actually created, all the settings can be changed - in the Plot, Renderer, Axis, etc.
I can't take it! You are too smart for me! Here is the tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 5177 times.
Similar Threads
Export Chart into Excel file..?
how to display bar chart based on the database values using jsp
code for Bar chart
Need help writing a code involving bar charts!
create chart application in java
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:57:50.