Histogram bar width

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
va1210
Posts: 3
Joined: Fri Jul 30, 2004 9:43 am

Histogram bar width

Post by va1210 » Fri Sep 03, 2004 3:35 pm

I've created a histogram using ChartFactory.createHistogram() using data the following type of data:

x y
0 10
100 20
200 5
300 12
.
.
.

and so on. When I show the chart the bars are really thin (1 in width I think). How can I set the width to the maximum possible, or a fixed amount, say 100?

Thanks,

Ville

Guest

Post by Guest » Fri Jul 08, 2005 2:14 pm

data.setIntervalWidth(100) ;

or

data.setAutoWidth(true) ;

fclever

how do I call setIntervalWidth

Post by fclever » Sun Jul 24, 2005 8:34 am

I see your code:
data.setIntervalWidth()
What class is data? I am unable to get an instance of an object in a category chart or a TimeSeries chart where I can call setIntervalWidth. Can you point me in the right direction here?

thank you,
Flori

fc@clever-soft.com
http://www.clever-soft.com/

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Jul 26, 2005 9:59 am

There are several solutions. One is you could use the XYBarDataset class to wrap your dataset.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked