Possible to show stackedbar datatable AND a stacked bar total in chart?

2 posts, 1 answers
  1. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 30 May 2011 Link to this post

    My developers are constructing a stacked bar chart, and have included a datatable to show the values of the stacked elements. The user has also asked to see the total value for each stacked bar. There are references to changing the label of the last series to show the total, using STSUM, but it appears this also changes the display in the datatable (so that the last series shows the total in the datatable as well).

    Any suggestions on including BOTH the datatable and a stacked bar total, either in the datatable or as a label on the bar?

    Alternatively is it possible to have a bar value which shows in the datatable but NOT in the chart?

    TIA
  2. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 01 Jun 2011 Link to this post

    Hi Derek,

    You can add an additional ChartSeries with Name="Total" and the same number of ChartSeriesItems as the other ChartSeries, but all of these items should have YValue=0. This ChartSeries will be used to display an entry in the datatable and possibly some labels in the plotarea. Set its DefaultLabelValue with "#STSUM" and you will have the required DataTable entry.

    Now, the labels of this "total" series will overlap with other stackedbar labels, so you can set the IntelligentLabelsEnabled property to true. As long as the chart is not overloaded with items this will work fine and the total will appear above the other values. However, when more labels are displayed this might not yield the best expected result, so I would suggest hiding the total labels, the values will remain visible in the datatable.

    Hope this helps.

    Best regards,
    Ves
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top