[英]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.