安装

局部注册

全局注册

  1. import { VChart, VLine, VArea, VBar, VPie, VPoint, VScale, VAxis, VGuide, VTooltip, VLegend, VGuide } from 'vux'
  2. export default {
  3. components: {
  4. VChart,
  5. VLine,
  6. VArea,
  7. VBar,
  8. VPie,
  9. VPoint,
  10. VScale,
  11. VAxis,
  12. VGuide,
  13. VTooltip,
  14. VLegend,
  15. VGuide
  16. }
  17. }

  1. // 在入口文件全局引入
  2. import Vue from 'vue'
  3. import { VChart, VLine, VArea, VBar, VPie, VPoint, VScale, VAxis, VGuide, VTooltip, VLegend, VGuide } from 'vux'
  4. Vue.component('v-chart', VChart)
  5. Vue.component('v-line', VLine)
  6. Vue.component('v-area', VArea)
  7. Vue.component('v-bar', VBar)
  8. Vue.component('v-pie', VPie)
  9. Vue.component('v-point', VPoint)
  10. Vue.component('v-scale', VScale)
  11. Vue.component('v-axis', VAxis)
  12. Vue.component('v-guide', VGuide)
  13. Vue.component('v-tooltip', VTooltip)
  14. Vue.component('v-legend', VLegend)
  15. Vue.component('v-guide', VGuide)

基本折线图

安装 - 图1

  1. <template>
  2. <div>
  3. <v-chart :data="data" prevent-default>
  4. <v-scale x :tick-count="3" />
  5. <v-tooltip :show-item-marker="false" show-x-value />
  6. <v-line />
  7. </v-chart>
  8. </div>
  9. </template>
  10. <script>
  11. import { VChart, VTooltip, VLine, VScale } from 'vux'
  12. export default {
  13. components: {
  14. VChart,
  15. VTooltip,
  16. VLine,
  17. VScale
  18. },
  19. data () {
  20. return {
  21. data: [
  22. { date: '2017-06-05', value: 116 },
  23. { date: '2017-06-06', value: 129 },
  24. { date: '2017-06-07', value: 135 },
  25. { date: '2017-06-08', value: 86 },
  26. { date: '2017-06-09', value: 73 },
  27. { date: '2017-06-10', value: 85 },
  28. { date: '2017-06-11', value: 73 },
  29. { date: '2017-06-12', value: 68 },
  30. { date: '2017-06-13', value: 92 },
  31. { date: '2017-06-14', value: 130 },
  32. { date: '2017-06-15', value: 245 },
  33. { date: '2017-06-16', value: 139 },
  34. { date: '2017-06-17', value: 115 },
  35. { date: '2017-06-18', value: 111 },
  36. { date: '2017-06-19', value: 309 },
  37. { date: '2017-06-20', value: 206 },
  38. { date: '2017-06-21', value: 137 },
  39. { date: '2017-06-22', value: 128 },
  40. { date: '2017-06-23', value: 85 },
  41. { date: '2017-06-24', value: 94 },
  42. { date: '2017-06-25', value: 71 },
  43. { date: '2017-06-26', value: 106 },
  44. { date: '2017-06-27', value: 84 },
  45. { date: '2017-06-28', value: 93 },
  46. { date: '2017-06-29', value: 85 },
  47. { date: '2017-06-30', value: 73 },
  48. { date: '2017-07-01', value: 83 },
  49. { date: '2017-07-02', value: 125 },
  50. { date: '2017-07-03', value: 107 },
  51. { date: '2017-07-04', value: 82 },
  52. { date: '2017-07-05', value: 44 },
  53. { date: '2017-07-06', value: 72 },
  54. { date: '2017-07-07', value: 106 },
  55. { date: '2017-07-08', value: 107 },
  56. { date: '2017-07-09', value: 66 },
  57. { date: '2017-07-10', value: 91 },
  58. { date: '2017-07-11', value: 92 },
  59. { date: '2017-07-12', value: 113 },
  60. { date: '2017-07-13', value: 107 },
  61. { date: '2017-07-14', value: 131 },
  62. { date: '2017-07-15', value: 111 },
  63. { date: '2017-07-16', value: 64 },
  64. { date: '2017-07-17', value: 69 },
  65. { date: '2017-07-18', value: 88 },
  66. { date: '2017-07-19', value: 77 },
  67. { date: '2017-07-20', value: 83 },
  68. { date: '2017-07-21', value: 111 },
  69. { date: '2017-07-22', value: 57 },
  70. { date: '2017-07-23', value: 55 },
  71. { date: '2017-07-24', value: 60 }
  72. ]
  73. }
  74. }
  75. }
  76. </script>

