This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Display Bar Values in JFreeChart

 
Ranch Hand
Posts: 1951
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Steve Dyke
Ranch Hand
Posts: 1951
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Everybody's invited. Except this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!