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

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

1 Answer 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 30 May 2011, 01:35 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 01 Jun 2011, 09:43 AM
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
Tags
General Discussions
Asked by
Derek
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or