TimeSeries & mixed Chart (Lines & Bars)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
DopeForADay
Posts: 32
Joined: Thu Apr 22, 2004 9:15 am

TimeSeries & mixed Chart (Lines & Bars)

Post by DopeForADay » Thu Jun 29, 2006 9:22 am

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

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

Post by DopeForADay » Tue Jul 18, 2006 6:59 am

Does nobody know? Or is something unclear? Please help me :cry:

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Tue Jul 18, 2006 7:15 am

DopeForADay wrote:Or is something unclear?
Yes, quite all is unclear to me. Try using some screenshots and/or sketches...

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 18, 2006 10:26 am

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

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

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

Post by DopeForADay » Tue Jul 18, 2006 10:53 am

Thank you for your help. Seems like my colleague managed to solve the problem by writing a custom renderer.

Locked