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

Few problems with StackedBar

1 Answer 21 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sivam
Top achievements
Rank 1
Sivam asked on 21 Jun 2010, 06:52 AM
Hi,

  I'm specifying the bar width and colors to series programatically. 

chartseries.Type = Telerik.Reporting.Charting.ChartSeriesType.StackedBar;  
chartseries.Appearance.BarWidthPercent = 15;  
chartseries.Items[j].Label.Visible = false;  
chartseries.Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(57, 19, 232); 

For StackedBar chart, i don't see the impact. The Bar width is still auto eventhough i set it to 15%. The bar becomes multiple color when i specify the color.
When i apply the same to a Bar chart, the width is set to 15% and the color is applied. Why does it not apply to StackedBar? Whether the properties which needs to set is different for StackedBar?

In StackedBar, how can i show the total of item values above the bar? similarly on DataTable how to show the total?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Jun 2010, 11:56 AM
Hello Sivam,

When StackedBar is used, you have to set the Chart's BarWidthPercent property instead of the Series' one as shown in the following code snippet:
chart1.Appearance.BarWidthPercent = decimalValue;

By default the Chart Series FillType is set to gradient, to avoid multiple fill colors please set the FillType property to Solid:
chartSeries1.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;

As to your last question there is no out of the box solution to display the sum of the Series' Items. Our suggestion in this case would be to manage that with your own code.

Best wishes,
Peter
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
Sivam
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or