1

I have an application in which I want to display various charts, mostly bar graphs, pie graphs, etc. In the past, I've used JFreeChart, but (at least by default), JFreeChart does not allow an easy way of editing things like the bar colors. The "properties" popup menu that comes by default by right click is pretty limited.

Is there a more extensive editable popup for JFreeChart or a relatively simple way to create one? Or can someone suggest alternatives? I don't want to spend a ton of time doing the charting, as I could easily export to CSV for Excel to graph.

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406

4 Answers4

2

In JFreeChart, you can set the category colors when constructing the chart, as shown in the BarChartDemo1 source. You should be able to let the user change colors by implementing ChartMouseListener or overriding mouseClicked() in ChartPanel.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
1

I've been using XChart for the past few months now. I really had a hard time with the complexity and bloat of JFreeChart. Overall is just really clean, simple and light weight. Really easy customization that takes essentially no time to figure out. They just released a new version with support for bar charts...not sure about pie charts yet, but im sure if its not supported it will be coming soon.

Here is an example:

Series series = chart.addSeries(...);
series.setLineColor(Color.RED);
knowm
  • 36
  • 3
1

Take a look at this web, there are many options. I hope it helps.

Good luck!

Drewen
  • 2,806
  • 1
  • 15
  • 12
0

If you're doing web development you should check out this article

http://speckyboy.com/2009/12/09/25-graph-and-chart-solutions-for-web-developers/

I like protovis, it's SVG based and can do all the charts I'm looking for.

http://vis.stanford.edu/protovis/

lofte
  • 864
  • 7
  • 6