Binding pie chart to timebar

3 posts, 0 answers
  1. Ray White
    Ray White avatar
    5 posts
    Member since:
    Feb 2007

    Posted 02 May 2012 Link to this post

    Is there a way to bind a RadPieChart to a TimeBar?

    The RadChart has a nice TimeBar property that can be used to display only the data selected by a RadTimeBar.  Nice!  But I don't see this for RadPieChart.  Here's how I bind to RadChart:

     

    <telerik:RadChart.TimeBar>

        <Binding ElementName="timeBar1" />

    </telerik:RadChart.TimeBar>

    <telerik:RadChart.SeriesMappings>

        <telerik:SeriesMapping>

            <telerik:ItemMapping DataPointMember="XCategory" FieldName="TimeStamp" />
           
    <telerik:ItemMapping DataPointMember="YValue"    FieldName="Value1" />

        </telerik:SeriesMapping>
    </telerik:RadChart.SeriesMappings>

     

     

    Optionally, could I bind the RadPieChart to the RadChart?
    Or, could I make the RadChart display as a pie?

  2. Ray White
    Ray White avatar
    5 posts
    Member since:
    Feb 2007

    Posted 02 May 2012 Link to this post

    I think I found the answer.  You can change a RadChart to a pie style with this:

     

    <telerik:RadChart.DefaultSeriesDefinition>

        <telerik:PieSeriesDefinition ShowItemLabels="False" />

    </telerik:RadChart.DefaultSeriesDefinition>

    I wish there was a simple wizard to handle all this.  You can't right-click on the silverlight chart control and get a wizard.  Instead, you seem to have to write code like this.  Uggh...

  3. DevCraft banner
  4. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 07 May 2012 Link to this post

    Hello Ray,

    RadChart supports other series as well as pies and bars. You can specify the series definition in your mapping as it is described in this topic in our help system. Here is some code:

    <telerik:RadChart.TimeBar>
        <Binding ElementName="timeBar1" />
    </telerik:RadChart.TimeBar>
     
    <telerik:RadChart.SeriesMappings>
        <telerik:SeriesMapping>
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:PieSeriesDefinition />
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:ItemMapping DataPointMember="XCategory" FieldName="TimeStamp" />
            <telerik:ItemMapping DataPointMember="YValue"    FieldName="Value1" />
        </telerik:SeriesMapping>
    </telerik:RadChart.SeriesMappings>

    Greetings,
    Yavor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top