C# TeeChart的一些用法


With TChart1 .Aspect.View3D = False '是否3D顯示 '.Aspect.Chart3DPercent = 100 '3D效果度大小 .Walls.Visible = True '是否顯示圖表邊框 .Header.Text(0) = "生產" '修改標題 .Header.Text.Add "日報表" '增加標題" .Axis.DrawAxesBeforeSeries = True '坐標線是否在圖表上面底部 .Axis.Visible = True '是否顯示縱橫坐標 .Legend.TextStyle = ltsLeftValue '圖例顯示樣式 .Axis.Left.Title.Caption = "圖表實例" '圖表標題(可在四個方向,left左,right右,top上,bottom下,以后的都和這個類似) .Axis.Left.Title.Visible = True '是否顯示標題 .Axis.Left.Title.Angle = 90 '標題擺放角度 .Axis.Bottom.Labels.Angle = 90 '底部標簽擺放角度 '***************四周框架板***************** .Walls.Visible = True '3D效果時是否顯示外框 '.Walls.Left.............略 '設置上下左右外框屬性 .Walls.Back.Transparent = False '背景是否透明 .Walls.Back.Gradient.Visible = True '是否顯示背景 .Walls.Back.Gradient.MidColor = vbYellow '背景霓虹色 '************網格相關*************** .Axis.Left.GridPen.Visible = False '是否顯示橫線網格 .Axis.Bottom.GridPen.Visible = False '是否顯示豎線網格 '*******定義工具條********* TeeCommander1.Chart = TChart1 '將工具條與圖表關連 '定義需要的工具條按鈕(以下排列順序與運行時工具條上按鈕的排列一致, '請根據需要任意改變順序設置,注:tcbSeparator為工具條分隔符) TeeCommander1.Controls = Array(tcbNormal, _ tcbSeparator, tcbRotate, tcbMove, tcbZoom, _ tcbDepth, tcb3D, tcbSeparator, tcbEdit, tcbPrintPreview, _ tcbCopy, tcbSave) '*********加載數據生成圖表************** .Series(0).Clear .Series(0).Add 125, "工程部", clTeeColor .Series(0).Add 45, "市場部", clTeeColor .Series(0).Add 82, "財務部", clTeeColor .Series(0).Add 37, "餐飲部", clTeeColor .Series(0).Add 67, "客房部", clTeeColor .Series(0).Add 27, "消安部", clTeeColor '.Series(1).FillSampleValues 6 '*************標簽******************** .Series(0).Marks.Style = smsPercent '圖表單元標簽顯示類型(文字,百分比,或數字,或組合方式顯示) .Series(0).Marks.ArrowLength = 50 '圖表單元標簽與單元之間的距離 .Series(0).Marks.Visible = True '是否顯示圖表單元標簽 .Series(0).Marks.DrawEvery = 1 '每幾個單元為一組顯示一個標簽 .Series(0).Marks.Angle = 0 '單元標簽的傾斜度 .Series(0).Marks.Arrow.Color = vbGreen '標簽與單元之間連線的顏色 .Series(0).Marks.Arrow.Visible = True '是否顯示[標簽與單元之間連線] .Series(0).Marks.Clip = False '超出圖表的標簽部分是否自動裁剪掉 .Series(0).Marks.Arrow.Width = 1 '標簽與單元之間連線的寬度 .Series(0).Marks.Arrow.Style = psSolid '標簽與單元之間連線樣式 .Series(0).Marks.Transparent = False '標簽是否透明 .Series(0).Marks.ShapeStyle = fosRoundRectangle '標簽樣式(橢圓或長方形) .Series(0).Marks.Font.Color = vbBlue '標簽文字色 .Series(0).Marks.BackColor = vbYellow '標簽背景色 .Series(0).Marks.Gradient.Visible = True '是否起用標簽漸變色 .Series(0).Marks.Bevel = bvNone '標簽樣式(凹,凸,平面) .Series(0).Marks.ShadowSize = 0 '標簽陰影大小 .Series(0).Marks.MultiLine = False '是否允許標簽多行顯示(當標簽太長時) '*************圖例**************** .Legend.ResizeChart = True '圖例是否自動調整位置 .Legend.Divi*Lines.Visible = True '是否顯示圖例的行分隔線 '.Legend.Font.(....略) '圖例字體設置 '.Legend.Left = 420 '圖例左部位置 '.Legend.Top = 30 '圖例頂部位 .Legend.TextStyle = ltsRightValue '圖例顯示樣式 .Legend.Visible = True '是否顯示圖例(全局控制) .Legend.ColumnWidthAuto = True '圖例內的各列數據是否自動調整寬度(必須用Repaint方法刷新) .Legend.ColumnWidths(0) = 20 '調整圖例內某一列數據的寬度(當上一項為假時有效,必須用Repaint方法刷新) '.Repaint .Legend.CheckBoxes = False '圖例是否帶復選項框(通常用於多組圖表) .Legend.Vertspacing = 0 '圖例內行間距大小(默認為0) '.Legend.Symbol.(...略) '圖例內色條屬性設置(位置,大小等) .Legend.FontSeriesColor = False '圖例內字體色是否不同 .Series(0).ShowInLegend = True '是否顯示圖例 .Series(0).ColorEachPoint = True '用不同的顏色顯示圖表單元 .Series(0).asBar.Dark3D = True '3D效果下圖表單元是否顯示陰影 .Series(0).asBar.BarWidth = 35 '單元寬度 .Series(0).asBar.BarStyle = bsRectangle '圖表單元樣式(柱形,椎形,圓形....) .Series(0).asBar.BarPen.Visible = True '是否顯示單元邊框線 '.Series(0).asBar.BarPen.(...)(略) '設置單元邊框的各種屬性 '.Series(0).asBar.BarBrush.Style = bsFDiagonal '圖表單元填充樣式 .Series(0).asBar.UseOrigin = True '不詳 .Series(0).Depth = 15 '3D下立體效果值(值越大,立體感越強) .Series(0).HorizontalAxis = aBottomAxis '橫坐標數據位置 .Series(0).VerticalAxis = aLeftAxis '縱坐標數據位置 End With


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM