#vue2引入echarts案例
<template>
<div>
<div id="main" style="width: 600px; height: 400px"></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
// name: 'MyechartsText1',
mounted() {
var myChart = echarts.init(document.getElementById('main'))
myChart.setOption({
xAxis: {
data: ['1', '2', '3', '4', '5', '6', '7'],
},
yAxis: {},
series: [
{
type: 'bar',
data: [23, 24, 18, 25, 27, 28, 25],
},
{
type: 'bar',
data: [26, 24, 18, 22, 23, 20, 27],
},
],
})
},
}
</script>
<style lang="scss" scoped></style>