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

4 posts, 0 answers
  1. Jinith
    Jinith avatar
    3 posts
    Member since:
    Jan 2015

    Posted 08 Jun 2015 Link to this post

    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.

  2. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 09 Jun 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jinith
    Jinith avatar
    3 posts
    Member since:
    Jan 2015

    Posted 09 Jun 2015 in reply to Peshito Link to this post

    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.

  5. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 10 Jun 2015 Link to this post

    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
Back to Top