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

Camera extension to RadChart works the first time and not on setting the item source later

3 Answers 22 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jinith
Top achievements
Rank 1
Jinith asked on 08 Jun 2015, 02:03 PM

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.

3 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 09 Jun 2015, 09:44 AM
Hello Jinith,

It is hard to tell what might be causing this exception from the code snippet provided. I tried to reproduce it but to no avail. Would it be possible for you to give us a sample runnable project reproducing the issue. As this is a forum thread you should use a third party web side for files sharing or submit a support ticket where attaching files is allowed.

In the meantime I have a attached a sample project similar to the one you described in order to help you tracking down what might be causing the exception.

Regards,
Peshito
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Jinith
Top achievements
Rank 1
answered on 09 Jun 2015, 01:51 PM

Hello Peshito,

  I have raised a support ticket with ID "942612", attaching the same application which you have created with a refresh on item source, and I could reproduce that the camera extension was getting detached from the chart. Please have a look.

0
Peshito
Telerik team
answered on 10 Jun 2015, 11:32 AM
Hi Jinith,

Thank you for providing an updated version of the sample project in the support ticket thread.

I wasn't able to reproduce the sample and attached the same project with the DLLs version I used. Please find more information on the matter in the ticket.

Regards,
Peshito
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Jinith
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Jinith
Top achievements
Rank 1
Share this question
or