Question

http://jsfiddle.net/CYJAk/13/

have a look at it, the tooltip doesn't show at all. i donno if tooltip dataFormat is being over-ridden by some other function. and also the date in x-axis when zoomed in doesn't show minutes, what should i do for that?

Was it helpful?

Solution

Under firefox, I can see that your javascript error in your tooltip formatter is:

Uncaught TypeError: Cannot read property 'name' of undefined

This seems contrary to the docs (perhaps because it is not shared?). I find that using

this.points[0].series.name

fixes this. Note, you'll also have to change your this.y to something similar this.points[0].y for that to work.

OTHER TIPS

From a completely different perspective - I was also having problems with Highcharts tooltips using Chrome on my Ultrabook. This problem was not occurring in IE or FireFox.

I was not using shared series, so the solution above did not apply.

Turns out the problem is that Chrome recognizes the Ultrabook has a touchscreen, and enables the touch events. Highcharts (v2.2.5) does not enable the 'mouseover' event for devices that support touch, but instead enables the 'touchstart' event. As the 'touchstart' was not occuring when my mouse hovered over the icon, the tooltip never appeared.

This is the line in Highcharts that adds the handler based on the device type:

.on(hasTouch ? 'touchstart' : 'mouseover', function (e) {
    series.onMouseOver();
    if (e.target._i !== UNDEFINED) { // undefined on graph in scatterchart
        points[e.target._i].onMouseOver();
    }
})

Thus, it would probably work to explicitly add a 'mouseover' handler and trigger a 'touchstart' in these cases.

Highcharts checks for the existence of ontouchstart to determine touch-enabled devices:

hasTouch = doc.documentElement.ontouchstart !== UNDEFINED,

Try this:

formatter: function() {
    var point = this.points[0],
        x = point.x,
        y = point.y,
        seriesName = point.series.name;

    return Highcharts.dateFormat('%A,%b %e,%Y, %H:%M', x) +'<br/> '+'<strong>'+ seriesName +'</strong>'+ y;
}

I have been using Highcharts a lot but have never used Highstock but like Mark said this goes against the docs. Looks like a bug.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top