Page 1 of 1
showing custom text unsing marksTip
Posted: Thu Aug 14, 2008 8:00 am
by 9642017
hello!
I would like to know if it is possible to show some text inside a tooltip of TeeChart's series. At the moment, the tooltips are always showing the values of the series-labels.
thanks in advance
Robert
Re: showing custom text unsing marksTip
Posted: Thu Aug 14, 2008 9:58 am
by Chris
Hello!
rf2005 wrote:I would like to know if it is possible to show some text inside a tooltip of TeeChart's series. At the moment, the tooltips are always showing the values of the series-labels.
Yes, you can use the GetText event of the MarksTip tool, e.g.
Code: Select all
public Form3()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Points series;
private Steema.TeeChart.Tools.MarksTip tool;
private Steema.TeeChart.TChart tChart1;
private void InitializeChart()
{
tChart1 = new Steema.TeeChart.TChart();
tChart1.Dock = DockStyle.Fill;
this.Controls.Add(tChart1);
tChart1.Series.Add(series = new Points());
series.FillSampleValues();
tChart1.Tools.Add(tool = new MarksTip());
tool.Series = series;
tool.GetText += new MarksTipGetTextEventHandler(tool_GetText);
}
void tool_GetText(MarksTip sender, MarksTipGetTextEventArgs e)
{
e.Text = "My Custom Text " + e.Text;
}