Tutorial 16 - TeeChart's Additional palette components
Contents

Using the additional TeeChart Controls
     Selecting and inserting the component
     Associating the component with a TChart
     ButtonColor
     ButtonPen
     ChartListBox
     Commander
     Editor
     GalleryPanel
    

Using the additional TeeChart Controls

TeeChart for.Net includes several additional controls that may be added to a project to enhance runtime functionality of a Charting application.

ButtonColor  
ButtonPen  
ChartListBox
Commander  
Editor  
GalleryPanel  

Selecting and inserting the component
When you add the TeeChart for .Net Component to the Visual Studio .Net ToolBox, the additional controls are automatically added too.

Associating the component with a TChart
You can associate the Commander and the other non-Chart components with a TChart by using the Chart property.  

Example
[C#] 
commander1.Chart = tChart1;
[VB.Net]
Commander1.Chart = TChart1

ButtonColor
ButtonColor shows a Color Editor and can be associated to the Color property of a TeeChart object to modify its color and transparency.

Example
[C#] 
private void Form1_Load(object sender, System.EventArgs e) {
        tChart1.Aspect.View3D = false;
        line1.FillSampleValues(20);
        colorBand1.Axis = tChart1.Axes.Left;
        colorBand1.Start = line1.YValues.Maximum * 0.8;
        colorBand1.End = line1.YValues.Minimum * 1.2;
        buttonPen1.Pen = colorBand1.Pen;
}

private void buttonColor1_Click(object sender, System.EventArgs e) {
        colorBand1.Color = buttonColor1.Color;
}

[VB.Net]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TChart1.Aspect.View3D = False
        Line1.FillSampleValues(20)
        ColorBand1.Axis = TChart1.Axes.Left
        ColorBand1.Start = Line1.YValues.Maximum * 0.8
        ColorBand1.End = Line1.YValues.Minimum * 1.2
        ButtonPen1.Pen = ColorBand1.Pen
End Sub
        
Private Sub ButtonColor1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonColor1.Click
        ColorBand1.Color = ButtonColor1.Color
End Sub
ButtonPen
ButtonPen shows a Border Editor and can be associated to the Pen property of a TeeChart object to modify its visibility, color, ending, dash-style, width, style and transparency.

Example
[C#] 
private void Form1_Load(object sender, System.EventArgs e) {
        tChart1.Aspect.View3D = false;
        line1.FillSampleValues(20);
        colorBand1.Axis = tChart1.Axes.Left;
        colorBand1.Start = line1.YValues.Maximum * 0.8;
        colorBand1.End = line1.YValues.Minimum * 1.2;
        buttonPen1.Pen = colorBand1.Pen;
}

private void buttonColor1_Click(object sender, System.EventArgs e) {
        colorBand1.Color = buttonColor1.Color;
}

[VB.Net]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TChart1.Aspect.View3D = False
        Line1.FillSampleValues(20)
        ColorBand1.Axis = TChart1.Axes.Left
        ColorBand1.Start = Line1.YValues.Maximum * 0.8
        ColorBand1.End = Line1.YValues.Minimum * 1.2
        ButtonPen1.Pen = ColorBand1.Pen
End Sub
        
Private Sub ButtonColor1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonColor1.Click
        ColorBand1.Color = ButtonColor1.Color
End Sub

TeeListBox
ChartListBox shows a list of Series in the Chart at runtime. The ChartListBox may be used to offer the user limited customisation and display/hide of Chart Series.

Commander
The Commander bar allows navigation and parameter change control (via the TeeChart Editor) to be offered to users at runtime. Select the navigation buttons and with the left mouse button depressed, drag over the Chart panel to move the Chart.  

Editor
The Editor allows the TeeChart Editor to be customised:

[C#]

private void Form1_Load(object sender, System.EventArgs e) { 
        editor1.Chart = tChart1;
        line1.FillSampleValues(20);
}

private void button1_Click(object sender, System.EventArgs e) {
        editor1.DefaultTab = Steema.TeeChart.Editors.ChartEditorTabs.Legend;
        editor1.Title = "My Application Title";
        editor1.ShowModal();
}

[VB.Net]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Editor1.Chart = TChart1
        Line1.FillSampleValues(20)
End Sub
        
Private Sub ButtonColor1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonColor1.Click
        Editor1.DefaultTab = Steema.TeeChart.Editors.ChartEditorTabs.Legend
        Editor1.Title = "My Application Title"
        Editor1.ShowModal()
End Sub

GalleryPanel
The GalleryPanel shows a customisable Gallery of TeeChart Series.