javascript - Series for tooltip only in highcharts -
i need use several series in tooltip in highchart chart. these series should invisible except tooltip. 've tried setting visible false. in case, legends series still visible though faded. if state "ignorehiddenseries: true", hidden series not there @ , cannot use them @ tooltip. there way type of usage? keeping series in global javascript arrays outside highchart's scope , using them in tooltip formatter. prefer keep data in highchart well.
by way setting showinlegend: false, visible: false makes series unusable in tooltip.
each invisible serie should have 2 params:
visible: false, showinlegend: false,
you need use tooltip formatter , use loop on each serie / each point print values.
tooltip: { formatter: function() { var series = this.series.chart.series, x = this.x, each = highcharts.each, txt = '<span style="font-size: 10px">' + this.key + '</span><br/>'; each(series, function(serie, i) { each(serie.data, function(data, j){ if(data.x === x) { txt += '<span style="color:' + data.color + '">\u25cf</span> ' + data.series.name + ': <b>' + data.y + '</b><br/>'; } }); }); return txt; } },
example: http://jsfiddle.net/697e8seo/
Comments
Post a Comment