A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
iogan18tm
- Posts: 24
- Joined: Tue May 04, 2004 5:14 pm
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
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: 11734
- 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.