UNPKG

dashboard

Version:

Create dashboards with gadgets on node.js

101 lines (87 loc) 2.73 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.4.2/jquery.min.js"></script> <script type="text/javascript" src="../js/highcharts.js"></script> <!-- 1a) Optional: the exporting module --> <script type="text/javascript" src="../js/modules/exporting.js"></script> <!-- 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', margin: [50, 0, 0, 0], plotBackgroundColor: 'none', plotBorderWidth: 0, plotShadow: false }, title: { text: 'Browser market shares at a specific website' }, subtitle: { text: 'Inner circle: 2008, outer circle: 2010' }, plotArea: { shadow: null, borderWidth: null, backgroundColor: null }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.point.name +': '+ this.y +' %'; } }, legend: { enabled: false }, series: [{ type: 'pie', name: '2008', size: '45%', innerSize: '20%', data: [ { name: 'Firefox', y: 44.2, color: '#4572A7' }, { name: 'IE', y: 46.6, color: '#AA4643' }, { name: 'Chrome', y: 3.1, color: '#89A54E' }, { name: 'Safari', y: 2.7, color: '#80699B' }, { name: 'Opera', y: 2.3, color: '#3D96AE' }, { name: 'Mozilla', y: 0.4, color: '#DB843D' } ] }, { type: 'pie', name: '2010', innerSize: '45%', data: [ { name: 'Firefox', y: 45.0, color: '#4572A7' }, { name: 'IE', y: 26.8, color: '#AA4643' }, { name: 'Chrome', y: 12.8, color: '#89A54E' }, { name: 'Safari', y: 8.5, color: '#80699B' }, { name: 'Opera', y: 6.2, color: '#3D96AE' }, { name: 'Mozilla', y: 0.2, color: '#DB843D' } ], dataLabels: { enabled: true, formatter: function() { if (this.y > 5) return this.point.name; }, color: 'white', style: { font: '13px Trebuchet MS, Verdana, sans-serif' } } }] }); }); </script> </head> <body> <!-- 3. Add the container --> <div id="container" style="width: 800px; height: 400px; margin: 0 auto"></div> </body> </html>