<template>
<!-- 为 ECharts 准备一个具备大小(宽高)的 DOM -->
<div id="chartLine" class="line-wrap"></div>
</template>
<script>
import * as echarts from "echarts";
require("echarts/theme/shine"); //引入主题
export default {
data() {
return {
chartLine: null,
};
},
mounted() {
this.$nextTick(() => {
this.drawLineChart();
});
},
methods: {
drawLineChart() {
// 基于准备好的dom,初始化echarts实例
this.chartLine = echarts.init(this.$el, "shine");
let option = {
tooltip: {
//触发类型,'axis'坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
trigger: "axis",
},
legend: {
data: ["工资收入", "奖金收入"],
},
calculable: true,
xAxis: {
type: "category",
boundaryGap: false,
axisLabel: {
双y轴组件echarts
最新推荐文章于 2024-06-05 09:44:46 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)