HeimaPage.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <script setup lang="ts">
  2. import * as echarts from 'echarts';
  3. import { nextTick, onMounted } from 'vue';
  4. const echartsRander = () => {
  5. var chartDom = document.getElementById('chartsId');
  6. var myChart = echarts.init(chartDom);
  7. var option;
  8. option = {
  9. title: {
  10. text: '4.大模型复盘及话术建议',
  11. left: 'center',
  12. // top: '53%',
  13. padding: [15, 0],
  14. textStyle: {
  15. color: '#000',
  16. fontSize: 14,
  17. fontWeight: '400',
  18. align: 'center',
  19. }
  20. },
  21. tooltip: {
  22. trigger: 'item'
  23. },
  24. series: [
  25. {
  26. name: '评分标准',
  27. type: 'pie',
  28. radius: ['30%', '45%'],
  29. center: ['50%', '60%'],
  30. avoidLabelOverlap: false,
  31. label: {
  32. fontSize: 6,
  33. },
  34. labelLine: {
  35. show: true, // 显示引导线
  36. length: 10,
  37. length2: 6,
  38. },
  39. emphasis: {
  40. itemStyle: {
  41. shadowBlur: 10,
  42. shadowOffsetX: 0,
  43. shadowColor: 'rgba(0, 0, 0, 0.5)'
  44. }
  45. },
  46. data: [
  47. { value: 20, name: '自我介绍' },
  48. { value: 18, name: '画像采集' },
  49. { value: 15, name: '需求挖掘' },
  50. { value: 20, name: '沟通转化' },
  51. ]
  52. }
  53. ],
  54. };
  55. option && myChart.setOption(option);
  56. window.addEventListener('resize', function () {
  57. myChart.resize();
  58. });
  59. }
  60. onMounted(() => {
  61. nextTick(() => {
  62. echartsRander()
  63. })
  64. })
  65. </script>
  66. <template>
  67. <div ref="chartDom" id="chartsId" style="width: 100%; height: 100%;"></div>
  68. </template>