jquery - tooltip in highcharts does not work properly -


i using highchart(line-time-series) , works fine demonstrated in fiddle link provided , tool tips not shown smoothly example if in middle of green line , want see tooltip line below if point cursor on point in lower line tool tip green line still shown , seeing tooltip lower lines should start cursor beginning of line want see able see tooltip painful.here code:

$(function () {             var youdynamicseries = [];             var series1 = {                 type: 'area',                 name: 'usd eur',                 pointinterval: 24 * 3600 * 1000,                 pointstart: date.utc(2006, 0, 01),                 data: [                 0.8446, 0.8445, 0.8444, 0.8451, 0.8418, 0.8264, 0.8258, 0.8232, 0.8233, 0.8258              ]             };             var series2 = {                 type: 'area',                 name: 'usd eur',                 pointinterval: 24 * 3600 * 1000,                 pointstart: date.utc(2006, 0, 01),                 data: [                 0.7446, 0.6445, 0.5544, 0.8451, 0.5418, 0.7264, 0.6258, 0.5232, 0.3233, 0.6258             ]             };             var series3 = {                 type: 'area',                 name: 'usd eur',                 pointinterval: 24 * 3600 * 1000,                 pointstart: date.utc(2006, 0, 01),                 data: [                 0.9446, 0.8445, 0.9544, 0.9451, 0.9418, 0.9264, 0.8258, 0.8232, 0.8233, 0.9258             ]             };             youdynamicseries.push(series1);             youdynamicseries.push(series2);             youdynamicseries.push(series3);             $('#container').highcharts({                 chart: {                     zoomtype: 'xy'                 },                 title: {                     text: 'usd eur exchange rate 2006 through 2008'                 },                 subtitle: {                     text: document.ontouchstart === undefined ?                 'click , drag in plot area zoom in' :                 'pinch chart zoom in'                 },                 xaxis: {                     type: 'datetime',                     minrange: 14 * 24 * 3600000 // fourteen days                 },                 yaxis: {                     title: {                         text: 'exchange rate'                     }                 },                 legend: {                     enabled: false                 },                 plotoptions: {                     area: {                         fillcolor: {                             lineargradient: { x1: 0, y1: 0, x2: 0, y2: 1 },                             stops: [                         [0, highcharts.getoptions().colors[0]],                         [1, highcharts.color(highcharts.getoptions().colors[0]).setopacity(0).get('rgba')]                     ]                         },                         marker: {                             radius: 2                         },                         linewidth: 1,                         states: {                             hover: {                                 linewidth: 1                             }                         },                         threshold: null                     }                 },                 series: youdynamicseries             });         }); 

fiddle link:

fiddle

i hope transmit meaning.can help?(i appreciate in advance)

this has order in series added. zindex dictates series item gets hover. zindex auto calculated series in relation other series in series object array. see demo link below have enabled legend - if turn off series notice last series added on "top" of other two. while general line/bar charts let hover on point "below" 1 in zindex area chart not (which think bug). solve there 2 possible methods:

  1. you assign zindex series based on largest value being bottom (lowest zindex) , smallest valued series being top (highest zindex). problem have pre-calculate metric on "large" or "small" series , not guaranteed work if 1 point higher/lower series' point.
  2. the other option treat tooltip shared. means if data points share same xaxis value can shown in 1 tooltip when hover on of points. recommended option think.

live demo of option 2


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -