Active Chart Tools

When an active chart is presented there are no distinguishing visual factors to let the user know the chart is an object rather than an image. However, the first thing most users find is that the chart supports a number of context menus. These menus on demand are sensitive to the chart area from which they are prompted, and will display different lists of options accordingly. Access these menus simply by right-clicking over a chart area.

Developers may also enable the active chart’s ToolBar and MenuBar objects programmatically. When set to visible, users will immediately recognize these tools and may interact with them as they see fit.

These tools have been designed to expose the most commonly used active chart commands in an intuitive manner. We understand that some developers may want to restrict access to some of the pre-configured commands, add others for specialized needs and even add custom commands for additional functionality. For this reason, customization of these tools is supported. For more information, please see the "Tool Customization" section later in this section.

Context Menus

Chart FX for Java supports context sensitive menus for customization of active charts. When an active chart is generated, a context menu will be prompted when the user right-clicks an element in the chart. This menu consists of a pull-down dialog with options specific for customizing the selected element.

The following image depicts the Series, Background and Axis context menus. Other chart objects that support context menus are the constant line, stripe, title and Chart FX tools (DataEditor and legends).

Context menus may be disabled using the ContextMenus property. By default, this property is set to 'true', when set to 'false' the context menus are not accessible by right-clicking in the chart area.


chart1.setContextMenus(false);

Note: Pre-defined as well as custom commands may be added or removed from each of the supported context menus. For more information, please see the "Tool Customization" section of this guide.

The ToolBar & MenuBar

One of the most useful tools when generating active charts is the chart ToolBar. Many programmers appreciate this feature because they are not required to add additional code in their applications while still providing end users the freedom to customize a chart's appearance.

Sometimes, customizing the ToolBar becomes imperative when you wish to deny end users access to a particular feature or extend the original functionality provided by a selected chart tool. For this reason these tools do support customization. Please see the "Tool Customization" section for more information regarding this topic.

It is also important to keep in mind that many of the supported commands are available through different tools. For example, the chart gallery may be adjusted through the background context menu, the series context menu, the ToolBar and MenuBar. If you want to restrict access to this command, you will need to customize all those tools.

To programmatically enable these items in the active chart, developers may employ the following code:


Chart1.setToolBar(true);
Chart1.setMenuBar(true);

Important Note: The properties and methods used to customize the ToolBar and MenuBar are derived from the same class and are therefore identical. If you need to customize the MenuBar, you will use the MenuBarObj property to expose the supported class members.