<template>
<div class="map">
<div ref="chart" style="width: 500; height: 400px;"></div>
<div ref="chart1" style="width: 500; height: 400px;"></div>
</div>
</template>
<script>
import * as echarts from 'echarts';
export default {
name:"report",
methods: {
initChart(container, option) {
const myChart = echarts.init(container);
myChart.setOption(option);
}
},
mounted() {
let option = {
title: {
text: 'ECharts 入门示例'
},
tooltip: {},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}]
}
this.initChart(this.$refs.chart, option)
let option1 = {
tooltip: {},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line'
}]
}
this.initChart(this.$refs.chart1, option1)
},
created() {
const _this = this
this.axios.get("http://localhost:8089/threeproject/ConsultationmodeStatistics")
.then(function(response) {
_this.ConsultationmodeData = response.data
}).catch(function(error) {
console.log(error)
})
}
};
</script>
我该如何将虚数据替换成数据库mysql数据