cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Can I change the data order of the pie chart?

tguo
4-Participant

Can I change the data order of the pie chart?

Hi all,

   My pie chart is like this:

   WeChat Image_20170523174528.png

The status is "Medium", "OK" and "Severe". How can I change the order of status to Severe, Medium and OK or vice versa?

ACCEPTED SOLUTION

Accepted Solutions
khayes1
15-Moonstone
(To:tguo)

Hi,

I think the way you would do this is to sort your infotable into the order you want before passing the data to the widget. There is a Sort() service in the snippets under 'infotable' category. I guess there are a number of ways to do this.

1. Assign a number value to each category.

2. sort alphabetically

although these wouldn't give you many variations.

Probably the best way to do it would be to query each category individually, in the order you want, then add them to a final infotable. So, Query only for 'OK' category, add the output to a result infotable, Next Query for 'Medium' category and add the output to the results infotable... and so on

View solution in original post

2 REPLIES 2
khayes1
15-Moonstone
(To:tguo)

Hi,

I think the way you would do this is to sort your infotable into the order you want before passing the data to the widget. There is a Sort() service in the snippets under 'infotable' category. I guess there are a number of ways to do this.

1. Assign a number value to each category.

2. sort alphabetically

although these wouldn't give you many variations.

Probably the best way to do it would be to query each category individually, in the order you want, then add them to a final infotable. So, Query only for 'OK' category, add the output to a result infotable, Next Query for 'Medium' category and add the output to the results infotable... and so on

tguo
4-Participant
(To:khayes1)

Dear Kieron,

       I have tried second method. It is OK now.

      WeChat Image_20170524093517.png

  Thank you!

Announcements


Top Tags