Each Chart FX context menu has its own CommandID and is comprised of a list of subcommands. Custom and pre-defined subcommands may be added or removed from selected context menus by utilizing the supported members of the CommandBar and Commands classes.
There are context menus for the axes, background, constant line, series, stripe, title and Chart FX tools. By selecting a particular context menu, you can add or remove commands from the context menus to control the options users have access to when selecting a menu on demand for a particular chart element.
Below is an example of how to add a custom command to the commands list and then add that command to the series context menu subcommand list:
chart1.getCommands().addCommand(1); chart1.getCommands(1).setPicture((int) 2); chart1.getCommands(1).setText("New ToolTip"); chart1.getCommands((int) CommandID.CONTEXT_MENU_SERIES). insertSubCommands(1, 0); chart1.getCommands((int) CommandID.CONTEXT_MENU_SERIES). setSubCommandID(0, 1);
|
The UserCommand Event is raised in your application when the user clicks or interacts with a custom command item you have added. Using the UserCommand event, you may process custom commands that you add to your applications. This event may only be accessed from client side scripting.
|