TimePeriodValues TimeSeries TimeTableXYDataSet

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
iogan18tm
Posts: 24
Joined: Tue May 04, 2004 5:14 pm

TimePeriodValues TimeSeries TimeTableXYDataSet

Post by iogan18tm » Sat Sep 30, 2006 9:33 am

The task is to have 3 series on a chart. Two - in stacked bar rendering, one - in line and shape. All of them are bound to hours (hour,value).
The problem is when i do use TimeTableXYDataSet for stacked bar, my LineAndShape does a strange thing - its not drawn in the center of a period, but on the left side - like this
Image

It doesnt matter what i use for LineAndShape rendering - TimeSeries or TimePeriodValues. (all three series collections recieves setDomainIsPointsInTime(false)).

iogan18tm
Posts: 24
Joined: Tue May 04, 2004 5:14 pm

Post by iogan18tm » Sun Oct 01, 2006 2:45 pm

As you can see - it solved problem - using TimePeriodValues.

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

Post by david.gilbert » Mon Oct 02, 2006 10:46 am

You can use either the TimeSeriesCollection or TimePeriodValuesCollection classes. The position of the x-value within each time period is controlled by the setXPosition() method - unfortunately, it looks as though there is an inconsistency between the two classes with respect to the default value (it is TimePeriodAnchor.START for TimeSeriesCollection, and TimePeriodAnchor.MIDDLE for TimePeriodValuesCollection). But, of course, you can override the default setting, so use whichever dataset makes the most sense for your data.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited

Post Reply