This is a migrated thread and some comments may be shown as answers.

Can the sort order of a Graph Legend be controlled?

4 Answers 488 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
NerdBrick
Top achievements
Rank 1
NerdBrick asked on 13 Dec 2013, 08:31 PM
Hi, 

We are using the new PIE Graph (polar), and we are wondering if there is a property that helps control the sort order of the Legend items? 
If you see the attached image you can see how they aren't sorted by Name of the item, but are actually sorted by the values they hold behind them. I can see how that might be the default because you want to a PIE graph to be ordered by low to high, but we want the legend to be alpha sorted. The other hope with this is we can control which color is tied to which item for constancy of reporting.

In the old Charts you would have to build the Legend manually to get this, but is there some other way to do this with Graphs?

Thank you

4 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 16 Dec 2013, 04:38 PM
Hello Brick,

As explained in the Formatting Graph Legend help article, items are ordered in the legend according to the order that they are processed by the processing engine. You can change the order by changing the Graph.SeriesGroups Sortings Expression or Direction.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
NerdBrick
Top achievements
Rank 1
answered on 16 Dec 2013, 06:32 PM
Thank you for the reply. 

Looks like the SeriesGroups sorting did change the legend order , but this also changed the order on the Pie graph. Our goal is to have the Pie chart ordered by value of the data points, and the legend order by name. Possible? 

0
Accepted
Nasko
Telerik team
answered on 19 Dec 2013, 02:08 PM
Hello Brick,

The series group order determines the legend items order and currently it is not possible to sort them separately.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
NerdBrick
Top achievements
Rank 1
answered on 19 Dec 2013, 03:55 PM
Thank you for the follow up. 

This is not an important feature that is needed. It was just mainly a curious question if it was possible as we present the final design to management and trying to anticipate their requests. 

Back to coding. 
Tags
General Discussions
Asked by
NerdBrick
Top achievements
Rank 1
Answers by
Nasko
Telerik team
NerdBrick
Top achievements
Rank 1
Share this question
or