Jump to content
Software FX Community

Syncing Annotation Toolbar visibility state


MDS
 Share

Recommended Posts

First, ChartFx doesn't provide any events to handle the turning on and turning off of toolbars.  This makes it very difficult to sync a checkbox with the context menu inside of the chart to toggle the visibility of toolbars.  The best thing I've found is the PostPaint event, but it is very generic and provides very limited event data.

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

 

Second, ChartFx doesn't consistently hang on to its extension collection whenever the chart data is refresh.  To get the annotation toolbar, you have to create an AnnotationX object and add it to the chart's Extensions collection using the Add method.  Then, you set the ToolBarObj.Visible property on the AnnotationX object.  Strangely, though, the chart sometimes just drops the extensions, and I'm not sure exactly why it's doing that.

 

Third, I've written logic to detect the absence of the AnnotationX object, recreate it, and set its ToolBarObj.Visible property based on the checkbox checked property.  Oddly, this places the context menu "Toolbars" into an unsynchronized state: where you would expect the toolbar to be visible when the context is checked, it is actually not visible.

 

Essentially, it seems that there are some odd peculiarities when trying to sync the checkbox, the actual visibility of the toolbar, and the checked state in the chart's context menu.  The AnnotationX object doesn't persist with the chart.

 How do I sync a CheckBox Checked property with the AnnotationX.ToolBarObj.Visible property and the actual checked state of the chart's toolbars context menu?

Why is the Extensions collection sometimes cleared in the Chart when the chart's DataSource property is set?

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.

 Share

×
×
  • Create New...