1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <echarts :option="opt" :loading="loading"></echarts>
- </template>
-
- <script>
- export default {
- name: 'LineChart',
- components: {
- echarts: () => import('./index.vue')
- },
- props: {
- option: {
- type: Object,
- default: () => ({})
- },
- value: {
- type: Array,
- default: () => []
- },
- loading: Boolean
- },
- computed: {
- opt() {
- return {
- xAxis: {
- type: 'category',
- },
- yAxis: {
- type: 'value'
- },
- tooltip: {
- trigger: 'axis'
- },
- dataset: {
- dimensions: ['key', 'value'],
- source: this.value,
- },
- series: [
- {
- type: 'line',
- smooth: true
- }
- ],
- ...this.option,
- }
- }
- },
- data() {
- return {
- }
- }
- }
- </script>
|