RadDomainDataSource and ChartView

2 posts, 0 answers
  1. Mindy
    Mindy avatar
    4 posts
    Member since:
    Mar 2011

    Posted 08 Aug 2012 Link to this post

    Hello,  I'm trying to bind data to a chart using the RadDomainDataSource however my chart is not returning values.  Below is the code I'm using.  I would like to know first of all if I have everything set up correctly?  I also wanted to know if "DataView" in the ItemSource should be unique per project, or will it be the same all the time?

     

     

     

    <telerik:RadDomainDataSource x:Name="xRadDomainDataSource" QueryName="GetProtocolsQuery" 
                                                                        AutoLoad="True">
                <telerik:RadDomainDataSource.DataContext>
                    <service:iTRACKContext/>
                </telerik:RadDomainDataSource.DataContext>
      
            </telerik:RadDomainDataSource>
                  <telerik:RadCartesianChart x:Name="chart" Width="222">
                        <telerik:RadCartesianChart.HorizontalAxis>
                            <telerik:CategoricalAxis/>
                        </telerik:RadCartesianChart.HorizontalAxis>
      
                        <telerik:RadCartesianChart.VerticalAxis>
                            <telerik:LinearAxis Maximum="100"/>
                        </telerik:RadCartesianChart.VerticalAxis>
      
                        <telerik:RadCartesianChart.Series>
                            <telerik:BarSeries CombineMode="Stack" ItemsSource="{Binding DataView, ElementName=xRadDomainDataSource}" ValueBinding="Duration" CategoryBinding="FundingID"
                                               ShowLabels="True">
      
                             
                            </telerik:BarSeries>
                        </telerik:RadCartesianChart.Series>
      
                    </telerik:RadCartesianChart>
  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 13 Aug 2012 Link to this post

    Hello Mindy,

    From the code you shared I can't see any immediate problem. The chartview is a data control and can visualize any data that is in the form of IEnumerable.  You can place a gridview in the place of your chartview to see if the data is reachable.

    I have prepared for you a small project that demonstrates how you can databind chartview to RIA services.

    Greetings,
    Yavor
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top