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

NullReferenceException at GetAnimationSettings()

1 Answer 16 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Yoni Dagan
Top achievements
Rank 1
Yoni Dagan asked on 27 Sep 2009, 11:01 AM
[Newbie question]

Hi,

I'm trying to set up a simple line chart.
My code is very simple:

 

DataSeries ds1 = new DataSeries();  
ds1.LegendLabel = "Random";  
ds1.Definition = new Telerik.Windows.Controls.Charting.LineSeriesDefinition();   
FillDataSeries(ds1); // Fills series data points with XValue and YValue   
chartArea1.DataSeries.Add(ds1); 

When the code runs, a NullReferenceException is thrown.
----------------------------------------------------------------------------------------------------------

 

System.NullReferenceException: Object reference not set to an instance of an object.

   at Telerik.Windows.Controls.Charting.BaseAnimationConverter.GetAnimationSettings() in c:\Builds\WPF_Scrum\Chart_WPF_2009_Q2_SP1\Sources\Development\Controls\Chart\Chart\Animations\BaseAnimationConverter.cs:line 163
-----------------------------------------------------------------------------------------------------------

what am I missing?

Thanks.

 

 

1 Answer, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 30 Sep 2009, 11:08 AM
Hi Yoni Dagan,

I see from your post that you have tried to use the ChartArea as a standalone control and populate manually its data series collection. This control was designed to be placed within a RadChart control and should  not be used separately. You can find more information on how to set up the chart control here.

Regards,
Velin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Chart
Asked by
Yoni Dagan
Top achievements
Rank 1
Answers by
Velin
Telerik team
Share this question
or