Hello all,
I'm working in Infragistics 13.1 with the UltraChart, using a 2D Bubble chart to plot some data for an application.
I'd like to display a custom tooltip whenever I mouse over the data item in the chart after plotting. If there's more than one "bubble" at the point I hover, I want to display a tooltip that shows a list of what items are under the mouse.
I've tried using the information provided in the DataItemOut and DataItemOver events, but haven't gotten far.
Do you have any examples of how to determine which data items are underneath the mouse point if there is more than one available, or does the UltraChart only return information the top-most layer?
Any help/comments are appreciated.
Thanks!
Hello,
You could use IRenderLable interface in order to customize your tooltip text.
http://help.infragistics.com/doc/WinForms/2014.1/CLR4.0/?page=Chart_Customize_Labels_Using_the_IRenderLabel_Interface.html
I’ve implemented simple sample in order to demonstrate you how you could achieve your goal .
Please let me know if you have any further questions.
Thank you for the quick reply.
My issue is not with rendering the tooltip, it's with determining the information about the overlapped DataItems whenever I hover over a point.
For example, if I have two bubbles at the same point, at the same size on a populated 2D Bubble Chart, and I hover over the point, I only get information for the top-most DataItem. I need a way to determine which bubbles are at that point, and access them as a "collection" of bubbles, rather than just displaying whichever one ends up on top
I am glad to hear that my sample helps you.
Please do not hesitate to contact with us if you have any further questions on this matter.
Hristo,
Sorry for the confusion. I originally couldn't get your sample to run, but did some digging this morning and get things working.
I think the example you've given is enough to get close to what I need.
Thanks for the help!
Melissa
Hello ,
Have you run my sample ? Does it display tooltip with list of a bubbles which overlaps for the current position of the mouse ? in the implementation of IRenderLable interface I had put code which returns list of ellipse primitives which contains the current mouse position:
private void PopulateValues()
{
var Core = ultraChart1.GetType().GetProperty("ChartCore", BindingFlags.CreateInstance | BindingFlags.GetField | BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Static);
var CoreValue = Core.GetValue(ultraChart1, null);
SceneGraph scene = (SceneGraph)CoreValue.GetType().GetProperty("SceneGraph").GetValue(CoreValue, null);
Point mouseLocation = Cursor.Position;
mouseLocation = ultraChart1.PointToClient(mouseLocation);
List<Primitive> elipses = scene.Cast<Primitive>().Where(p => p is Ellipse && ((Ellipse)p).HitTest(mouseLocation)).ToList<Primitive>();
MyLabelRenderer.values.Clear();
foreach(var p in elipses)
MyLabelRenderer.values.Add (p.Value);
}
Isn’t this what you are looking for ?
I am waiting for your feedback.