文檔半島外圍網上直營>>【TeeChart Pro ActiveX教程】2018>>【TeeChart Pro ActiveX教程】(十六):TeeChart的其他調色板組件 
                【TeeChart Pro ActiveX教程】(十六):TeeChart的其他調色板組件
使用附加的TeeChart控件
TeeChart for.Net包含幾個可以添加到項目中的附加控件,以增強Charting應用程序的運行時功能。

選擇和插入組件
將.e組件的TeeChart添加到Visual Studio .Net ToolBox時,也會自動添加其他控件。
將組件與TChart相關聯
您可以使用Chart屬性將Commander和其他非Chart組件與TChart相關聯。
[C#]
commander1.Chart = tChart1;
[VB.Net]
Commander1.Chart = TChart1
ButtonColor
ButtonColor顯示顏色編輯器,可以與TeeChart對象的Color屬性關聯,以修改其顏色和透明度。
[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顯示邊框編輯器,可以與TeeChart對象的Pen屬性關聯,以修改其可見性,顏色,結尾,破折號樣式,寬度,樣式和透明度。
[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在運行時顯示圖表中的Series列表。ChartListBox可用于為用戶提供有限的自定義和顯示/隱藏圖表系列。
Commander
Commander欄允許在運行時向用戶提供導航和參數更改控制(通過TeeChart編輯器)。選擇導航按鈕并按下鼠標左鍵,拖動圖表面板以移動圖表。
編輯器
[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
GalleryPanel顯示可自定義的TeeChart系列圖庫。
購買TeeChart Pro AciveX正版授權,請點擊“”喲!

 QQ交談
QQ交談 在線咨詢
在線咨詢 
                 
                
 渝公網安備
            50010702500608號
渝公網安備
            50010702500608號
             
            
 客服熱線
客服熱線