安装 - 图2 Show code

折线图:平滑曲线

安装 - 图3

  1. <template>
  2. <div>
  3. <v-chart :data="data">
  4. <v-scale x type="timeCat" mask="MM/DD" :tick-count="3" />
  5. <v-scale y :min="0" alias="日均温度" :tick-count="5" />
  6. <v-point
  7. :style="{
  8. stroke: '#fff',
  9. lineWidth: 1
  10. }"
  11. shape="smooth" />
  12. <v-line shape="smooth" />
  13. </v-chart>
  14. </div>
  15. </template>
  16. <script>
  17. import { VChart, VLine, VPoint, VScale, VTooltip } from 'vux'
  18. export default {
  19. components: {
  20. VChart,
  21. VPoint,
  22. VLine,
  23. VScale,
  24. VTooltip
  25. },
  26. data () {
  27. return {
  28. data: [
  29. { time: '2016-08-08 00:00:00', tem: 10 },
  30. { time: '2016-08-08 00:10:00', tem: 22 },
  31. { time: '2016-08-08 00:30:00', tem: 20 },
  32. { time: '2016-08-09 00:35:00', tem: 26 },
  33. { time: '2016-08-09 01:00:00', tem: 20 },
  34. { time: '2016-08-09 01:20:00', tem: 26 },
  35. { time: '2016-08-10 01:40:00', tem: 28 },
  36. { time: '2016-08-10 02:00:00', tem: 20 },
  37. { time: '2016-08-10 02:20:00', tem: 18 }
  38. ]
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang='css'>
  44. </style>

安装 - 图4 Show code

动态数据:实时折线

安装 - 图5

  1. <template>
  2. <div>
  3. <v-chart :data="data" ref="demo">
  4. <v-scale x type="timeCat" :tick-count="3" mask="hh:mm:ss" />
  5. <v-scale y :min="8" :tick-count="5" />
  6. <v-tooltip :show-item-marker="false" show-x-value />
  7. <v-guide type="html" :options="guide1" />
  8. <v-guide type="html" :options="guide2" />
  9. <v-line />
  10. </v-chart>
  11. </div>
  12. </template>
  13. <script>
  14. import { VChart, VTooltip, VLine, VScale, VGuide } from 'vux'
  15. const data = []
  16. // 添加数据,模拟数据,可以指定当前时间的偏移的秒
  17. function getRecord (offset) {
  18. offset = offset || 0
  19. return {
  20. time: new Date().getTime() + offset * 1000,
  21. value: Math.random() + 10
  22. }
  23. }
  24. data.push(getRecord(-2))
  25. data.push(getRecord(-1))
  26. data.push(getRecord())
  27. export default {
  28. components: {
  29. VChart,
  30. VTooltip,
  31. VLine,
  32. VScale,
  33. VGuide
  34. },
  35. mounted () {
  36. this.timer = setInterval(() => {
  37. data.push(getRecord())
  38. }, 2000)
  39. },
  40. beforeDestroy () {
  41. clearInterval(this.timer)
  42. },
  43. data () {
  44. return {
  45. guide1: {
  46. position (xScale, yScales) {
  47. const xValues = xScale.values
  48. const yValues = yScales[0].values
  49. const xMax = xValues[xValues.length - 1]
  50. const yMax = yValues[yValues.length - 1]
  51. return [ xMax, yMax ]
  52. },
  53. html: '<div style="border-radius: 100%;border: none;width: 12px;height: 12px;background-color: rgb(24, 144, 255);transition: top 0.35s cubic-bezier(0.23, 1, 0.32, 1);"></div>'
  54. },
  55. guide2: {
  56. position (xScale, yScales) {
  57. const xValues = xScale.values
  58. const yValues = yScales[0].values
  59. const xMax = xValues[xValues.length - 1]
  60. const yMax = yValues[yValues.length - 1]
  61. return [ xMax, yMax ]
  62. },
  63. html: '<div style="border-radius: 100%;border: none;width: 20px;height: 20px;background-color: rgba(24, 144, 255, 0.5);transition: top 0.35s cubic-bezier(0.23, 1, 0.32, 1);"></div>'
  64. },
  65. data
  66. }
  67. }
  68. }
  69. </script>

安装 - 图6 Show code

折线图:渐变

安装 - 图7

  1. <template>
  2. <div>
  3. <v-chart :data="data">
  4. <v-scale x :tick-count="5" :max="2020" />
  5. <v-line shape="smooth" :colors="gradient"/>
  6. <v-guide type="tag" :options="tag" />
  7. <v-area shape="smooth" :colors="gradient"/>
  8. </v-chart>
  9. </div>
  10. </template>
  11. <script>
  12. import { VChart, VGuide, VLine, VArea, VScale } from 'vux'
  13. export default {
  14. components: {
  15. VChart,
  16. VGuide,
  17. VArea,
  18. VLine,
  19. VScale
  20. },
  21. data () {
  22. return {
  23. gradient: [
  24. [0, '#F2C587'],
  25. [0.5, '#ED7973'],
  26. [1, '#8659AF']
  27. ],
  28. tag: {
  29. position: [ 2017, 30.12 ],
  30. content: '30.12',
  31. direct: 'tl',
  32. offsetY: -5,
  33. background: {
  34. fill: '#8659AF'
  35. },
  36. pointStyle: {
  37. fill: '#8659AF'
  38. }
  39. },
  40. data: [
  41. { year: 2000, age: 27.2 },
  42. { year: 2001, age: 27.5 },
  43. { year: 2002, age: 27.8 },
  44. { year: 2003, age: 28 },
  45. { year: 2004, age: 28.2 },
  46. { year: 2005, age: 28.4 },
  47. { year: 2006, age: 28.8 },
  48. { year: 2007, age: 28.8 },
  49. { year: 2008, age: 28.8 },
  50. { year: 2009, age: 28.8 },
  51. { year: 2010, age: 28.9 },
  52. { year: 2011, age: 29 },
  53. { year: 2012, age: 29.3 },
  54. { year: 2013, age: 29.4 },
  55. { year: 2014, age: 29.5 },
  56. { year: 2015, age: 29.7 },
  57. { year: 2016, age: 30 },
  58. { year: 2017, age: 30.12 }
  59. ]
  60. }
  61. }
  62. }
  63. </script>

安装 - 图8 Show code

折线图:对比

安装 - 图9

  1. <template>
  2. <div>
  3. <v-chart :data="data">
  4. <v-line series-field="type" />
  5. </v-chart>
  6. </div>
  7. </template>
  8. <script>
  9. import { VChart, VLine, VAxis, VTooltip } from 'vux'
  10. /*
  11. * [
  12. * {"date":"2010-01-10","type":"能源","value":99.9},
  13. * {"date":"2010-01-10","type":"金属","value":96.6}
  14. * ]
  15. */
  16. import data from './line_color.json'
  17. export default {
  18. components: {
  19. VChart,
  20. VLine,
  21. VAxis,
  22. VTooltip
  23. },
  24. data () {
  25. return {
  26. data
  27. }
  28. }
  29. }
  30. </script>

安装 - 图10 Show code

折线图:显示点

安装 - 图11

  1. <template>
  2. <div>
  3. <v-chart :data="data">
  4. <v-scale y :min="0" /> <!-- 默认 y 轴数值从数据的最小值到最大值,此处重置为从 0 开始 -->
  5. <v-point :styles="{
  6. stroke: '#fff',
  7. lineWidth: 1
  8. }"/>
  9. <v-tooltip :show-item-marker="false" :on-show="onShow" /> <!-- onShow 为 F2 属性而非事件-->
  10. <v-line />
  11. </v-chart>
  12. </div>
  13. </template>
  14. <script>
  15. import { VChart, VPoint, VTooltip, VLine, VScale } from 'vux'
  16. export default {
  17. components: {
  18. VChart,
  19. VPoint,
  20. VTooltip,
  21. VLine,
  22. VScale
  23. },
  24. data () {
  25. return {
  26. onShow (ev) {
  27. const { items } = ev
  28. items[0].name = null
  29. items[0].value = '$ ' + items[0].value
  30. },
  31. data: [
  32. { day: '周一', value: 300 },
  33. { day: '周二', value: 400 },
  34. { day: '周三', value: 350 },
  35. { day: '周四', value: 500 },
  36. { day: '周五', value: 490 },
  37. { day: '周六', value: 600 },
  38. { day: '周日', value: 900 }
  39. ]
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang='css'>
  45. </style>

安装 - 图12 Show code

层叠面积图

安装 - 图13

  1. <template>
  2. <div>
  3. <v-chart :data="data">
  4. <v-scale x field="date" type="timeCat" mask="MM-DD" />
  5. <v-scale y field="value" :tick-count="4" :max="300" />
  6. <v-tooltip show-crosshairs show-value-in-legend />
  7. <v-area series-field="city" shape="smooth" adjust="stack" />
  8. <v-line series-field="city" shape="smooth" adjust="stack" />
  9. </v-chart>
  10. </div>
  11. </template>
  12. <script>
  13. import { VChart, VLine, VArea, VTooltip, VLegend, VScale } from 'vux'
  14. export default {
  15. components: {
  16. VChart,
  17. VLine,
  18. VArea,
  19. VTooltip,
  20. VLegend,
  21. VScale
  22. },
  23. data () {
  24. return {
  25. data: [
  26. { value: 63.4, city: 'New York', date: '2011-10-01' },
  27. { value: 62.7, city: 'Alaska', date: '2011-10-01' },
  28. { value: 72.2, city: 'Austin', date: '2011-10-01' },
  29. { value: 58, city: 'New York', date: '2011-10-02' },
  30. { value: 59.9, city: 'Alaska', date: '2011-10-02' },
  31. { value: 67.7, city: 'Austin', date: '2011-10-02' },
  32. { value: 53.3, city: 'New York', date: '2011-10-03' },
  33. { value: 59.1, city: 'Alaska', date: '2011-10-03' },
  34. { value: 69.4, city: 'Austin', date: '2011-10-03' },
  35. { value: 55.7, city: 'New York', date: '2011-10-04' },
  36. { value: 58.8, city: 'Alaska', date: '2011-10-04' },
  37. { value: 68, city: 'Austin', date: '2011-10-04' },
  38. { value: 64.2, city: 'New York', date: '2011-10-05' },
  39. { value: 58.7, city: 'Alaska', date: '2011-10-05' },
  40. { value: 72.4, city: 'Austin', date: '2011-10-05' },
  41. { value: 58.8, city: 'New York', date: '2011-10-06' },
  42. { value: 57, city: 'Alaska', date: '2011-10-06' },
  43. { value: 77, city: 'Austin', date: '2011-10-06' },
  44. { value: 57.9, city: 'New York', date: '2011-10-07' },
  45. { value: 56.7, city: 'Alaska', date: '2011-10-07' },
  46. { value: 82.3, city: 'Austin', date: '2011-10-07' },
  47. { value: 61.8, city: 'New York', date: '2011-10-08' },
  48. { value: 56.8, city: 'Alaska', date: '2011-10-08' },
  49. { value: 78.9, city: 'Austin', date: '2011-10-08' },
  50. { value: 69.3, city: 'New York', date: '2011-10-09' },
  51. { value: 56.7, city: 'Alaska', date: '2011-10-09' },
  52. { value: 68.8, city: 'Austin', date: '2011-10-09' },
  53. { value: 71.2, city: 'New York', date: '2011-10-10' },
  54. { value: 60.1, city: 'Alaska', date: '2011-10-10' },
  55. { value: 68.7, city: 'Austin', date: '2011-10-10' },
  56. { value: 68.7, city: 'New York', date: '2011-10-11' },
  57. { value: 61.1, city: 'Alaska', date: '2011-10-11' },
  58. { value: 70.3, city: 'Austin', date: '2011-10-11' },
  59. { value: 61.8, city: 'New York', date: '2011-10-12' },
  60. { value: 61.5, city: 'Alaska', date: '2011-10-12' },
  61. { value: 75.3, city: 'Austin', date: '2011-10-12' },
  62. { value: 63, city: 'New York', date: '2011-10-13' },
  63. { value: 64.3, city: 'Alaska', date: '2011-10-13' },
  64. { value: 76.6, city: 'Austin', date: '2011-10-13' },
  65. { value: 66.9, city: 'New York', date: '2011-10-14' },
  66. { value: 67.1, city: 'Alaska', date: '2011-10-14' },
  67. { value: 66.6, city: 'Austin', date: '2011-10-14' },
  68. { value: 61.7, city: 'New York', date: '2011-10-15' },
  69. { value: 64.6, city: 'Alaska', date: '2011-10-15' },
  70. { value: 68, city: 'Austin', date: '2011-10-15' },
  71. { value: 61.8, city: 'New York', date: '2011-10-16' },
  72. { value: 61.6, city: 'Alaska', date: '2011-10-16' },
  73. { value: 70.6, city: 'Austin', date: '2011-10-16' },
  74. { value: 62.8, city: 'New York', date: '2011-10-17' },
  75. { value: 61.1, city: 'Alaska', date: '2011-10-17' },
  76. { value: 71.1, city: 'Austin', date: '2011-10-17' },
  77. { value: 60.8, city: 'New York', date: '2011-10-18' },
  78. { value: 59.2, city: 'Alaska', date: '2011-10-18' },
  79. { value: 70, city: 'Austin', date: '2011-10-18' },
  80. { value: 62.1, city: 'New York', date: '2011-10-19' },
  81. { value: 58.9, city: 'Alaska', date: '2011-10-19' },
  82. { value: 61.6, city: 'Austin', date: '2011-10-19' },
  83. { value: 65.1, city: 'New York', date: '2011-10-20' },
  84. { value: 57.2, city: 'Alaska', date: '2011-10-20' },
  85. { value: 57.4, city: 'Austin', date: '2011-10-20' },
  86. { value: 55.6, city: 'New York', date: '2011-10-21' },
  87. { value: 56.4, city: 'Alaska', date: '2011-10-21' },
  88. { value: 64.3, city: 'Austin', date: '2011-10-21' },
  89. { value: 54.4, city: 'New York', date: '2011-10-22' },
  90. { value: 60.7, city: 'Alaska', date: '2011-10-22' },
  91. { value: 72.4, city: 'Austin', date: '2011-10-22' },
  92. { value: 54.4, city: 'New York', date: '2011-10-23' },
  93. { value: 65.1, city: 'Alaska', date: '2011-10-23' },
  94. { value: 72.4, city: 'Austin', date: '2011-10-23' },
  95. { value: 54.8, city: 'New York', date: '2011-10-24' },
  96. { value: 60.9, city: 'Alaska', date: '2011-10-24' },
  97. { value: 72.5, city: 'Austin', date: '2011-10-24' },
  98. { value: 57.9, city: 'New York', date: '2011-10-25' },
  99. { value: 56.1, city: 'Alaska', date: '2011-10-25' },
  100. { value: 72.7, city: 'Austin', date: '2011-10-25' },
  101. { value: 54.6, city: 'New York', date: '2011-10-26' },
  102. { value: 54.6, city: 'Alaska', date: '2011-10-26' },
  103. { value: 73.4, city: 'Austin', date: '2011-10-26' },
  104. { value: 54.4, city: 'New York', date: '2011-10-27' },
  105. { value: 56.1, city: 'Alaska', date: '2011-10-27' },
  106. { value: 70.7, city: 'Austin', date: '2011-10-27' },
  107. { value: 42.5, city: 'New York', date: '2011-10-28' },
  108. { value: 58.1, city: 'Alaska', date: '2011-10-28' },
  109. { value: 56.8, city: 'Austin', date: '2011-10-28' },
  110. { value: 40.9, city: 'New York', date: '2011-10-29' },
  111. { value: 57.5, city: 'Alaska', date: '2011-10-29' },
  112. { value: 51, city: 'Austin', date: '2011-10-29' },
  113. { value: 38.6, city: 'New York', date: '2011-10-30' },
  114. { value: 57.7, city: 'Alaska', date: '2011-10-30' },
  115. { value: 54.9, city: 'Austin', date: '2011-10-30' },
  116. { value: 44.2, city: 'New York', date: '2011-10-31' },
  117. { value: 55.1, city: 'Alaska', date: '2011-10-31' },
  118. { value: 58.8, city: 'Austin', date: '2011-10-31' },
  119. { value: 49.6, city: 'New York', date: '2011-11-01' },
  120. { value: 57.9, city: 'Alaska', date: '2011-11-01' },
  121. { value: 62.6, city: 'Austin', date: '2011-11-01' },
  122. { value: 47.2, city: 'New York', date: '2011-11-02' },
  123. { value: 64.6, city: 'Alaska', date: '2011-11-02' },
  124. { value: 71, city: 'Austin', date: '2011-11-02' }
  125. ]
  126. }
  127. }
  128. }
  129. </script>

安装 - 图14 Show code

层叠柱状图

安装 - 图15

  1. <template>
  2. <div>
  3. <v-chart ref="demo" :data="data">
  4. <v-scale x field="月份" />
  5. <v-scale y field="月均降雨量" />
  6. <v-bar series-field="name" adjust="stack" />
  7. <v-tooltip show-value-in-legend />
  8. </v-chart>
  9. <x-button type="primary" plain @click.native="$refs.demo.rerender()">rerender</x-button>
  10. </div>
  11. </template>
  12. <script>
  13. import { VChart, VLine, VArea, VTooltip, VLegend, VBar, XButton, VScale } from 'vux'
  14. export default {
  15. components: {
  16. VChart,
  17. VLine,
  18. VArea,
  19. VTooltip,
  20. VLegend,
  21. VBar,
  22. XButton,
  23. VScale
  24. },
  25. data () {
  26. return {
  27. data: [
  28. { name: 'London', 月份: 'Jan.', 月均降雨量: 18.9 },
  29. { name: 'London', 月份: 'Feb.', 月均降雨量: 28.8 },
  30. { name: 'London', 月份: 'Mar.', 月均降雨量: 39.3 },
  31. { name: 'London', 月份: 'Apr.', 月均降雨量: 81.4 },
  32. { name: 'London', 月份: 'May.', 月均降雨量: 47 },
  33. { name: 'London', 月份: 'Jun.', 月均降雨量: 20.3 },
  34. { name: 'London', 月份: 'Jul.', 月均降雨量: 24 },
  35. { name: 'London', 月份: 'Aug.', 月均降雨量: 35.6 },
  36. { name: 'Berlin', 月份: 'Jan.', 月均降雨量: 12.4 },
  37. { name: 'Berlin', 月份: 'Feb.', 月均降雨量: 23.2 },
  38. { name: 'Berlin', 月份: 'Mar.', 月均降雨量: 34.5 },
  39. { name: 'Berlin', 月份: 'Apr.', 月均降雨量: 99.7 },
  40. { name: 'Berlin', 月份: 'May.', 月均降雨量: 52.6 },
  41. { name: 'Berlin', 月份: 'Jun.', 月均降雨量: 35.5 },
  42. { name: 'Berlin', 月份: 'Jul.', 月均降雨量: 37.4 },
  43. { name: 'Berlin', 月份: 'Aug.', 月均降雨量: 42.4 }
  44. ]
  45. }
  46. }
  47. }
  48. </script>

安装 - 图16 Show code

分组柱状图

安装 - 图17

  1. <template>
  2. <div>
  3. <v-chart
  4. ref="demo"
  5. :data="data">
  6. <v-scale x field="月份" />
  7. <v-scale y field="月均降雨量" />
  8. <v-bar series-field="name" :adjust="{
  9. type: 'dodge',
  10. marginRatio: 0.05 // 设置分组间柱子的间距
  11. }" />
  12. <v-tooltip show-value-in-legend />
  13. </v-chart>
  14. <x-button type="primary" plain @click.native="$refs.demo.rerender()">rerender</x-button>
  15. </div>
  16. </template>
  17. <script>
  18. import { VChart, VLine, VArea, VTooltip, VLegend, VBar, XButton, VScale } from 'vux'
  19. export default {
  20. components: {
  21. VChart,
  22. VLine,
  23. VArea,
  24. VTooltip,
  25. VLegend,
  26. VBar,
  27. XButton,
  28. VScale
  29. },
  30. data () {
  31. return {
  32. data: [
  33. { name: 'London', 月份: 'Jan.', 月均降雨量: 18.9 },
  34. { name: 'London', 月份: 'Feb.', 月均降雨量: 28.8 },
  35. { name: 'London', 月份: 'Mar.', 月均降雨量: 39.3 },
  36. { name: 'London', 月份: 'Apr.', 月均降雨量: 81.4 },
  37. { name: 'London', 月份: 'May.', 月均降雨量: 47 },
  38. { name: 'London', 月份: 'Jun.', 月均降雨量: 20.3 },
  39. { name: 'London', 月份: 'Jul.', 月均降雨量: 24 },
  40. { name: 'London', 月份: 'Aug.', 月均降雨量: 35.6 },
  41. { name: 'Berlin', 月份: 'Jan.', 月均降雨量: 12.4 },
  42. { name: 'Berlin', 月份: 'Feb.', 月均降雨量: 23.2 },
  43. { name: 'Berlin', 月份: 'Mar.', 月均降雨量: 34.5 },
  44. { name: 'Berlin', 月份: 'Apr.', 月均降雨量: 99.7 },
  45. { name: 'Berlin', 月份: 'May.', 月均降雨量: 52.6 },
  46. { name: 'Berlin', 月份: 'Jun.', 月均降雨量: 35.5 },
  47. { name: 'Berlin', 月份: 'Jul.', 月均降雨量: 37.4 },
  48. { name: 'Berlin', 月份: 'Aug.', 月均降雨量: 42.4 }
  49. ]
  50. }
  51. }
  52. }
  53. </script>

安装 - 图18 Show code

百分比柱状图

安装 - 图19