Plotting a bar graph with X-Axis resizable bar width

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
praneethshub
Posts: 6
Joined: Tue Feb 21, 2017 5:45 pm
antibot: No, of course not.

Plotting a bar graph with X-Axis resizable bar width

Post by praneethshub » Tue Feb 21, 2017 5:51 pm

I was using JFreeChart with code containing barChartData.setValue(10,"T1", "1"), which gives only varying y-axis parameters. Please see the attached image. I need bar width being changed based on input variable; Y-axis amplitude should be constant. X-axis need to be varied with bars of various width's.

Please find my stack exchange post too, i couldn't get any response yet, please help me.

http://stackoverflow.com/questions/4218 ... -amplitude

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Plotting a bar graph with X-Axis resizable bar width

Post by paradoxoff » Tue Feb 21, 2017 9:50 pm

Use an IntervalXYDataset, for example an XYIntervalSeriesCollection, and create an XYPlot with an XYBarRenderer.

Locked