Data Binding to Many Chart Areas

2 posts, 0 answers
  1. Dang Tran Tuan Anh
    Dang Tran Tuan Anh avatar
    3 posts
    Member since:
    Mar 2010

    Posted 26 Oct 2010 Link to this post

    Hello,

    I created a chart with 2 areas as following:
    <telerikChart:RadChart x:Name="radChart" UseDefaultLayout="False">
       
    <Grid Margin="10,10,0,20">
           
    <Grid.RowDefinitions>
               
    <RowDefinition Height="Auto" />
               
    <RowDefinition Height="*" />
           
    </Grid.RowDefinitions>
           
    <Grid.ColumnDefinitions>
               
    <ColumnDefinition Width="*" />
               
    <ColumnDefinition Width="*" />
           
    </Grid.ColumnDefinitions>
           
    <telerikCharting:ChartTitle Margin="0,0,0,10" HorizontalAlignment="Center" Content="Year 2008"
               
    Grid.Row="0" Grid.Column="0" />
           
    <telerikCharting:ChartArea x:Name="webBrowsersShare2008Chart" Grid.Row="1" Grid.Column="0" />
           
    <telerikCharting:ChartTitle HorizontalAlignment="Center" Content="Year 2009"
               
    Margin="0,0,0,10" Grid.Row="0" Grid.Column="1" />
           
    <telerikCharting:ChartArea x:Name="webBrowsersShare2009Chart"
               
    Margin="0,0,0,15" Grid.Row="1" Grid.Column="1" />
       
    </Grid>
       
       
    <telerikChart:RadChart.SeriesMappings>
           
    <telerikCharting:SeriesMapping CollectionIndex="0" ChartAreaName="webBrowsersShare2008Chart">
               
    <telerikCharting:SeriesMapping.SeriesDefinition>
                   
    <telerikCharting:DoughnutSeriesDefinition />
               
    </telerikCharting:SeriesMapping.SeriesDefinition>
               
               
    <telerikCharting:SeriesMapping.ItemMappings>
                   
    <telerikCharting:ItemMapping FieldName="Value" DataPointMember="YValue" />
                   
    <telerikCharting:ItemMapping FieldName="Description" DataPointMember="Label" />
               
    </telerikCharting:SeriesMapping.ItemMappings>
           
    </telerikCharting:SeriesMapping>
           
    <telerikCharting:SeriesMapping CollectionIndex="1" ChartAreaName="webBrowsersShare2009Chart">
               
    <telerikCharting:SeriesMapping.SeriesDefinition>
                   
    <telerikCharting:DoughnutSeriesDefinition />
               
    </telerikCharting:SeriesMapping.SeriesDefinition>
               
    <telerikCharting:SeriesMapping.ItemMappings>
                   
    <telerikCharting:ItemMapping FieldName="Value" DataPointMember="YValue" />
                   
    <telerikCharting:ItemMapping FieldName="Description" DataPointMember="Label" />
               
    </telerikCharting:SeriesMapping.ItemMappings>
           
    </telerikCharting:SeriesMapping>
       
    </telerikChart:RadChart.SeriesMappings>
    </
    telerikChart:RadChart>


    How can I set data source for each area?
    I have tried:
    webBrowsersShare2008Chart.ItemsSource = ItemSource1
    webBrowsersShare2009Chart.ItemsSource = ItemSource2;
    or radChart.ItemsSource = ItemSource;

    But They didn't work for all!
    Thanks!
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 26 Oct 2010 Link to this post

    Hi Dang Tran Tuan Anh,

    Setting the ChartArea.ItemsSource like this is currently not supported. Check this help article that explains how you can use databinding with many ChartAreas.

    Hope this helps.


    Regards,
    Freddie
    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