郑州第一人民医院UI

ssss.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. $(function() {
  2. // 创建图表
  3. $('#container').highcharts({
  4. chart: {
  5. type: 'pie'
  6. },
  7. title: false,
  8. // yAxis: {
  9. // title: {
  10. // text: '总百分比市场份额'
  11. // }
  12. // },
  13. credits: {
  14. enabled: false // 禁用版权信息
  15. },
  16. exporting: {
  17. enabled: false
  18. }, //隐藏导出图片
  19. plotOptions: {
  20. pie: {
  21. shadow: false,
  22. center: ['50%', '50%']
  23. }
  24. },
  25. // tooltip: {
  26. //// valueSuffix: '%'
  27. // },s
  28. series: [{
  29. name: '应巡检',
  30. data: [{
  31. name: "数量",
  32. y: 300,
  33. color: "#3f85ed"
  34. }],
  35. size: '38%',
  36. dataLabels: {
  37. formatter: function() {
  38. // return this.y > 5 ? this.point.name : null;
  39. return this.y > 5 ? this.point.y : null;
  40. },
  41. style: {
  42. color: 'white',
  43. fontSize: '16px'
  44. },
  45. distance: -80 // 距离值为负时显示在在扇区里面
  46. }
  47. }, {
  48. name: '数量',
  49. data: [{
  50. name: '未巡检',
  51. y: 100,
  52. color: "#69a0f3"
  53. }, {
  54. name: '已巡检',
  55. y: 200,
  56. color: "#b891f7"
  57. }],
  58. size: '80%',
  59. innerSize: '60%',
  60. dataLabels: {
  61. softConnector: false, // 是否使用曲线
  62. connectorColor: 'red', // 连接线颜色,默认是扇区颜色
  63. distance: 20, // 数据标签与扇区距离
  64. connectorPadding: 20, // 数据标签与连接线的距离
  65. formatter: function() {
  66. // 通过函数判断是否显示数据标签,为了防止数据标签过于密集
  67. // return this.y > 1 ? '<b>' + this.point.name + ':</b> ' + this.y + '%' : null;
  68. return this.y > 1 ? this.y : null;
  69. },
  70. style: {
  71. color: 'white',
  72. fontSize: '16px'
  73. }
  74. }
  75. }]
  76. });
  77. });