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

[Solved] Bind different Sources to one Series

1 Answer 78 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Florian
Top achievements
Rank 2
Florian asked on 03 Apr 2013, 02:18 PM
Hello Support,

I am using the RadCartesianChart with categorial axis as the horizontal axis and linear axis as the vertical axis.

I am displaying all my data in percent, so my maximum is 100 and my values are calculated percent values of the actual values.
This works fine.

Now i want to display the ACTUAL value with the Label (over each bar) while my BarSeries is calculated by the percent value.

My collection i would like to bind is looking like this:
List<BarData> myChartData;

And BarData is:
class BarData
{
   public int actualValue { get; set; }
   public int percentValue { get; set; }
}

1 Answer, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 04 Apr 2013, 04:05 PM
Hi Florian,

Thank you for contacting us.

In this case you can use the BarSeries.LabelDefinitions property and create a ChartSeriesLabelDefinition. Then you can bind it to the desired property from your class. Here's an example:
<telerikChart:BarSeries.LabelDefinitions>
    <telerikChart:ChartSeriesLabelDefinition HorizontalAlignment="Center">
        <telerikChart:ChartSeriesLabelDefinition.Binding>
            <telerikChart:PropertyNameDataPointBinding PropertyName="actualValue"/>
        </telerikChart:ChartSeriesLabelDefinition.Binding>
    </telerikChart:ChartSeriesLabelDefinition>
</telerikChart:BarSeries.LabelDefinitions>

I hope this helps. Let me know if I can assist you in some other way.

 

All the best,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for XAML
Asked by
Florian
Top achievements
Rank 2
Answers by
Ivaylo Gergov
Telerik team
Share this question
or