Vertical Line in Bar Charts

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

Vertical Line in Bar Charts

Post by Andrea » Fri Aug 02, 2002 7:29 pm

Hi there,

I would like to know how to draw a vertical line in a VerticalBarChart or if there is any way to combine a XYChart with a BarChart.

Please can anybody help me?

Thanks,
Andrea

David Gilbert

Re: Vertical Line in Bar Charts

Post by David Gilbert » Mon Aug 05, 2002 11:03 am

Do you want to draw a line in the same direction as the bars? That's not supported, but you can draw a line *across* the bars using the addRangeMarker(...) method in the CategoryPlot class.

There is a way to draw bars with XYPlot, see the VerticalXYBarChartDemo.java file...but this uses a different dataset and doesn't have all the features of the bar charts generated using the CategoryPlot class.

Regards,

DG.

Andrea

Re: Vertical Line in Bar Charts

Post by Andrea » Tue Aug 06, 2002 5:43 pm

Thanks David, it was exactly what I would like to know.

But I have another problem. Can I set the domain labels on a XYChart ??? I have tried to set a diferent label for the X axis but it just put the X value as the label.

Thanks again,
Andrea

Eric

Re: Vertical Line in Bar Charts

Post by Eric » Tue Aug 06, 2002 6:09 pm

This is a bit off-topic, But I think that it would make a lot of sense to do away with the seperated categroy plots and instead implemented them as XYPlots using ultimately IntervalXYDatasets (with a simplified interface) and custom NumberAxis which of course would not display the underlying numbers (which are not important) but the category labels. I don't know if this makes sense, but it seems like this would ultimately simplify everything... you would then only need one type of renderer, and it would make some things simpler like doing a category-plot-ish type thing with time intervals (like months) without worrying about TimeAxis (which are a bit complicated) and this would allow you to do plotfits on these category plots as well.

Andrea

Re: Vertical Line in Bar Charts

Post by Andrea » Tue Aug 06, 2002 7:15 pm

??? :o( ???

Sorry, but I am a little confused...

I could not find the IntervalXYDataset class, can you give me an exemple ???

Thanks in advance,
Andrea

Eric

Re: Vertical Line in Bar Charts

Post by Eric » Fri Aug 09, 2002 7:03 pm

Sorry, i didn't mean to confuse you... this was more of a how i wish it worked not solving your problem...

Locked