Hi,
I've asked this question before and got a good answer but now I'm looking for a slightly different answer.
I'm plotting a histogram as Category Data. All's cool except that the x-axis gets really screwed up when there are many categories. I would like the x-axis to be an ordinary number-values axis. Is there a way for me to do it now without *too much* effort? Alternatively, can I draw a regular XY-data graph and paint in the area underneath the graph.
Many thanks in advance!
Pavel
Category Axis
RE: Category Axis
Hi Pavel,
I've thought about how I might implement XYBarPlot, which will require an extension of the XYDataSource class as well as the new XYBarPlot class. The data source has to give the plot two X values (each side of the bar) as well as a Y value. In fact, I'll make XYBarDataSource return three X values - each side of the bar, and the original X value (middle of the bar). That way you can use the same datasource for XYPlots and XYBarPlots.
This will be a bit of effort, so you might want to direct your effort at getting the XYPlot to paint the area between the Y values and the axis. That should only require a modification to the draw(...) method.
If anyone feels like implementing any of this, I'm short of time (still!)...
Regards,
DG.
I've thought about how I might implement XYBarPlot, which will require an extension of the XYDataSource class as well as the new XYBarPlot class. The data source has to give the plot two X values (each side of the bar) as well as a Y value. In fact, I'll make XYBarDataSource return three X values - each side of the bar, and the original X value (middle of the bar). That way you can use the same datasource for XYPlots and XYBarPlots.
This will be a bit of effort, so you might want to direct your effort at getting the XYPlot to paint the area between the Y values and the axis. That should only require a modification to the draw(...) method.
If anyone feels like implementing any of this, I'm short of time (still!)...
Regards,
DG.