You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.1 KiB

8 years ago
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Highcharts Example</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  7. <style type="text/css">
  8. ${demo.css}
  9. </style>
  10. <script type="text/javascript">
  11. $(function () {
  12. $('#container').highcharts({
  13. chart: {
  14. plotBackgroundColor: null,
  15. plotBorderWidth: null,
  16. plotShadow: false,
  17. type: 'pie'
  18. },
  19. title: {
  20. text: 'Browser market shares January, 2015 to May, 2015'
  21. },
  22. tooltip: {
  23. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  24. },
  25. plotOptions: {
  26. pie: {
  27. allowPointSelect: true,
  28. cursor: 'pointer',
  29. dataLabels: {
  30. enabled: true,
  31. format: '<b>{point.name}</b>: {point.percentage:.1f} %',
  32. style: {
  33. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
  34. }
  35. }
  36. }
  37. },
  38. series: [{
  39. name: "Brands",
  40. colorByPoint: true,
  41. data: [{
  42. name: "Microsoft Internet Explorer",
  43. y: 56.33
  44. }, {
  45. name: "Chrome",
  46. y: 24.03,
  47. sliced: true,
  48. selected: true
  49. }, {
  50. name: "Firefox",
  51. y: 10.38
  52. }, {
  53. name: "Safari",
  54. y: 4.77
  55. }, {
  56. name: "Opera",
  57. y: 0.91
  58. }, {
  59. name: "Proprietary or Undetectable",
  60. y: 0.2
  61. }]
  62. }]
  63. });
  64. });
  65. </script>
  66. </head>
  67. <body>
  68. <script src="../../js/highcharts.js"></script>
  69. <script src="../../js/modules/exporting.js"></script>
  70. <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
  71. </body>
  72. </html>