I have a Graph which shows time-based data usind a XYPlot. I use a TimeSeriesCollection with one TimeSeries for each datarow I have to display because of my intern metadata definition and because I implemented the possibility to make single series (un-)visible using checkboxes. So each Collection has its own DateAxis, but only the first of them is made visible. For each DateAxis, I set a 2-week DateTickUnit so that the labels of the x-axis show dates in 2-week-steps.
Now, some of my TimeSeriesCollections get a XYLineAndShapeRenderer and some get a ClusteredXYBarRenderer so that they are displayed as lines or bars, according to my metadata definition. Now, the points of TimeSeriesCollection displayed as lines fit the date-labels of the x-axis, but those displayed as bars don't fit them. Has anybody an idea how I can achieve that? I would like the bars to be displayed centered over the labels of the x-axis.
Thank you
TimeSeries & mixed Chart (Lines & Bars)
-
- Posts: 32
- Joined: Thu Apr 22, 2004 9:15 am
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Maybe the setXPosition() method in the TimeSeriesCollection class will help? By default, it returns x-values at the start of each time period, but you can change that to the center (which I think is what you need) or the end.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 32
- Joined: Thu Apr 22, 2004 9:15 am