简体   繁体   English

对于C#中的Tchart,如何使标记提示在鼠标悬停时同时显示系列名称和标签值

[英]For Tchart in C#, how to make markstip show out both series name and label value when mouse over

I have a teechart which has multiple series and I want use the markstip to show out both label value and the series name when mouse over. 我有一个具有多个系列的teechart,我想在鼠标悬停时使用markstip来显示标签值和系列名称。 How could I do that? 我该怎么办? Chart.Tooltip1 = new Steema.TeeChart.Tools.MarksTip(Chart); Chart.Tooltip1.Style = MarksStyles.Labelvalue; Chart.Tooltip1.GetText += new Steema.TeeChart.(tooltip1_GetText);

You can use series' GetSeriesMark event for that, for example: 您可以为此使用系列的GetSeriesMark事件,例如:

  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    private void InitializeChart()
    {
      tChart1.Series.Add(new Steema.TeeChart.Styles.Bar()).FillSampleValues();

      tChart1[0].GetSeriesMark += Form1_GetSeriesMark;      
      tChart1[0].Marks.Visible = false;

      tChart1.Tools.Add(new Steema.TeeChart.Tools.MarksTip());
    }

    void Form1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
    {
      e.MarkText = "X: " + series.XValues[e.ValueIndex].ToString() + ", Y: " + series.YValues[e.ValueIndex].ToString() + " - " + series.ToString();
    }    
  }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我将鼠标移到标签文本下划线时如何使其下划线,然后在鼠标离开时使标签文本正常 - How to make label text underline when i move mouse over it, and then make the label text normal on mouse leave 如何创建一个显示鼠标C#连续坐标的标签 - How to create a label that show continuous coordinates of mouse C# 当鼠标悬停在控件上时获取控件名称C# - Get name of control when mouse hovers over it C# 单击标签内的鼠标时如何移动表格? C# - How to make a form move when mouse is clicked within a label ? C# 只有当鼠标在asp.net C中的div上时,如何制作标签和按钮# - how to make labels and button appear only when mouse is over a div in asp.net C# 如何创建一个从后端显示一些值的弹出框,并且该弹出框必须在鼠标悬停在c#中的标签上显示? - How to create a popover which shows some value from back-end, and the popover has to display on mouse-over a label in c#? RadToolTip:如何使其显示在标签控件上触发的鼠标悬停事件上 - RadToolTip: how to get it to show on mouse over event triggered on a label control 仅当鼠标右键单击特定数据网格时才显示 ContextMenu WPF C# - Show ContextMenu only when Right clicked mouse is over on a specific datagridrow WPF C# 当鼠标悬停在标签上并随后恢复正常状态时,如何使标签变粗体 - how to make a label go bold when a mouse go over it and back to normal afterwards 如何在WPF / C#中检测鼠标是否在我的窗口范围内移动? - How can i detect if the mouse is moving both within and out of the bounds of my window in WPF/C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM