Font settings on marks tip.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

Font settings on marks tip.

Post by Amol » Wed Jul 15, 2020 3:38 pm

Hi Steema,

I am working on TeeChart and we are putting marks tip on that but I can't change the font name and font size.

So, kindly help me how to change these font settings on marks tip.

Thanks & regards
Amol

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Font settings on marks tip.

Post by Christopher » Thu Jul 16, 2020 8:07 am

Amol wrote:
Wed Jul 15, 2020 3:38 pm
I am working on TeeChart and we are putting marks tip on that but I can't change the font name and font size.

So, kindly help me how to change these font settings on marks tip.
Hello Amol,

Steema.TeeChart.Tools.MarksTip wraps the System.Windows.Froms.ToolTip class, and as far as I know this class does not contain any properties for modifying the text font.

If you want a pop-up with text with custom fonts, you can use one of TeeChart's classes, e.g.

Code: Select all

 Annotation _annotation = new Annotation();
        Bar _bar = new Bar();
        
        private void InitializeChart()
        {
            _tChart.Series.Add(_bar);
            _bar.FillSampleValues();

            _annotation.Position = AnnotationPositions.Custom;
            _annotation.Active = false;
            _tChart.Tools.Add(_annotation);

            _tChart.MouseMove += _tChart_MouseMove;
        }

        private void _tChart_MouseMove(object sender, MouseEventArgs e)
        {
            var index = _bar.Clicked(e.X, e.Y);

            if(index > -1)
            {
                _annotation.Left = e.X;
                _annotation.Top = e.Y;
                _annotation.Text = "Some text " + _bar.YValues[index];
                _annotation.Shape.Font.Color = Color.Red;
            }

            _annotation.Active = index > -1;
        }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply