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

Chart Legends

6 Answers 67 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 21 Dec 2016, 08:07 PM

Hey

I'm generating charts based on the output from SQL, I have the SQL set to sort the output in a certain order, but when the Report Designer is displaying the chart, It's sorting the legend alphabetically.  I must have my legend in the format:

Good
Fair
Poor

Which is exactly how my SQL is outputting the data.  I've even added an addition ORDER BY statement in the SQL statement INSIDE the designer and it's not working.  

Apparently you can you can fix this with the expression editor, so please provide me the syntax / code to do this, I must have the legends in this format. 

To quote the documentation in your own system:

"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 SortingsExpression or Direction."

How is the chart processing the data in the wrong order, being I delivering to the system in  the exact order it should be processing it.

Thanks
Andrew





6 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 22 Dec 2016, 05:03 PM
Hi Andrew,

Please check the attached video in IE browser. It illustrates how the order of legend items depends on the order of series in the Graph.Series collection, or if the series are generated dynamically - the order set in the Graph.SeriesGroups.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 22 Dec 2016, 05:23 PM

I fail to see the usefulness in that video, I want to control the legend order, not reverse it.  

Here are the two scenario's that I can work with:

1) Load the chart from a properly formatted SQL statement so that the data gets returned, exactly as I want the chart formatted, but as already shown, Telerik ignores the output.

2) Load the chart from three separate SQL statements and control how the chart constructs the stacks so the display is correct.

Lets use that video you sent me, I want you to show how to move the Quality Assurance bar, the green bar to be first, the Manufacturing bar to be second and the Executive General bar to be third.

Also use a stacked chart, which is what I'm working with.

Thanks
Andrew  

0
Andrew
Top achievements
Rank 1
answered on 22 Dec 2016, 05:38 PM
Or can I rearrange it in C#?  If so, please show me code that would allow that.
0
Stef
Telerik team
answered on 23 Dec 2016, 03:49 PM
Hello Andrew,

The Graph item is data-driven template. There is no direct access to the generated bars and legend items in code.

Instead you can add a field in the data that determines at which position you want to have the bar and then use it in the Graph.SeriesGroups.Sortings collection. The newly attached video illustrates the suggestion.


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 23 Dec 2016, 04:18 PM
Hey

Thanks for that video, I think it actually addresses the question I have.

However, well that's a usable work around, you guys need to make the system accept either user driving rearrangement, or at least obey the SQL output from the system.  

For instance if I tell the SQL output to order via a set of ORDER BY instructions, the process engine, MUST obey it.  Well I can accept that's not a current feature as it seems to have been overlooked, please make it a feature in the next release.  

Thanks
Andrew
0
Stef
Telerik team
answered on 23 Dec 2016, 04:25 PM
Hi Andrew,

The order of data in the data source will be respected if no other sorting is applied. Test deleting all  Graph.SeriesGroups.Sortings entries.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Andrew
Top achievements
Rank 1
Answers by
Stef
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or