Jump to content
Software FX Community

Statistic component & command ID

Recommended Posts


I've to remove some tool buttons in the chart control.

The code snippet works fine for normal commands


Command cmd = chart1.ToolBarObj.Commands[(int)SoftwareFX.ChartFX.CommandID.Gallery];

int index = 0;index = cmd.FindSubCommandID((int)SoftwareFX.ChartFX.CommandID.Candlestick);

if (index > -1) cmd.RemoveSubCommand(index);

It's plausible that there are no CommandIDs for 'statistical Studies' nor the statistical gallery types in ChartFX.CommandID, but

where can I find those IDs?


It seems that I not see the forest for the trees


best regards


Link to post
Share on other sites

The commands added by the extensions (e.g. Statistical) are actually Dynamic as there may be more than one extension added.

What exactly are you trying to do with those? I may be able to give you some pointers on how to achieve it.

Link to post
Share on other sites

Hi Frank,

 I want to remove all statistic gallery types except 'BoxAndWhisker' also the 'statistic studies' button should be removed in the toolbar.

I figured out that e.g. 'Histogramm Chart' has an ID = 29954, but it is unstable to code it like this (because of upcoming changes). I would prefer a saver way, if ther is one.


best regards


Link to post
Share on other sites

This is actually not as easy at it seems.

The problem is that these commands are added by the extension dynamically when it is attached to the chart. So even if you remove them they will be re-added when the extension re-attaches.

The extension re-ataches in many situations, one of the most common ones is during serialization. When you save the chart settings (either through the Export method or through personalization) the extensions get detached before saving and re-attached afterwords.

At this moment there is no API to tell the statistical extension not to add certain galleries or toolbar options so there is no reliable way or removing these options.

Link to post
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.

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...