The Xceed.Chart.dll assembly contains a built-in toolbar component that can seamlessly integrate into Xceed Chart for WinForms. The ChartToolbarControl is inherited from the standard .NET ToolBar class and inherits all its functionality.
Inserting the Toolbar into the Form
If the Xceed.Chart.v#.#.dll is referenced by your Windows Forms application, the ChartToolbarControl is represented by the following icon in the Toolbox:
Drag and drop it onto the form.
Visually Configure the Toolbar
Right-click on the toolbar and select Properties. The Properties Window displays the properties of the toolbar. In the upper left corner is located the Categories View button: click on it. The exposed properties of ChartToolbarControl control appear last in the "Xceed ChartToolbar" category.
figure 1 - Properties of the ChartToolbar.
If you have already inserted a ChartControl (or several chart controls) into the form, you can visually bind the toolbar to the chart by selecting the chart control you want to manipulate with this instance of the toolbar from the ChartControl combo.
To configure the toolbar buttons, click on the ButtonsConfig property editor. The following dialog will appear:
figure 2. Visual toolbar configuration tool
Programmatically Configure the Toolbar
You can achieve the same results programmatically. The default name of the first newly created toolbar is chartToolbarControl1, which is what we will use in the following example code:
VB.NET | |
---|---|
|
C# | |
---|---|
|
Step Toolbar Settings
The steps with which certain operations modify the chart's settings are controlled by several properties of the ChartToolbarControl class:
RotationStep: Controls the step of all rotation operations (left, right, viewer rotation left, and viewer rotation right).
ElevationStep: Controls the step of the elevation operations (up and down).
OffsetStep: Controls the step of the offset operations (left, right, up, down).
ZoomStep: Controls the step of the zoom operations (zoom in, zoom out).
ChartSizeStep: Controls the step of the chart resize operations (increase/decrease chart width, height, depth).
Related Examples
Windows Forms: Visual Interface Components/Chart Toolbar