Using TimeSeries in StackedArea Chart (StackedXYAreaChartDem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
HighWay
Posts: 6
Joined: Tue Jul 17, 2007 12:37 am

Using TimeSeries in StackedArea Chart (StackedXYAreaChartDem

Post by HighWay » Tue Jul 17, 2007 1:00 am

Hi,

I have been using JFreeChart for 1 year and am impressed with the easy and the quality of graph also the documentation (need some improvement).

Lately I stumbled on a problem and I cannot find a solution ….

Problem: Need for a Stacked Area Time Series chart.

Good example for this is under Area Charts --> StackedXYAreaChartDemo1.java (this does not use timeseries dataset). However, I need timeseries DataSet (like the one under Area Chart --> XYAreaChartDemo2.java)

So can someone tell me/direct me how to replace TableXYDataset to IntervalXYDataSet and use it in JFreeChart chart = ChartFactory.createStackedXYAreaChart(……

Or

Any other solutions that will help me resolve this.

Thanks
Zack

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 17, 2007 11:20 am

Have a look at StackedXYAreaChartDemo3.java.
David Gilbert
JFreeChart Project Leader

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

HighWay
Posts: 6
Joined: Tue Jul 17, 2007 12:37 am

Post by HighWay » Wed Jul 18, 2007 12:26 am

StackedXYAreaChartDemo3.java does not support TimeSeries Dataset (my data could be in seconds,days,weeks,months,years).

I was able to create Stacked Area chart from ChartFactory.createXYAreaChart(with TimeSeries dataset as Second.class). I faced problem while setting the color of stacked chart.

Note: the code below successfully set the color for legend but failed to set the color for stacked area.

renderer.setSeriesPaint(0, Color.GREEN);

Do I have to something special to set the color for stacked area?

Thanks,
Zack

m_dieu
Posts: 15
Joined: Thu Sep 27, 2007 12:33 pm

Post by m_dieu » Mon Nov 12, 2007 4:19 pm

Hi,

I'm having the same claim so is there any solution for this problem?

Thanks in advance!

mentox
Posts: 9
Joined: Thu Jan 03, 2008 11:02 am

Post by mentox » Thu Jan 03, 2008 11:04 am

Hi,

i also want to make an chart. stacked area and in x time series.

but i cant get it work. :-(


anyone have an soulution for the stacked area time series problem ?!

greeting mentox

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 » Thu Jan 03, 2008 11:24 am

This is a limitation in JFreeChart. You need to use a TimeTableXYDataset. There is some work being done on the StackedXYAreaRenderer class that will hopefully mean that a regular TimeSeriesCollection can be plotted in the future---but for now, it can't.
David Gilbert
JFreeChart Project Leader

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

dymaxion
Posts: 6
Joined: Mon Mar 10, 2008 4:10 pm
Location: London, UK

Post by dymaxion » Mon Mar 10, 2008 4:14 pm

I'm using a TimeTableXYDataset and rendering it with a XYStepAreaRenderer. I have a vertical (time) crosshair applied, and want to query the value of the underlying Dataset once I've fetched the crosshair value.

I cannont find anyway of looking up the data row given a time in millis.
It seems there is a remove(TimePeriod period, String seriesName) method. But not a similar get() method.

The internal DefaultKeyedValues2D is private so I can't seem to find any way of getting the data.

Thanks

Locked