Javascript examples for highcharts:Line Chart
manage event through a fill color in line chart?
<html> <head> <title>Highcharts Demo</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"> $(function () {// w ww . j av a 2 s.co m $('#container').highcharts({ chart: {}, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, plotOptions: { area: { marker: { enabled: false } }, series: { cursor: 'pointer', point: { events: { click: function () { console.log('Category: ' + this.category + ', value: ' + this.y); } } } } }, series: [{ type: 'area', color: '#000000', index:0, data: [39.9, 75.5, 120.4, 150.2, 130.0, 120.0, 140.6, 158.5, 216.4, 194.1, 220.6, 230.4] }, { index:1, color: '#000000', data: [39.9, 75.5, 120.4, 150.2, 130.0, 120.0, 140.6, 158.5, 216.4, 194.1, 220.6, 230.4] }, { color: '#ff0000', index:2, data: [250.9, 240.5, 230.4, 220.2, 200.0, 180.0, 160.6, 140.5, 110.4, 100.1, 75.6, 20.4] }, { color: '#ff0000', type: 'area', index:0, data: [250.9, 240.5, 230.4, 220.2, 200.0, 180.0, 160.6, 140.5, 110.4, 100.1, 75.6, 20.4] } ] }); }); </script> </head> <body> <script src="https://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 400px"></div> </body> </html>