<template>
<div id="main">F</div>
</template>
<script>
import echarts from '../assets/echarts.min'
export default {
mounted() {
var mychart = echarts.init(document.getElementById('main'));
var option = {
title: {
text: 'World Population'
},
tooltip: {
trigger: 'axis',
axisPointer: { //坐标轴指针
type: 'shadow'
}
},
legend: {},
grid: { //网格布局
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
yAxis: {
type: 'category',
data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
},
series: [
{
name: '2011',
type: 'bar',
data: [18203, 23489, 29034, 104970, 131744, 630230]
}
]
};
mychart.setOption(option)
}
}
</script>
<style>
#main{
width: 1000px;
height: 600px;
}
</style>
bar(条形图)
最新推荐文章于 2024-09-05 11:00:53 发布