index.htm 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. <script type="text/javascript">
  8. $(function () {
  9. // Radialize the colors
  10. Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function(color) {
  11. return {
  12. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  13. stops: [
  14. [0, color],
  15. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  16. ]
  17. };
  18. });
  19. // Build the chart
  20. $('#container').highcharts({
  21. chart: {
  22. plotBackgroundColor: null,
  23. plotBorderWidth: null,
  24. plotShadow: false
  25. },
  26. title: {
  27. text: 'Browser market shares at a specific website, 2010'
  28. },
  29. tooltip: {
  30. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
  31. },
  32. plotOptions: {
  33. pie: {
  34. allowPointSelect: true,
  35. cursor: 'pointer',
  36. dataLabels: {
  37. enabled: true,
  38. color: '#000000',
  39. connectorColor: '#000000',
  40. formatter: function() {
  41. return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
  42. }
  43. }
  44. }
  45. },
  46. series: [{
  47. type: 'pie',
  48. name: 'Browser share',
  49. data: [
  50. ['Firefox', 45.0],
  51. ['IE', 26.8],
  52. {
  53. name: 'Chrome',
  54. y: 12.8,
  55. sliced: true,
  56. selected: true
  57. },
  58. ['Safari', 8.5],
  59. ['Opera', 6.2],
  60. ['Others', 0.7]
  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; margin: 0 auto"></div>
  71. </body>
  72. </html>