C# – M$ Chart Control 自定 ToolTip 的顯示

在使用 M$ Chart Control 來顯示 Chart 時, 一般的 Requirments 其 ToolTip 在顯示一般都為 X/Y Value,可是當有特別的資料需顯示時,那又該如何呢?在其 DataPoint Class 中提供一個SetCustomProperty Member 讓 User 可以設定其 Custom Property Value,那只需在 Series Class 中設定 ToolTipProperty 後,其 ToolTip 即可顯示 Custom Property.

    Series s = new Series();
s.Name = "SeriesName";
s.ChartType = SeriesChartType.Line;
s.MarkerStyle = MarkerStyle.Circle;
s.MarkerSize = 8;
s.BorderWidth = 3;
s.ToolTip = "Wafer Id: #AXISLABEL\n" +
"Time: #CUSTOMPROPERTY(TIME)\n" +
"Y Value: #VALY";

image

留言

  1. 您好 想請問您設定 Custom Property Value 是如何設定的呢?

    是類似像這樣嗎
    Chart1.Series[0].Points[0].SetCustomProperty("CUSTOMPROPERTY(TIME)", "xxx");

    回覆刪除

張貼留言

這個網誌中的熱門文章

WPF - 深入 Style

Vue.js - 基礎介紹教學