Jump to content
Software FX Community

NullReferenceException when adding Annotations to chart


jbloomer

Recommended Posts

I can add annotations to a scatter chart. I then want to reuse the chart and so do:

this.chart1.ClearData(SoftwareFX.ChartFX.ClearDataFlag.AllData);
this.chart1.Extensions.Clear();

but when I add another annotation I get the following exception:(Running on Vista and .Net 1.1)

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at SoftwareFX.ChartFX.Annotation.AnnotationList.0O(IGraphicsEx AQ, Rectangle AR, Boolean AS, Boolean AT, Int32 AU, Int32 AV)
at SoftwareFX.ChartFX.Annotation.AnnotationX.24(IGraphicsEx F3, Rectangle F4, Boolean F5, Int32 F6, Int32 F7)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at SoftwareFX.ChartFX.ExtensionManager.MH(19 2BV, Enum 2BW, Object[] 2BX)
at SoftwareFX.ChartFX.ChartCore.EO(1R 1SM, Boolean 1SN, Boolean 1SO)
at SoftwareFX.ChartFX.ChartCore.EN(1R 1SJ, Rectangle& 1SK, Int32& 1SL)
at SoftwareFX.ChartFX.ChartCore.EM(PaintBar 1SG, IGraphicsEx 1SH, Rectangle& 1SI)
at SoftwareFX.ChartFX.0X.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Link to comment
Share on other sites

  • 8 months later...

Hi jbloomer

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

When you try to add the annotation to the chart, does the chart contains any data?  You are removing the data from the chart (this.chart1.ClearData(SoftwareFX.ChartFX.ClearDataFlag.AllData)) and maybe you are attaching the annotation to some specific point.  Please verify this.

 

If you continue with issues, please contact Software FX Support at support[at]softwarefx.com.  Please attach a simple project showing the issue.

 

-- Pipon

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...