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
Vertical Line in Bar Charts
Re: Vertical Line in Bar Charts
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.
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.
Re: Vertical Line in Bar Charts
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
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
Re: Vertical Line in Bar Charts
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.
Re: Vertical Line in Bar Charts
???
( ???
Sorry, but I am a little confused...
I could not find the IntervalXYDataset class, can you give me an exemple ???
Thanks in advance,
Andrea

Sorry, but I am a little confused...
I could not find the IntervalXYDataset class, can you give me an exemple ???
Thanks in advance,
Andrea
Re: Vertical Line in Bar Charts
Sorry, i didn't mean to confuse you... this was more of a how i wish it worked not solving your problem...