Javascript examples for highcharts:Chart Series
include two series in a chart
<html> <head> <title>Highcharts tooltip data from array</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> var myComments=["First input","second comment","another comment","last comment"] var dataValues = [29.9, 71.5, 194.1, 129.2]; var dataValues2 = [194.1, 95.6, 194.1, 29.9]; var categories = ['Jan', 'Feb', 'Mar', 'Apr']; var n=['tooltip1','tooltip2','tooltip3','tooltip4']; $(function () {/*from w w w. j av a 2 s. c o m*/ $('#container').highcharts({ chart: {}, tooltip: { formatter: function () { var serieI = this.series.index; var index = categories.indexOf(this.x); var comment = myComments[index]; return '-->'+comment; } }, xAxis: { categories: categories }, series: [{ data: dataValues }, { data: dataValues2 }] }); }); </script> </head> <body> <script src="https://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 400px"></div> </body> </html>