showing tooltips on series.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

showing tooltips on series.

Post by qcrnd » Mon Nov 23, 2009 12:21 pm

Hi
I have an area chart and I want a tooltip to appear each time the mouse hovers over a point.
I added MarksTip to the chart but I get the tooltip in the whole colored area.
I only want the tooltip to appear on the Points of the series and to show the Y value at that point. currently the tooltip shows the same value between two points no matter where the mouse is, and that is misleading because if i have a point 10 and the next point is at 20 , all the area between 10 and 20 will still show a tooltip of 10 .
I only want the tooltip to work on the points themselves.
Thanks.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: showing tooltips on series.

Post by Sandra » Wed Nov 25, 2009 11:52 am

Hello gcrnd,

When you use pointer of Area Series, it is very difficult found position of it, therefore, I recommended that add a new series concretely Series Points with same values of Series Area and assign Marktip tool to series points.

Please see next example of code and check works as you want:

Code: Select all

public Form1()
        {
            InitializeComponent();
            InitializeChart();
           
        }
        private Steema.TeeChart.Styles.Area area1;
        private Steema.TeeChart.Styles.Points points1;
        private Steema.TeeChart.Tools.MarksTip tooltip1;

        private void InitializeChart()
        {
            area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
            points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
            tooltip1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
            tChart1.Aspect.View3D = false;
            area1.FillSampleValues();
            points1.DataSource = area1;
            points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond;
            area1.Pointer.VertSize = 5;
            tooltip1.Series = points1;
            points1.Color = area1.Color;
            points1.LinePen.Visible = true;
            points1.Pointer.Pen.Color = area1.LinePen.Color;
        }
I hope will helps.

Thanks
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Re: showing tooltips on series.

Post by qcrnd » Wed Nov 25, 2009 2:53 pm

Hi sandra
Thanks for the reply . There are two problems with your solution.
1. It works well for 1 series but if I have 2 area series and add 2 point series , one for each of the two area series , the tooltips work well for 1 set of points but when my mouse hovers over the second set of points , I stop getting tooltips althogether.
2. I dont want the points series to appear in the legend box. Currently the points also appear in my legend box.

Thanks.qcrnd
Advanced

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Re: showing tooltips on series.

Post by qcrnd » Wed Nov 25, 2009 3:04 pm

Hi Sandra
sorry . overlooked your second reply regarding removing the points from the legend.
so I guess I am left only with the first problem of the disappearing tooltips.
This is the code I use for each of my area series.

private void AddPointTooltips(Area series)
{

Points points = new Points(m_thresholdValuesChart.Chart);
MarksTip tooltip = new Steema.TeeChart.Tools.MarksTip(m_thresholdValuesChart.Chart);
points.DataSource = series;
points.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond;
tooltip.Series = points;
tooltip.Active = true;
points.Pointer.VertSize = points.Pointer.HorizSize = series.Pointer.HorizSize;
points.Color = series.Color;
points.LinePen.Visible = true;
points.Pointer.Pen.Color = series.Pointer.Pen.Color;
tooltip.MouseDelay = 50;
tooltip.MouseAction = MarksTipMouseAction.Move;
tooltip.Style = MarksStyles.Value;
series.Pointer.VertSize = series.Pointer.HorizSize = 2;
}

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: showing tooltips on series.

Post by Sandra » Thu Nov 26, 2009 9:42 am

Hello gcrnd,
It works well for 1 series but if I have 2 area series and add 2 point series , one for each of the two area series , the tooltips work well for 1 set of points but when my mouse hovers over the second set of points , I stop getting tooltips althogether.
I think that the problem is you only use one tooltip. If you use 2 series you need 2 tooltips, if you use X series you need X tooltips, because you could assign one series to determined tooltip.

Please, see next code and check works as you want:

Code: Select all

    
        public Form1()
        {
            InitializeComponent();
            InitializeChart();
           
        }
        private Steema.TeeChart.Styles.Area area1,area2;
        private Steema.TeeChart.Styles.Points points1,points2;
        private Steema.TeeChart.Tools.MarksTip tooltip1, tooltip2;

        private void InitializeChart()
        {
            area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
            points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
            area2 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
            points2 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
            tooltip1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
            //---------------------New ToolTip-------------------------//
            tooltip2 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
            //--------------------------------------------------------//
            tChart1.Aspect.View3D = false;
            area1.FillSampleValues();
            area2.FillSampleValues();
            points1.DataSource = area1;
            points2.DataSource = area2;
            points1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond;
            points2.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond;
            tooltip1.Series = points1;
            points1.Color = area1.Color;
            points1.Pointer.Pen.Color = area1.LinePen.Color;
            //------------Assign ToolTip2 points-----------------------------//
            tooltip2.Series = points2;
            //---------------------------------------------------------------//
            points2.Color = area2.Color;
            points2.Pointer.Pen.Color = area2.LinePen.Color;
            tooltip1.MouseDelay = 50;
            tooltip1.MouseAction = Steema.TeeChart.Tools.MarksTipMouseAction.Move;
            tooltip1.Style = Steema.TeeChart.Styles.MarksStyles.Value;
            tooltip2.MouseAction = Steema.TeeChart.Tools.MarksTipMouseAction.Move;
            tooltip2.Style = Steema.TeeChart.Styles.MarksStyles.Value;
            //-------------Style Legend-----------------------------------------//
            points1.ShowInLegend = false;
            points2.ShowInLegend = false;
            tChart1.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Values;
           //-------------------------------------------------------------------//
        }

I hope will helps.

Thanks
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Re: showing tooltips on series.

Post by qcrnd » Thu Nov 26, 2009 10:06 am

Hi Sandra
Your sample gives me exactly the same problem.
I can only see tooltips if I go on the Orange points. Once I hover over the blue series , I stop seeing tooltips altogether.
This doesnt happen immediately but Im sure that if just hover over random points eventually you will see the problem.
Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: showing tooltips on series.

Post by Sandra » Fri Nov 27, 2009 9:31 am

Hello gcrnd,
The code I have added in last post works fine here using last version 3 and last version 4 of TeeChart. Please, could you tell us which version of TeeChartNET you are using?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

Re: showing tooltips on series.

Post by qcrnd » Sun Nov 29, 2009 8:08 am

Hi Sandra
Thanks.
I confirm that the latest version fixes this issue
Thanks.

Post Reply