
echart设置边距是使用grid
//设置图标边距
grid: {
top: '10%',
left: '3%',
right: '3%',
bottom: '6%',
containLabel: true
}
官方文档:
https://echarts.apache.org/zh/option.html#grid
在整体当中的位置
mounted() {
this.testChart()
},
// 组件方法
methods: {
testChart() {
// 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById('labroom-trend-chart'))
let option = {
// title: {
// text: '学习时长趋势(日时长)',
// textAlign: 'left',
// left: '27px',
// top: 10,
// textStyle: {
// fontSize: '16px',
// fontFamily: 'Microsoft YaHei'
// }
// },
//****************设置图标边距**************
grid: {
top: '10%',
left: '3%',
right: '3%',
bottom: '6%',
containLabel: true
},
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'
}
]
};
myChart.setOption(option);
}
}
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)
评价
排名
8
文章
243
粉丝
7
评论
7
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术