This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Display Bar Values in JFreeChart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Display Bar Values in JFreeChart" Watch "Display Bar Values in JFreeChart" New topic
Author

Display Bar Values in JFreeChart

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
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?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41151
    
  45
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 http://www.coderanch.com/t/432205/Other-Open-Source-Projects/Display-Bar-Values-Chart


Ping & DNS - my free Android networking tools app
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
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?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41151
    
  45
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Display Bar Values in JFreeChart
 
Similar Threads
how to display bar chart based on the database values using jsp
code for Bar chart
create chart application in java
Export Chart into Excel file..?
Need help writing a code involving bar charts!