HiLoBar XYPlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Andreas Schroeder

HiLoBar XYPlot

Post by Andreas Schroeder » Fri Sep 20, 2002 8:02 am

Hi all,
i have to display some data in a maybe unusual way. I want to use a XYPlot, and get a result like the HorizontalIntervalBarRenderer does:

draw a bar that starts on a given value an ends on a second value.
I have tried the HighLowRenderer, but it draws only sticks, not bars.

The CandlestickRenderer is more what i need (if you ignore the high and low values, wich i do by implementing my own version of HighLowDataset), but the colors of the "bars" is settled by the upPaint and downPaint.

I guess that i have to implement a renderer that uses the IntervalXYDataset, since this one provides the data the renderer would need. I will try it maybe today, maybe monday, so i wanted to ask for hints or "support" ;-) for my project.

Thanks in advance for any help

Regards,

Andreas Schroeder
ASF developer

David Gilbert

Re: HiLoBar XYPlot

Post by David Gilbert » Fri Sep 20, 2002 8:57 am

Hi Andreas,

Creating your own renderer will be the best approach.

The idea of putting the renderers into separate classes is so that you can change the appearance of the charts without having to mess too much with the internals of JFreeChart.

IntervalXYDataset is definitely the one to use for the type of chart you described.

Let me know if you have any suggestions regarding the XYItemRenderer interface...no one has provided any feedback on it yet.

Regards,

DG.

Andreas Schroeder

Re: HiLoBar XYPlot

Post by Andreas Schroeder » Fri Sep 20, 2002 10:22 am

Hi David,

Ok, i will take a try, and commit it by time when it works.

And thank you for developing such a great charting system.

btw, i have some headache about the dateAxis tick labels localization.
I will ask you again, if i am about to develop something about it.

Regards,

Andreas Schroeder

David Gilbert

Re: HiLoBar XYPlot

Post by David Gilbert » Fri Sep 20, 2002 10:53 am

Hi Andreas,

Several other people have commented about the date axis formatter. I think life will be simpler if I add a method to the DateAxis class:

public void setTickLabelFormatter(DateFormat formatter);

Then you can supply your own formatter using whatever locale you require.

Regards,

DG.

Andreas Schroeder

Re: HiLoBar XYPlot

Post by Andreas Schroeder » Fri Sep 20, 2002 11:09 am

Hi David,

no, that's not really the point.
I must provide a graphic with an appropriate tick size while not knowing just how big the range is. Similar problem to the NumberAxis, which was solved with the TickUnits. As you might allready guess, i am considering a similar solution, but as i looked through the code i saw that this would include major modifications - but still would be the best solution. I haven't invastigated the problem very far, though, so i might be wrong. I will review it by time.

Regards,

Andreas Schroeder

David Gilbert

Re: HiLoBar XYPlot

Post by David Gilbert » Fri Sep 20, 2002 11:17 am

OK, that is something that has been on my list for a long time...I've put off tackling it because it is a big job, and not quite as easy as the numerical axis. But I do want it to work the same way, as much as possible, so I will be putting some time into this soon...

Regards,

DG.

Andreas Schroeder

Re: HiLoBar XYPlot

Post by Andreas Schroeder » Fri Sep 20, 2002 11:27 am

... and btw,
i have added the method setTickLabelFormatter(...) to my own version of the code, and believe me, this doesn't really help, because the DateAxis will still use his own String-patterns provided by the String[] standardTickFormats if it is set to autorange :-)

Regards,

Andreas Schroeder

David Gilbert

Re: HiLoBar XYPlot

Post by David Gilbert » Fri Sep 20, 2002 11:33 am

True, I had forgotten that.

Regards,

DG.

Locked