How to show tooltip on MS Chart

前端 未结 3 1937
梦如初夏
梦如初夏 2021-01-03 23:33

I am using MS Chart control to draw graphs on Winform.

I want to show the current (x,y) Value as tooltip on Mousedown on chartarea.

How do I do that?

相关标签:
3条回答
  • 2021-01-04 00:16

    From the chart samples (Samples Environments for Microsoft Chart Controls)

    // Set ToolTips for Data Point Series
    chart1.Series[0].ToolTip = "Percent: #PERCENT";
    
    // Set ToolTips for legend items
    chart1.Series[0].LegendToolTip = "Income in #LABEL  is #VAL million";
    
    // Set ToolTips for the Data Point labels
    chart1.Series[0].LabelToolTip = "#PERCENT";
    
    // Set ToolTips for second Data Point
    chart1.Series[0].Points[1].ToolTip = "Unknown";
    
    0 讨论(0)
  • 2021-01-04 00:19

    This tooltip will appear on mouseover. I'm not sure if you can set it for mousedown event.

    Chart1.Series["Series1"].ToolTip = "#VALY, #VALX";
    
    0 讨论(0)
  • 2021-01-04 00:29

    If you want to show tooltips with maximum and minimum values in Range type charts, the following code can be used.

    Chart1.Series["Series1"].ToolTip = "Min:#VALY1, Max:#VALY2";
    
    0 讨论(0)
提交回复
热议问题