【TeeChart Pro ActiveX教程】(十六):TeeChart的其他調(diào)色板組件
使用附加的TeeChart控件
TeeChart for.Net包含幾個可以添加到項目中的附加控件,以增強Charting應(yīng)用程序的運行時功能。
選擇和插入組件
將.e組件的TeeChart添加到Visual Studio .Net ToolBox時,也會自動添加其他控件。
將組件與TChart相關(guān)聯(lián)
您可以使用Chart屬性將Commander和其他非Chart組件與TChart相關(guān)聯(lián)。
[C#]
commander1.Chart = tChart1;
[VB.Net]
Commander1.Chart = TChart1
ButtonColor
ButtonColor顯示顏色編輯器,可以與TeeChart對象的Color屬性關(guān)聯(lián),以修改其顏色和透明度。
[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屬性關(guān)聯(lián),以修改其可見性,顏色,結(jié)尾,破折號樣式,寬度,樣式和透明度。
[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欄允許在運行時向用戶提供導(dǎo)航和參數(shù)更改控制(通過TeeChart編輯器)。選擇導(dǎo)航按鈕并按下鼠標左鍵,拖動圖表面板以移動圖表。
編輯器
[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正版授權(quán),請點擊“咨詢在線客服”喲!