aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 1390
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: 39535
    
  27
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 - updated with new look and Ping home screen widget
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
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: 39535
    
  27
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
Export Chart into Excel file..?
create chart application in java
code for Bar chart
how to display bar chart based on the database values using jsp
Need help writing a code involving bar charts!