radars.vue 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <script setup lang="ts">
  2. import * as echarts from 'echarts'
  3. const props = defineProps<{
  4. ecahrtsData: object
  5. }>()
  6. const chartRef = ref()
  7. onMounted(() => {
  8. echarts.init(chartRef.value).setOption({
  9. title: {
  10. text: props.ecahrtsData.title_text,
  11. textStyle: {
  12. color: '#fff',
  13. },
  14. },
  15. tooltip: {
  16. trigger: 'item',
  17. confine: true,
  18. },
  19. legend: {
  20. date: props.ecahrtsData.legend_date,
  21. top: '7%',
  22. right: '5%',
  23. textStyle: {
  24. color: '#ccc',
  25. },
  26. },
  27. // grid: {
  28. // top: '30%',
  29. // bottom: '0%',
  30. // },
  31. color: ['#11a597', '#ff8366', '#eff410'],
  32. radar: {
  33. // shape: 'circle',
  34. indicator: props.ecahrtsData.radar_indicator,
  35. center: ['50%', '57%'],
  36. radius: '70%',
  37. },
  38. series: props.ecahrtsData.series,
  39. })
  40. })
  41. </script>
  42. <template>
  43. <div ref="chartRef" class="w-full h-full " />
  44. </template>