No datas = no spaces. How to do it ?

Discussion about JFreeChart related to stockmarket charts.
Locked
Tintin92
Posts: 2
Joined: Wed Apr 11, 2007 9:46 pm
Contact:

No datas = no spaces. How to do it ?

Post by Tintin92 » Wed Apr 11, 2007 10:17 pm

Hi,

Here how I load the datas :

Code: Select all

		date[1] = DateUtilities.createDate(2001, 3, 21, 12, 0);
		high[1] = 130.0;
		low[1] = 100.0;
		open[1] = 102.0;
		close[1] = 115.0;
		volume[1] = 150.0;

		date[2] = DateUtilities.createDate(2001, 3, 22, 12, 0);
		high[2] = 110.0;
		low[2] = 70.0;
		open[2] = 90.0;
		close[2] = 82.0;
		volume[2] = 160.0;

		date[3] = DateUtilities.createDate(2001, 3, 25, 12, 0);
		high[3] = 90.0;
		low[3] = 70.0;
		open[3] = 82.0;
		close[3] = 88.0;
		volume[3] = 360.0;

	
Here how I display it :

Code: Select all

		OHLCDataset ohlcdataset = new DefaultHighLowDataset("Intel", date,
				high, low, open, close, volume);

		JFreeChart chart = ChartFactory.createCandlestickChart(
				"Lesson 1 Graph", "Date", "Price", ohlcdataset, true);

There are no datas between the 03-22-2001 and 03-25-2001.
JFreeChart display space for 03-23-2001 and 03-24-2001
I dont want spaces.
I try to do the folowing :
no datas = no spaces.
How to do it ?

Thanks,

Tintin92
Tintin92

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Thu Apr 12, 2007 5:50 pm

Call

Code: Select all

dateAxis.setTimeline(Timeline timeline)
passing in one of these
org.jfree.chart.axis.SegmentedTimeline

Locked