日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

C# TeeChart使用心得,干货

發布時間:2023/12/14 C# 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 C# TeeChart使用心得,干货 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

去除頂上TeeChart 標題:圖表->標題->顯示
3D->2D:圖表->3D->3D效果
右側小圖例去除:圖表->圖例

修改黑色背景:
1.外面板修改背景顏色:圖表->面板->漸彩->顏色:開始 中間 結束修改顏色為黑色
2.內面板修改背景顏色:圖表->壁板->顯示壁板
3. 面板->背景->透明

圖表->面板->邊緣->外斜面->顏色-> 白色修改其他顏色

private void chart_MouseMove(object sender, MouseEventArgs e)
{
int value = (int)this.tChart1.Series[3].GetMarkValue(e.X);
//根據X軸鼠標事件對應的X值獲取Y值,這是官方的方法但是不準確
//根據X軸找到對應的Y軸的數據最后用的一個偏方
}

this.tChart1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
this.tChart1.MouseLeave += new System.EventHandler(this.chart_MouseLeave);
this.tChart1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
this.tChart1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.chart_MouseUp);

同一個X軸,多個Y軸:
聲明4個Y軸
public Steema.TeeChart.Axis axis;
public Steema.TeeChart.Axis Green;
public Steema.TeeChart.Axis Red;
public Steema.TeeChart.Axis Orange;
intit方法中:
axis = this.tChart1.Axes.Left;
axis.AxisPen.Color = System.Drawing.Color.Cyan;
axis.StartPosition = 0; //開始位置
axis.EndPosition = 17;//結束位置
axis.Labels.Font.Color = System.Drawing.Color.Cyan;
axis.SetMinMax(0, 4);//這條Y軸的最大最小值

Green = new Steema.TeeChart.Axis(tChart1.Chart);this.tChart1.Axes.Custom.Add(Green);Green.AxisPen.Color = System.Drawing.Color.Green;Green.StartPosition = 23;Green.EndPosition = 43;Green.Labels.Font.Color = System.Drawing.Color.Green;this.line2.CustomVertAxis = Green; //曲線綁定Y軸部分Green.SetMinMax(0, 100);Red = new Steema.TeeChart.Axis(tChart1.Chart);this.tChart1.Axes.Custom.Add(Red);Red.AxisPen.Color = System.Drawing.Color.Red;Red.StartPosition = 48;Red.EndPosition = 68;Red.Labels.Font.Color = System.Drawing.Color.Red;this.line3.CustomVertAxis = Red;this.line3.LinePen.Color = System.Drawing.Color.Red;Red.SetMinMax(0, 100); Orange = new Steema.TeeChart.Axis(tChart1.Chart);this.tChart1.Axes.Custom.Add(Orange);Orange.AxisPen.Color = System.Drawing.Color.Orange;Orange.StartPosition = 73;Orange.EndPosition = 100;Orange.Labels.Font.Color = System.Drawing.Color.Orange;this.line4.CustomVertAxis = Orange;this.line4.LinePen.Color = System.Drawing.Color.Orange;this.tChart1.Axes.Bottom.Labels.Font.Color = System.Drawing.Color.Orange;this.tChart1.Axes.Bottom.Grid.Visible = false;Orange.SetMinMax(0, 260);tChart1.Axes.Bottom.Scroll(0, false);tChart1.Axes.Bottom.Labels.DateTimeFormat = "HH:mm:ss"; //底部X軸時間格式this.tChart1.Axes.Bottom.AxisPen.Color = System.Drawing.Color.White; // 底部X軸線顏色

記得有點亂,改天來補。
1.關于實現放大部分圖表效果,用自帶的放大縮小,當數據量非常大的時候行不通,當一個圖表上的數據點非常多了,放大縮小會很卡,要自己寫代碼實現。
2.根據鼠標位置實時顯示對于同一個X軸多個Y軸上的點的數據。

總結

以上是生活随笔為你收集整理的C# TeeChart使用心得,干货的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。