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

Intermittent NullReferenceExceptions on Chart Update

3 Answers 54 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 03 Oct 2011, 06:18 PM
Hello,

We have a basic chart with five series mappings, three of which have visibility bound to checkboxes. The series visibility works as expected, save for occasionally throwing random null reference exceptions when we check/uncheck the box. This happens every so often on no observable schedule, but can be consistently produced when erratically checking and unchecking the checkbox.We have also implemented a zoom feature and have taken advantage of suspendNotification/resumeNotification for the ZoomScrollSettings.We have tried to suspend/resume with the DataSeries but we are still getting intermittent null reference exceptions. We originally thought that there was a race condition between the recalculation of the y-axis and the chart data mapping.

When changing visibility of series mappings, to which property should we spend notifications?  or are there any other ideas why this might be occurring?

Code for reference:
// one of the series mappings
<telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" Visibility="{Binding SeriesLongVisibility}" >

// property to which the visibility of the above series is bound
public SeriesVisibility SeriesLongVisibility
 {
            get { return _seriesLongVisibility; }
            set
            {
                _seriesLongVisibility = value;
                OnPropertyChanged("SeriesLongVisibility");
            }
        }
 
// the checkbox delegate command calls this method
       public void ChangeLongVisibility()
        {
            ChartArea.DataSeries.SuspendNotifications();
            if (SeriesLongVisibility == SeriesVisibility.Collapsed)
                SeriesLongVisibility = SeriesVisibility.Visible;
            else { SeriesLongVisibility = SeriesVisibility.Collapsed; }
            ChartArea.DataSeries.ResumeNotifications();
        }

Thanks,

Jake

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 06 Oct 2011, 12:00 PM
Hi Jake,

We are not aware of such problem in the current version of RadChart and it is not reproduced in our local tests. Can you please open a formal support ticket and attach a small runnable project, which demonstrates it? Once we are able to reproduce it we will get back to you with more details. Thank you.

Best regards,
Ves
the Telerik team

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

0
Jake
Top achievements
Rank 1
answered on 06 Oct 2011, 02:08 PM
Hello Ves,

Due to company constraints and policies, I am not able to upload our sample; however, we believe we have found a solution to our problem. We have five seriesmappings on our chart with 50-3000 points in each series. Upon applying the expresssion dark theme, changing the visibility of any seriesMapping after the chart was loaded resulted in the chance for a null reference exception. The problem disappeared after removing the theme and leaving it default.

Let me know if this helps, or if there is anything else I can provide.

Thanks,

Jake
0
Ves
Telerik team
answered on 11 Oct 2011, 11:48 AM
Hi Jake,

Thanks for the additional details. Still, I am afraid we are not able to reproduce it. Please, find attached a modified version of the Simple Filtering example, which works as expected. You can paste it in the corresponding folder in your local installation, add reference to Telerik.Windows.Themes.Expression_Dark.dll and give it a try.

Kind regards,
Ves
the Telerik team

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

Tags
Chart
Asked by
Jake
Top achievements
Rank 1
Answers by
Ves
Telerik team
Jake
Top achievements
Rank 1
Share this question
or