We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to Custom ReDraw Tooltip for Y Series

 Need your help urgently.

 Product Used: (Winforms)

Syncfusion Chart 11.3035.0.30


We need to draw Tooltip on Chart Control series. How can I achieve this?

I do not found any event which support re-draw of Tooltip on Chart control series.





1 Reply

AT Anandaraj T Syncfusion Team May 8, 2014 05:58 PM UTC

Hi Gaurav,

Thanks for using Syncfusion products.

Currently, support to customize spacing in chart tooltip is not available. As a workaround solution, we can use “ChartRegionMouseMove” event of chart control to draw customized tooltip for chart.

Please refer the following code snippet to achieve this.



            //Mouse move event for Chart

            this.chartControl1.ChartRegionMouseMove += chartControl1_ChartRegionMouseMove;


        //Chart region mouse move event

        void chartControl1_ChartRegionMouseMove(object sender, ChartRegionMouseEventArgs e)



            if (e.Region.IsChartPoint)


                int ser = e.Region.SeriesIndex;

                int point = e.Region.PointIndex;


                info.Location = new Point(CurrentPoint.X+5, CurrentPoint.Y+5);

                info.Text = "Series Name: " + this.chartControl1.Series[ser].Name + "X Value: " + this.chartControl1.Series[ser].Points[point].X + "Y Value: " + this.chartControl1.Series[ser].Points[point].YValues[0];


                if (PreviousPoint != Point.Empty && Math.Abs(CurrentPoint.X - PreviousPoint.X) < 2 && Math.Abs(CurrentPoint.Y - PreviousPoint.Y) < 2)



                    //Drawing customized tooltip in mouse move event of Chart



                PreviousPoint = CurrentPoint;

                ClearToolTip = true;



                if (ClearToolTip)



                    ClearToolTip = false;




       //Method to draw custom tooltip

        void DrawCustomToolTip( ToolTipInfo info)


            Graphics gr = this.chartControl1.GetGraphics();

            Pen p=new Pen(info.BorderColor);

            SizeF textSize=gr.MeasureString(info.Text, info.TextFont);

            Rectangle rect = new Rectangle(info.Location.X, info.Location.Y, (int)textSize.Width + info.Spacing, (int)textSize.Height + info.Spacing);

            gr.DrawRectangle(p, rect);

            SolidBrush br = new SolidBrush(info.BackgroundColor);

            gr.FillRectangle(br, rect);

            Point textLocation=new Point(info.Location.X+info.Spacing/2, info.Location.Y+info.Spacing/2);

            gr.DrawString(info.Text, info.TextFont, new SolidBrush(info.FontColor), textLocation);



    //Class for storing custom tooltip settings

    public class ToolTipInfo


        public string Text { get; set; }

        public int Spacing { get; set; }

        public Color BackgroundColor { get; set; }

        public Color BorderColor { get; set; }

        public Color FontColor { get; set; }

        public Font TextFont { get; set; }

        public ToolTipInfo() { }

        public Point Location { get; set; }



For your convenience, we have created a simple sample and it can be downloaded from the following link.


Please let us know if you have any concern.



Live Chat Icon For mobile
Up arrow icon