showing custom text unsing marksTip

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
rf2005
Newbie
Newbie
Posts: 11
Joined: Fri Jul 28, 2006 12:00 am

showing custom text unsing marksTip

Post by rf2005 » Thu Aug 14, 2008 8:00 am

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Re: showing custom text unsing marksTip

Post by Christopher » Thu Aug 14, 2008 9:58 am

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;
    }
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply