Adjusting bar width of bars in jfreechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
newbie321
Posts: 2
Joined: Sun Aug 25, 2019 7:52 pm
antibot: No, of course not.

Adjusting bar width of bars in jfreechart

Post by newbie321 » Mon Aug 26, 2019 12:47 am

My (x,y) data spans the interval [0,1] and at every point I need to draw the bars. While the bars work great when x-axis is made of integers, the bars always overlap each other in my case. I read a few posts that claim in it impossible to change the width of a bar. I almost gave up on this and then I saw example histogramdemo1.java where bars' width does render well on the plot for any interval and the return plot is XYPlot.
I tried playing with XYBarRenderer but no luck.

Is it possible to override some default methods in jfreechart to control the width of the bars for the (XYPlot, XYBarRenderer)? If so, can anyone post an example on how to do it?

Thanks,

John Matthews
Posts: 487
Joined: Wed Sep 12, 2007 3:18 pm

Re: Adjusting bar width of bars in jfreechart

Post by John Matthews » Wed Aug 28, 2019 3:46 am

Cross-posted here.

Post Reply