index.htm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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://cdn.hcharts.cn/jquery/jquery-1.8.3.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="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
  69. <script src="http://cdn.hcharts.cn/highcharts/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>