problem with HighLow dataset

Discussion about JFreeChart related to stockmarket charts.
Locked
simple
Posts: 4
Joined: Fri Feb 24, 2006 5:45 am

problem with HighLow dataset

Post by simple » Tue Mar 07, 2006 12:52 pm

Hi,
I am writing a real-time app that uses intraday stock data at 1 min intervals via tcp socket feed.
I populate an ArrayList with each periods open,high,low,close,etc, then iterate through it dynamically adding to relevant series:-
series1.add(new Minute(minute, hourObj), (Double)close);
series2.add(new Minute(minute, hourObj), (Integer)volume);

I have no problem creating time series charts but encounter a problem with the OpenHigh charts using the defaultHighLowDataset:-

Date[] date = new Date[255];
double[] high = new double[255];
double[] low = new double[255];
double[] open = new double[255];
double[] close = new double[255];
double[] volume = new double[255];

The demo uses static arrays which are passed into:-

defaultHighLowDataset("Series", date, high, low, open, close, volume);

Obviously as the trading day progresses the number of periods may fluctuate between 1 - approx 500 periods, and passing dynamically increasing data structures as arguments or adding to dataseries on a per period basis would be easiest.

Is there any other way to generate the HighLow dataset or do I have to devise a workaround using defaultHighLowDataset()?

Any advice would be greatly appreciated,

Simon

Locked