javascript - Using Highcharts formatter causes Cannot read property 'length' of undefined -
i want display custom text in tooltip. when use code, got cannot read property 'length' of undefined
when hover on tooltip.
does knows where's problem?
tooltip: { shared: false, formatter: function() { var serie = this.series; var s = '<span style="color:' + serie.color + '">' + serie.options.name + '</span>: <b>' + this.y + '</b><br/>'; $.each(serie.options.composition, function(name, value) {//error pop ups here s += '<b>' + name + ':</b> ' + value + '<br>'; }); return s; } }
edit - added error message:
uncaught typeerror: cannot read property 'length' of undefinedm.extend.each @ jquery.min.js:2$.highcharts.tooltip.formatter @ grafovi.php:823mb.refresh @ highcharts.js:160va.runpointactions @ highcharts.js:166va.oncontainermousemove @ highcharts.js:174va.setdomevents.b.onmousemove @ highcharts.js:176
as comment check serie.options.composition
exists , array
.
Comments
Post a Comment