No Volume for OHLCSeries???

Discussion about JFreeChart related to stockmarket charts.
Locked
Bigdaddy
Posts: 5
Joined: Thu Sep 23, 2004 8:25 am

No Volume for OHLCSeries???

Post by Bigdaddy » Sat Jun 26, 2010 10:36 am

I am trying to use the OHLCSeriesCollection because it allows the manipulation of the XPostion, but I cannot get the volume for any given index. The problem appears to be with the OHLCSeries, because it does not have a method that allows volume to be added along with the other OHLC values. Is this an oversight or did I miss something? How do I associate volume with other OHLC values that are added to an OHLCSeries which is the only thing that can be added to an OHLCSeriesCollection?

I use code that looks something like the following:

ohlcSeries.add(regularTimePeriod, open, high, low, close); // Where is the method to add volume with these OHLC values?
...
ohlcSeriesCollection.add(ohlcSeries);
...
ohlcSeriesCollection.getVolume(series, item); // This will throw an exception, because there is no volume associated with anything in the OHLCSeries

Bigdaddy
Posts: 5
Joined: Thu Sep 23, 2004 8:25 am

Re: No Volume for OHLCSeries???

Post by Bigdaddy » Sat Jun 26, 2010 10:46 am

Nevermind. I reread the documentation for the getVolume() method under OHLCSeriesCollection where it states the volume will always be null for getVolume() or Double.NAN for getVolumeValue()? It sure would be nice if the volume could be associated with the other OHLC values for an OHLCSeries or if an OHLCDataset could be added to an OHLCSeriesCollection, because an OHLCSeriesCollection allows one to manipulate the XPosition of the data whereas the OHLCDataset does not. $0.02.

Locked