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. // Radialize the colors
  17. Highcharts.setOptions({
  18. colors: Highcharts.map(Highcharts.getOptions().colors, function (color) {
  19. return {
  20. radialGradient: {
  21. cx: 0.5,
  22. cy: 0.3,
  23. r: 0.7
  24. },
  25. stops: [
  26. [0, color],
  27. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  28. ]
  29. };
  30. })
  31. });
  32. // Build the chart
  33. Highcharts.chart('container', {
  34. chart: {
  35. plotBackgroundColor: null,
  36. plotBorderWidth: null,
  37. plotShadow: false,
  38. type: 'pie'
  39. },
  40. title: {
  41. text: 'Browser market shares in January, 2018'
  42. },
  43. tooltip: {
  44. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  45. },
  46. plotOptions: {
  47. pie: {
  48. allowPointSelect: true,
  49. cursor: 'pointer',
  50. dataLabels: {
  51. enabled: true,
  52. format: '<b>{point.name}</b>: {point.percentage:.1f} %',
  53. style: {
  54. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
  55. },
  56. connectorColor: 'silver'
  57. }
  58. }
  59. },
  60. series: [{
  61. name: 'Share',
  62. data: [
  63. { name: 'Chrome', y: 61.41 },
  64. { name: 'Internet Explorer', y: 11.84 },
  65. { name: 'Firefox', y: 10.85 },
  66. { name: 'Edge', y: 4.67 },
  67. { name: 'Safari', y: 4.18 },
  68. { name: 'Other', y: 7.05 }
  69. ]
  70. }]
  71. });
  72. </script>
  73. </body>
  74. </html>