stackLine.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script setup lang="ts">
  2. import * as echarts from 'echarts'
  3. const chartRef = ref()
  4. onMounted(() => {
  5. echarts.init(chartRef.value).setOption({
  6. tooltip: {
  7. trigger: 'axis'
  8. },
  9. legend: {
  10. data: ['自主教学', '结对双师', '名师直播']
  11. },
  12. grid: {
  13. left: '3%',
  14. right: '4%',
  15. bottom: '3%',
  16. containLabel: true
  17. },
  18. xAxis: {
  19. type: 'category',
  20. boundaryGap: false,
  21. data: ['2022年1月', '2022年3月', '2022年5月','2022年7月', '2022年9月',
  22. '2022年11月','2023年1月', '2023年3月']
  23. },
  24. yAxis: {
  25. type: 'value'
  26. },
  27. series: [
  28. {
  29. name: '自主教学',
  30. type: 'line',
  31. stack: 'Total',
  32. data: [220, 182, 191, 234, 290, 330, 310, 330,],
  33. smooth: true
  34. },
  35. {
  36. name: '结对双师',
  37. type: 'line',
  38. stack: 'Total',
  39. data: [150, 232, 201, 154, 190, 330, 410, 330,],
  40. smooth: true
  41. },
  42. {
  43. name: '名师直播',
  44. type: 'line',
  45. stack: 'Total',
  46. data: [320, 332, 301, 334, 390, 330, 320, 330,],
  47. smooth: true
  48. }
  49. ]
  50. })
  51. })
  52. </script>
  53. <template>
  54. <div ref="chartRef" class="w-full h-full " />
  55. </template>