Binding bar graph to a non IEnumarable object

2 posts, 0 answers
  1. Marius du Toit
    Marius du Toit avatar
    2 posts
    Member since:
    Sep 2009

    Posted 19 May 2010 Link to this post

    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.
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 25 May 2010 Link to this post

    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.
Back to Top