Xceed Chart for WinForms v4.4 Documentation
Welcome to Xceed Chart for WinForms v4.4 / Installation Instructions / Integrating into Windows Forms / ChartToolbarControl Overview

In This Topic
    ChartToolbarControl Overview
    In This Topic

    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  

    ' bind to a chart control
    chartToolbarControl1.ChartControl = chartControl1

    ' configure the buttons which must be available to the user
    ' 1. create an array of buttons bound to the chart control
    chartToolbarButtonsArray arrBtns = New chartToolbarButtonsArray(chartToolbarControl1)

    ' 2. add buttons for View control
    arrBtns.Add(ChartToolbarButtons.View2D)
    arrBtns.Add(ChartToolbarButtons.Orthogonal)
    arrBtns.Add(ChartToolbarButtons.Perspective)
    arrBtns.Add(ChartToolbarButtons.Separator)
    arrBtns.Add(ChartToolbarButtons.PredefinedProjection)

    ' 3. update the button configuration
    chartToolbarControl1.ButtonsConfig = arrBtns
    C#  

    // bind to a chart control
    chartToolbarControl1.ChartControl = chartControl1;

    // configure the buttons which must be available to the user
    // 1. create an array of buttons bound to the chart control
    ChartToolbarButtonsArray arrBtns = new
    ChartToolbarButtonsArray(chartToolbarControl1);

    // 2. add buttons for View control
    arrBtns.Add(ChartToolbarButtons.View2D);
    arrBtns.Add(ChartToolbarButtons.Orthogonal);
    arrBtns.Add(ChartToolbarButtons.Perspective);
    arrBtns.Add(ChartToolbarButtons.Separator);
    arrBtns.Add(ChartToolbarButtons.PredefinedProjection);

    // 3. update the button configuration
    chartToolbarControl1.ButtonsConfig = arrBtns;

    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

    See Also

    ChartToolbarControl