Line chart: General tooltips incorrect when line is autosampled (16.8.8.12)


Line chart: General tooltips incorrect when line is autosampled...
Author
Message
Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Hi
I'm creating line series and using line.SamplingMode = SeriesSamplingMode.Auto
I set individual point tooltips for up to 2048 points using InteractivityStyles.Add for each point
This all works fine.. However, for performance I set a generic tooltip for more than 2048 points, using:
nevronSeries.InteractivityStyle = new NInteractivityStyle( 
string.Format( CultureInfo.CurrentCulture, "{0}: <xvalue>{2}{1}: <value>",  xTitle,   YTitle, Environment.NewLine));
However, all tooltips display 0 for <xvalue> and <value> when the line is sampled.
The tooltips are correct if I don't set a SamplingMode.
Is this a bug?
- On a separate note, is there a way for me to supply a tooltip dynamically when the mouse is hovered over a point rather than supplying all tooltips upfront? It's very wasteful of resources!

Thanks

Kevin

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Kevin,

This is by design - when in sampled mode the chart does not record individual information for hit testing purposes on a per data point basis. This is done to improve performance. You can overcome the problem by getting the nearest data point and displaying relevant information in a tooltip for it. We have also modified the tooltip tool to have an public virtual method called GetTooltipFromPoint which you'll have to override and return a tooltip based on the currently hit tested mouse position. We'll publish a SP about this today or tomorrow. Hope this helps - let us know if you have any questions.


Best Regards,
Nevron Support Team


Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Hi guys

That sounds really useful. We'd already discovered GetTooltipFromPoint wasn't virtual. The next question is how do I get the nearest data point as GetTooltipFromPoint gives me the mouse location and it sounds like I can't use NHitTestResult.DataPointIndex?

Thanks

Kevin
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Kevin,
Just a short note that we published a SP that exposes the GetTooltipFromPoint method. Regarding the closest value - if you wish to search the closest value in just one particular dimension (for example closest x value) you can use the FindClosestValue method of the respective series:

int closestDataPointIndex = someSeries.XValues.FindClosestValue(someValue, false); // second argument specifies whether the series is ordered

Otherwise you need to perform the following:
1.Convert the view coordinate to scale coordinate.
2. Loop through the data points and find the closest data point.

Hope this helps - let us know if you meet any problems.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search