Page 1 of 1

Font settings on marks tip.

Posted: Wed Jul 15, 2020 3:38 pm
by 9641422
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

Re: Font settings on marks tip.

Posted: Thu Jul 16, 2020 8:07 am
by Christopher
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;
        }