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

Binding pie chart to timebar

2 Answers 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ray White
Top achievements
Rank 1
Ray White asked on 02 May 2012, 08:52 PM
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 Answers, 1 is accepted

Sort by
0
Ray White
Top achievements
Rank 1
answered on 02 May 2012, 10:17 PM
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...

0
Yavor
Telerik team
answered on 07 May 2012, 11:49 AM
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 >>

Tags
Chart
Asked by
Ray White
Top achievements
Rank 1
Answers by
Ray White
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or