UNPKG

dashboard

Version:

Create dashboards with gadgets on node.js

107 lines (96 loc) 2.69 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Highcharts Example</title> <!-- 1. Add these JavaScript inclusions in the head of your page --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="../js/highcharts.js"></script> <!--[if IE]> <script type="text/javascript" src="../js/excanvas.compiled.js"></script> <![endif]--> <!-- 2. Add the JavaScript to initialize the chart on document ready --> <script type="text/javascript"> var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'container' }, title: { text: 'Combination chart' }, xAxis: { categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums'] }, tooltip: { formatter: function() { var s; if (this.point.name) { // the pie chart s = '<b>Total fruit consumption</b><br/>'+ this.point.name +': '+ this.y +' fruits'; } else { s = '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y; } return s; } }, labels: { items: [{ html: 'Total fruit consumption', style: { left: '40px', top: '8px', color: 'black' } }] }, series: [{ type: 'column', name: 'Jane', data: [3, 2, 1, 3, 4] }, { type: 'column', name: 'John', data: [2, 3, 5, 7, 6] }, { type: 'column', name: 'Joe', data: [4, 3, 3, 9, 0] }, { type: 'spline', name: 'Average', data: [3, 2.67, 3, 6.33, 3.33] }, { type: 'pie', name: 'Total consumption', data: [{ name: 'Jane', y: 13, color: '#4572A7' // Jane's color }, { name: 'John', y: 23, color: '#AA4643' // John's color }, { name: 'Joe', y: 19, color: '#89A54E' // Joe's color }], center: [100, 80], size: 100, showInLegend: false }] }); }); </script> <script type="text/javascript" src="http://www.highcharts.com/highslide/highslide-full.min.js"></script> <script type="text/javascript" src="http://www.highcharts.com/highslide/highslide.config.js" charset="utf-8"></script> <link rel="stylesheet" type="text/css" href="http://www.highcharts.com/highslide/highslide.css" /> </head> <body> <!-- 3. Add the container --> <div id="container" style="width: 800px; height: 400px; margin: 0 auto"></div> </body> </html>