123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <script setup lang="ts">
- import * as echarts from 'echarts'
- const props = defineProps<{
- echartsData: object
- }>()
- const chartRef = ref()
- onMounted(() => {
- echarts.init(chartRef.value).setOption({
- tooltip: {
- trigger: 'item',
- },
- legend: {
- top: '1%',
- right: '5%',
- textStyle: {
- color: '#ccc',
- },
- },
- grid: {
- top: '8%',
- bottom: '80px',
- },
- color: ['#7D7CFC', '#0293FD'],
- dataset: {
- source: props.echartsData.dataset_source,
- },
- xAxis: {
- type: 'category',
- axisLine: {
- show: true,
- lineStyle: {
- type: 'dashed',
- color: '#ccc',
- },
- },
- },
- yAxis: {
- axisLine: {
- show: true,
- lineStyle: {
- type: 'dashed',
- color: '#ccc',
- },
- },
- splitLine: {
- show: true,
- lineStyle: {
- type: 'dashed',
- color: '#ccc',
- },
- },
- },
- // Declare several bar series, each will be mapped
- // to a column of dataset.source by default.
- series: [{ type: 'bar' }, { type: 'bar' }],
- })
- })
- </script>
- <template>
- <div ref="chartRef" class="w-full h-full " />
- </template>
|