javascript - How can I style highchart select to look like hover? -
highcharts amazing library, need programatically scroll through chart if cursor hovering across x-axis. way can think of doing selecting points, unfortunately not find options in highcharts api documentation allows me put crosshairs/ playheader on selected points.
how can this?
this not part of api, can use point.onmouseover()
fire mouseover event: http://jsfiddle.net/15dzo23n/1/
example:
var index = 0; $('#container').highcharts({ chart: { events: { load: hoveranim } }, tooltip: { crosshairs: true }, series: [{ name: 'aapl', data: [5, 10, 15, 12, 13, 14, 12, 1, 12, 1, 12, 12, 12, 1] }] }); function hoveranim(e) { var chart = this, points = chart.series[0].points, len = points.length; if (index < len) { chart.hoverseries = chart.series[0]; chart.hoverpoint = points[index]; chart.pointer.runpointactions(e); //display crosshair points[index].onmouseover(e); // display tooltip , set hover state index++; settimeout(function () { hoveranim.call(chart, e); }, 100); } }
Comments
Post a Comment