HTML部分
<div id="state" :style="{width: '550px', height: '250px'}"></div>
js部分
mounted() {
this.active();
},
methods:{
active() {
let myChart = this.$echarts.init(document.getElementById("state"));
myChart.setOption({
// 全局字体样式
textStyle: {
color: "#4081DC"
},
// hover
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
label: {
backgroundColor: "#6a7985"
}
}
},
legend: {
data: ["交易金额", "总交易金额"],
show: true,
textStyle: {
color: "#fft" //fft可同色
},
left: "50px",
top