OHLC dates always renders in the middle of the year

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
samoht
Posts: 12
Joined: Wed Jun 18, 2008 12:25 pm
Location: Norway

OHLC dates always renders in the middle of the year

Post by samoht » Thu Jul 10, 2008 12:10 pm

I have created a chart where I want one OHLC set each year.. but my graphs always renders in the middle of 2 years like it is in june.. This is what i have

Year temp = new Year(2001);
OHLCSeries s2 = new MyOHLCSeries("test");
s2.add(new Year(new Date(temp.getFirstMillisecond())), 10, 10, 2, 2);

This renders right between 2001 and 2002.. why is that?
its like it finds the year and uses getMiddleMillisecond() in some way when it renders.

I found that OHLCSeriesCollection has
TimePeriodAnchor xPosition = TimePeriodAnchor.MIDDLE; set and no way of changing the value. So ill have to make my own.

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 Jul 10, 2008 3:14 pm

Thanks for reporting this. I've added getXPosition() and setXPosition() methods to the OHLCSeriesCollection class, for inclusion in the 1.0.11 release (later this month, all going well).
David Gilbert
JFreeChart Project Leader

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

patb
Posts: 11
Joined: Sun Aug 03, 2008 7:55 pm

Post by patb » Wed Aug 06, 2008 8:55 am

Hello,

any updates on this? I have the same problem, my intervals are drawn between two time values because of that TimePeriodAnchor.MIDDLE.

When will 1.0.11 be ready with those getXPosition() and setXPosition() methods?

Thanks a lot!

Locked