Hello there,
I have a rad chart which takes the definition as below :
<telerik:RadChart x:Name="rd3DChart" IsManipulationEnabled="True" Height="250" Margin="5,5,5,5" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3">
<telerik:RadChart.DefaultView>
<telerik:ChartDefaultView>
</telerik:ChartDefaultView>
</telerik:RadChart.DefaultView>
<telerik:RadChart.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.SeriesDefinition>
<telerik:Pyramid3DSeriesDefinition ShowItemLabels="True" ItemLabelFormat="#YValue" ShowItemToolTips="True" ItemToolTipFormat="#XValue - #YValue">
</telerik:Pyramid3DSeriesDefinition>
</telerik:SeriesMapping.SeriesDefinition>
<telerik:SeriesMapping.ItemMappings>
<telerik:ItemMapping FieldName="YValue"
DataPointMember="YValue" />
<telerik:ItemMapping FieldName="XValue"
DataPointMember="Label" />
</telerik:SeriesMapping.ItemMappings>
</telerik:SeriesMapping>
</telerik:RadChart.SeriesMappings>
</telerik:RadChart>
I have a function which binds the values to the chart like :
private void PopulateAggregationChart()
{
rdAggregateExpanderGraph.Visibility = System.Windows.Visibility.Visible;
List<AggregateChartItem> charItems = new List<AggregateChartItem>();
AggregateChartItem temp = null;
rd3DChart.ItemsSource = null;
charItems = GetItemsToBindToChart();
CameraExtension cam = new CameraExtension();
cam.ZoomEnabled = true;
if (rd3DChart.DefaultView.ChartArea.Extensions.Count == 0)
rd3DChart.DefaultView.ChartArea.Extensions.Add(cam);
rd3DChart.ItemsSource = charItems;
}
I have added a check here on the extensions as clearing it and adding it again threw null reference exception. My Binding works the first time, but when I call this function to bind the graph with a different set of data, the graph is being painted as expected, but the camera extension is not applied to it.
Please help in how I can retain the camera extension throughout.