Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Pie slice sorting?

    Hi,

    Is it possible to sort the internal slices of the pie charts in descending order? For example in the pie chart below in the red box, is it possible to make sure that the green slice is next to the light-blue slice? This example is from http://www.smartclient.com/smartgwte...ltiSeriesChart.

    In my application (not the example), I tried by sorting the data that was being retrieved, but it did not work. In my application I could get the first pie chart to sort it correctly based on the values (slice size), but every pie chart after would not be sorted properly. The first pie chart matched the ordering of my data, but the second pie chart deviated from the data ordering. To clarify I am using a single FacetChart with two facets, which produces multiple pie charts like the example below.

    Thanks. Click image for larger version

Name:	pieslices.png
Views:	56
Size:	31.8 KB
ID:	245738




    In the example above, it appears that it's sorted based on North, South, East, West, but is there a way to change each chart to be sorted based on the Revenue values?
    Last edited by user316; 13 Jul 2017, 11:30.

    #2
    The same ordering is used for every pie chart, for ease of comparison between charts. While you can influence the ordering via either data ordering or explicitly declaring facet.values, there's no way to have different ordering per chart.

    Possible approaches would be:

    1. Draw each pie as a separate FacetChart instance, suppressing separate titles and legends, then draw your own legend

    2. Just draw your own pies from scratch based on DrawPane

    3. Feature Sponsorship to introduce value-ordered rendering or perhaps an override point allowing you to define slice ordering in an arbitrary way

    Comment

    Working...
    X