Displaying Tooltip on hover over marker


https://www.nevron.com/Forum/Topic11840.aspx
Print Topic | Close Window

By Simon Brun - 8 Years Ago
Is it possible to somehow display a tolltip when hovering over a marker of a 2D line graph?
I managed to display a tooltip when just hovering any part of the line but I'd like to have it show specifically when hovering a marker.

An answer would be greatly appreciated.
By Nevron Support - 8 Years Ago
Hi Simon,
You'll need to create a second point series that has per point tooltips and disable the markers of the line if you want to achieve this effect:

            NChart chart = nChartControl1.Charts[0];

            NLineSeries line = new NLineSeries();
            line.DataLabelStyle.Visible = false;
            line.MarkerStyle.Visible = false;

            for (int i = 0; i < 3; i++)
            {
                line.Values.Add(i);
            }

            NPointSeries point = new NPointSeries();

            for (int i = 0; i < line.Values.Count; i++)
            {
                point.Values.Add(line.Values[i]);
                point.InteractivityStyles.Add(i, i.ToString());
            }

            chart.Series.Add(point);
            chart.Series.Add(line);

            nChartControl1.Controller.Tools.Add(new NTooltipTool());

Hope this helps - let us know if you meet any problems.
By Manal Goyal - 6 Years Ago
Is this still applicable for latest version of nevron chart?
By Nevron Support - 6 Years Ago
Hi Manal,

Yes this is still the case.
By Manal Goyal - 5 Years Ago
Hi team,
While the solution that you guys provided in this thread may work for me, I would like to have exact functionality what the original poster has already achieved. That is to show tooltip when hovering over any part of the line series. How would I achieve that?

Regrads
Manal
By Dhanashree Gholap - 5 Years Ago
Hi team,

I am using the tooltip tool same as above code explanation. But I am facing problem to change the color of tooltip text.
How we can change the tooltip text color?