PDA

View Full Version : [CLOSED] Scatter chart radius + tooltip



jchau
Apr 30, 2014, 8:19 PM
I have a scatter chart where the dots have a pretty big radius. When I hover over the dot, the tooltip does not show unless I am near the center of the dot. Is there a setting to control when the tooltip is visible?

Vladimir
May 01, 2014, 8:20 AM
There is 'isItemInPoint' method in 'Ext.chart.series.Scatter'
Inside that method you can find tolerance variable equals 10
So, I guess you need to override that method to increase tolerance

Here is that method


isItemInPoint: function(x, y, item) {
var point,
tolerance = 10,
abs = Math.abs;


function dist(point) {
var dx = abs(point[0] - x),
dy = abs(point[1] - y);
return Math.sqrt(dx * dx + dy * dy);
}
point = item.point;
return (point[0] - tolerance <= x && point[0] + tolerance >= x &&
point[1] - tolerance <= y && point[1] + tolerance >= y);
}

jchau
May 01, 2014, 1:35 PM
Thanks. I want to use the radius to determine the tolerance. Just by playing wiht numbers, I find that radius * 4 seems to work. Do you know the relationship between radius and point size?

Daniil
May 02, 2014, 7:13 PM
Hi,

It looks that "point" in that method is just a center of scatter item and it doesn't depend on radius. Maybe, it should depend, we are not sure.