index.htm 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Highcharts Example</title>
  7. <style type="text/css">
  8. </style>
  9. </head>
  10. <body>
  11. <script src="../../code/highcharts.js"></script>
  12. <script src="../../code/modules/exporting.js"></script>
  13. <script src="../../code/modules/export-data.js"></script>
  14. <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
  15. <script type="text/javascript">
  16. // Make monochrome colors
  17. var pieColors = (function () {
  18. var colors = [],
  19. base = Highcharts.getOptions().colors[0],
  20. i;
  21. for (i = 0; i < 10; i += 1) {
  22. // Start out with a darkened base color (negative brighten), and end
  23. // up with a much brighter color
  24. colors.push(Highcharts.Color(base).brighten((i - 3) / 7).get());
  25. }
  26. return colors;
  27. }());
  28. // Build the chart
  29. Highcharts.chart('container', {
  30. chart: {
  31. plotBackgroundColor: null,
  32. plotBorderWidth: null,
  33. plotShadow: false,
  34. type: 'pie'
  35. },
  36. title: {
  37. text: 'Browser market shares at a specific website, 2014'
  38. },
  39. tooltip: {
  40. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  41. },
  42. plotOptions: {
  43. pie: {
  44. allowPointSelect: true,
  45. cursor: 'pointer',
  46. colors: pieColors,
  47. dataLabels: {
  48. enabled: true,
  49. format: '<b>{point.name}</b><br>{point.percentage:.1f} %',
  50. distance: -50,
  51. filter: {
  52. property: 'percentage',
  53. operator: '>',
  54. value: 4
  55. }
  56. }
  57. }
  58. },
  59. series: [{
  60. name: 'Share',
  61. data: [
  62. { name: 'Chrome', y: 61.41 },
  63. { name: 'Internet Explorer', y: 11.84 },
  64. { name: 'Firefox', y: 10.85 },
  65. { name: 'Edge', y: 4.67 },
  66. { name: 'Safari', y: 4.18 },
  67. { name: 'Other', y: 7.05 }
  68. ]
  69. }]
  70. });
  71. </script>
  72. </body>
  73. </html>