I am trying to draw vertical bar chart everything else works fine chart is drawn fine but the labels on the x-axis are not in proper sequence as corresponding to the values on y-axis, they are somehow jumbled up. Can somebody suggest what am I missing.
Thanks
Sang
x-axis labels not coming in proper sequence
Re: x-axis labels not coming in proper sequence
To complete my problem
I am using jdbc to get data from the oracle database and then retrieving the x and y axis values from it to construct the graph.
I am using jdbc to get data from the oracle database and then retrieving the x and y axis values from it to construct the graph.
Re: x-axis labels not coming in proper sequence
With the vertical bar chart, the x-axis displays *categories* (arbitrary subclasses of Object, with the labels coming from the toString() method). JFreeChart doesn't make any attempt to order these...so if you use "The Good", "The Bad" and "The Ugly" for your categories, they will stay in the order you supply them (rather than getting sorted into "The Bad", "The Good" and "The Ugly").
If you use Number objects for your categories (not a good idea) then the results may surprise you. You might consider using XYPlot to display your data in this case. There is an XYBarRenderer class that can draw bars (keep in mind that you have to supply start and end X values so that it knows how wide the bars should be...you could write your own class that implements IntervalXYDataset to calculate fixed widths from single x-values if you wanted to.
Regards,
DG.
If you use Number objects for your categories (not a good idea) then the results may surprise you. You might consider using XYPlot to display your data in this case. There is an XYBarRenderer class that can draw bars (keep in mind that you have to supply start and end X values so that it knows how wide the bars should be...you could write your own class that implements IntervalXYDataset to calculate fixed widths from single x-values if you wanted to.
Regards,
DG.
Re: x-axis labels not coming in proper sequence
I used the XYPlot for this, using something like to_number(TO_char(BOOKING_TIMESTAMP,'HH24'))
I still do not understand why the categories have arbitrary sorting. Why not use the same order that they are added?
I still do not understand why the categories have arbitrary sorting. Why not use the same order that they are added?