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

Grand Total on top of the stacked bar chart

1 Answer 205 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Arima
Top achievements
Rank 1
Arima asked on 25 Oct 2011, 03:44 PM
Hi

I want to display the grand total on top of the last series. When i do the DefaultLabelValue for the last chart series, it is overriding the last series label value. Please guide me to achieve the grand total in the stacked bar. Please see the attached image.
if (cs.Index == chart.Series.Count-1)
                {
                    cs.DefaultLabelValue = "#STSUM";
                    cs.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;
                    cs.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Auto;
                                    }

Anyone guide me how the calculation is happening for the cs.DefaultLabelValue = "#STSUM"; So that i could add one more series with all the values as 1 and substracting 1 from the total.

Regards
Arima

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 27 Oct 2011, 08:32 AM
Hi Arima,

Using "#STSUM" represents the sum of all stacked items for a given index and you cannot subtracts a value from it. You should manually calculate the sum total value and assign it to the last series which values you want to show as the total sum of all the others.

Kind regards,
Peshito
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Chart (Obsolete)
Asked by
Arima
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or