#955 Pie Charts Altering Dataset Order

General (896)

When a pre-ordered set of key value pairs is passed into either of the pie charts the order of the Keys is changed. When replicatating graphs, in say a 1 graph per day of the week manner, this results in "aKey1" being painted multiple different colors as its location in the order of keys appears to be random.


  • David Gilbert

    David Gilbert - 2009-08-09

    The PiePlot class won't change the order of the items from the dataset. The DefaultPieDataset class has methods 'sortByKeys()' and 'sortByValues()' if you want to change the order of the items in the plot, but that only happens if you explicitly call those methods.

    I suspect the problem you are seeing is something else (perhaps the colouring of sections when not all pie plots share the same set of keys), but you'll need to post a small self-contained example or a screenshot.

  • David Gilbert

    David Gilbert - 2009-08-09
    • milestone: --> 1.0.x
    • assigned_to: nobody --> mungady
  • James Peterson

    James Peterson - 2009-08-10

    I've attached a word doc with a screen shot of three charts, all built with the same data set. This screen shot was taken from the PDF file created using jasper reports. I don't believe that it is related, but iReport 3.5.2 was used to create the .jasper file. The over all PDF file, after being zipped, is to large to attach to this bug.

    As can be seen the two pie charts show the same key value pairs in the legand but in different orders, while the bar chart's legand displays them in the order of the data returned from the stored proc.

    Data from stored proc return (copied out of DB Visualizer):
    2009-07-27 Monday,68250,Charter Communications
    2009-07-27 Monday,29702,Comcast Cable Communications
    2009-07-27 Monday,1892, Grande Communications
    2009-07-27 Monday,2126, Mediacom
    2009-07-27 Monday,1035, Time Warner

  • Nicholas Sushkin

    I am having the same problem. There is a difference in handling of the dataset between Jasper Report 3.1.4 and 3.5. Doesn't look like I can add an attachments to this bug to illustrate. I'll have to create another bug.


Log in to post a comment.