Chart Legends

7 posts, 0 answers
  1. Andrew
    Andrew avatar
    11 posts
    Member since:
    Nov 2016

    Posted 21 Dec 2016 Link to this post

    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





  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 22 Dec 2016 Link to this post

    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
  3. Andrew
    Andrew avatar
    11 posts
    Member since:
    Nov 2016

    Posted 22 Dec 2016 in reply to Stef Link to this post

    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  

  4. Andrew
    Andrew avatar
    11 posts
    Member since:
    Nov 2016

    Posted 22 Dec 2016 in reply to Stef Link to this post

    Or can I rearrange it in C#?  If so, please show me code that would allow that.
  5. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 23 Dec 2016 Link to this post

    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
  6. Andrew
    Andrew avatar
    11 posts
    Member since:
    Nov 2016

    Posted 23 Dec 2016 in reply to Stef Link to this post

    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
  7. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 23 Dec 2016 Link to this post

    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
Back to Top