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

StackedBarchart ItemLabelFormat

1 Answer 10 Views
Chart
This is a migrated thread and some comments may be shown as answers.
ALAN
Top achievements
Rank 1
ALAN asked on 07 Aug 2014, 01:02 PM
Hi,

I have a stacked bar chart and am trying to get the chart to show the % of the category for the specific series.  For example, If I have the following data structure:

Category: 2014-01
Series 1:  150
Series 2:     75

This generates a stacked bar chart. In the ItemLabel I want to show the relative percentages of each series so that the following is displayed:

2014-01
Series 1 label = 66.7%
Series 2 label = 33.3%

I have tied using the various formatting options, but none seem to deliver what I want. Any ideas?

Regards,

Alan

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 11 Aug 2014, 07:05 AM
Hi Alan,

We have an old RadChart control and a new ChartView set of controls. The new control is much faster than the old component, it resolves many limitations the RadChart has, it is very flexible and easy to set up. If you are indeed using the old RadChart and you have not yet integrated it in your application, we strongly suggest you remove it completely and use the chartview. The answer below concerns a RadCartesianChart (one of the ChartView controls) and not RadChart.

Even though the chart calculates the values in percentages, the individual series does not know about the rest of the series and there is no direct way you can get the percentage.

You can create a new Percent property in your actual business item and calculate the percent in your models. Later you can use the LabelDefinition property of the series and specify a Binding (look for the Binding property of the ChartSeiesLabelDefinition), Binding="Percent". Let us know how it goes.

Regards,
Petar Marchev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Chart
Asked by
ALAN
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or