Strange error

Jun 6, 2014 at 3:17 PM
Hi! Thank you for oxyPlot, it's really amazing))
Im working with real time data and sometimes get strange error:
System.NullReferenceException: in OxyPlot.Annotations.Annotation.Transform(DataPoint p) в c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\Annotations\Annotation.cs: 115
I'm using arrow anotations and check everything before adding it to the plot view.
Coordinator
Jun 6, 2014 at 7:51 PM
This looks like a problem with the x-axis.
Are you adding the arrow annotation to a plot without axes/series? What platform are you on? Can you add some code that reproduces the error?
Jun 6, 2014 at 8:21 PM
I'm using wpf. There are dateTime and value axeses in my model (dateTimeAxis as x-axis), and there are couple line series too) Here is the code the annotation adding:
   var arrow = new ArrowAnnotation();
   arrow .Text = info;
   arrow .StartPoint =  new DataPoint(DateTimeAxis.ToDouble(currentTime), value- value/ 100000);
   arrow .EndPoint =  new DataPoint(DateTimeAxis.ToDouble(currentTime),value);
   PlotModel.Annotations.Add(tradeToDisplay);
Thanks)
Coordinator
Jun 6, 2014 at 8:51 PM
Can this be a race condition? Can you try locking the PlotModel.SyncRoot when changing the model?
Jun 9, 2014 at 4:28 PM
Thank you! It solve my problem.