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

Binding bar graph to a non IEnumarable object

1 Answer 27 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Marius du Toit
Top achievements
Rank 1
Marius du Toit asked on 19 May 2010, 07:33 PM
I have a object that exposes a couple of properties that I need to bind to a graph. My graph xaml is as follows:

  <my:RadChart x:Name="overviewChart" Height="400" Width="800">

 <my:RadChart.DefaultView>

    <telerikCharting:ChartDefaultView>

    <telerikCharting:ChartDefaultView.ChartTitle>

    <telerikCharting:ChartTitle Content="Stress Test Overview" HorizontalAlignment="Center"/>

      </telerikCharting:ChartDefaultView.ChartTitle>

<telerikCharting:ChartDefaultView.ChartLegend>

<telerikCharting:ChartLegend x:Name="chartLegend" Header="" UseAutoGeneratedItems="True" BorderThickness="0"/>

</telerikCharting:ChartDefaultView.ChartLegend>

<telerikCharting:ChartDefaultView.ChartArea>

<telerikCharting:ChartArea LegendName="chartLegend">

<telerikCharting:ChartArea.AxisX>

<telerikCharting:AxisX AutoRange="True"></telerikCharting:AxisX>

</telerikCharting:ChartArea.AxisX>

<telerikCharting:ChartArea.AxisY>

<telerikCharting:AxisY Title="% Total Exposure" MaxValue="100" MinValue="0" Step="10" DefaultLabelFormat="0 '%'" AutoRange="False"></telerikCharting:AxisY>

</telerikCharting:ChartArea.AxisY>

<telerikCharting:ChartArea.DataSeries>

<telerikCharting:DataSeries LegendLabel="Warning">

<telerikCharting:DataSeries.Definition>

<telerikCharting:BarSeriesDefinition ItemLabelFormat="0 '%'">

</telerikCharting:BarSeriesDefinition>

</telerikCharting:DataSeries.Definition>

<telerikCharting:DataPoint YValue="33" XCategory="Base"/>

<telerikCharting:DataPoint YValue="45" XCategory="Stressed"/>

</telerikCharting:DataSeries>

<telerikCharting:DataSeries LegendLabel="Alert">

<telerikCharting:DataSeries.Definition>

<telerikCharting:BarSeriesDefinition ItemLabelFormat="0 '%'">

</telerikCharting:BarSeriesDefinition>

</telerikCharting:DataSeries.Definition>

<telerikCharting:DataPoint YValue="66" XCategory="Base"/>

<telerikCharting:DataPoint YValue="35" XCategory="Stressed"/>

</telerikCharting:DataSeries>

<telerikCharting:DataSeries LegendLabel="Clear">

<telerikCharting:DataSeries.Definition>

<telerikCharting:BarSeriesDefinition ItemLabelFormat="0 '%'">

</telerikCharting:BarSeriesDefinition>

</telerikCharting:DataSeries.Definition>

<telerikCharting:DataPoint YValue="66" XCategory="Base"/>

<telerikCharting:DataPoint YValue="97" XCategory="Stressed"/>

</telerikCharting:DataSeries>

</telerikCharting:ChartArea.DataSeries>

</telerikCharting:ChartArea>

</telerikCharting:ChartDefaultView.ChartArea>

</telerikCharting:ChartDefaultView>

</my:RadChart.DefaultView>

</my:RadChart>


I then tried to bind the "YValue" to a property on my class, but this does not work. How would I be able to acheive the above binding all the YValue to seperate properties in my class?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 25 May 2010, 07:50 AM
Hi Marius,

Binding the chart is done in a different fashion. Please, refer to our Data Binding support online documentation.

Sincerely yours,
Joshua
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
Chart
Asked by
Marius du Toit
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Share this question
or