krispyjala Posted May 18, 2007 Share Posted May 18, 2007 Hello all!I am running into some trouble trying to sort the series within each category of my bar graph. It seems that my series is not sorted as it should (Low, Medium, High, Critical) and these values had been converted from an id value in descending order of (3,2,1,0). In my subdataset input, my sql query is already ordering by category (MMM-yyyy) and by priority in descending order. It appears to me what's happening is that whatever value is drawn first on the bar graph, the report just puts it first until it encounters another one etc...that is why in my graph is showing High Low Medium Critical. Is there a way to fix this? I have started looking into writing my own class (using JRChartCustomizer) but still I cannot find a way to manipulate the data within JFreeChart's chart variable. Has anybody encountered this problem and if so how did you get around it?Any help is greatly appreciated!Best,Kris.Post edited by: krispyjala, at: 2007/05/17 21:55 Link to comment Share on other sites More sharing options...
bklawans Posted May 19, 2007 Share Posted May 19, 2007 You are right about JFreeChart - it adds series in the order it finds them. One option is to add some null values to the query with the series in the order you want, via a SQL UNION. -Barry Link to comment Share on other sites More sharing options...
krispyjala Posted May 21, 2007 Author Share Posted May 21, 2007 Thanks Barry! That idea is brilliant (though the sql is quite convoluted for my case). At least it works as I intended now =) Link to comment Share on other sites More sharing options...
theclosh Posted January 13, 2011 Share Posted January 13, 2011 I am in the same boat as the user who posted this. Your answer intrigues me as I haven't found any way around this thus far. Can you provide more specifics as to how your solution works?Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now