grid.left | string, numberapi
[ default: '10%' ]string
grid 组件离容器左侧的距离。io
left 的值能够是像 20 这样的具体像素值,能够是像 '20%' 这样相对于容器高宽的百分比,也能够是 'left', 'center', 'right'。class
若是 left 的值为'left', 'center', 'right',组件会根据相应的位置自动对齐。容器
grid.top | string, numbergrid
[ default: 60 ]自适应
grid 组件离容器上侧的距离。图表
top 的值能够是像 20 这样的具体像素值,能够是像 '20%' 这样相对于容器高宽的百分比,也能够是 'top', 'middle', 'bottom'。项目
若是 top 的值为'top', 'middle', 'bottom',组件会根据相应的位置自动对齐。top
grid.right | string, number
[ default: '10%' ]
grid 组件离容器右侧的距离。
right 的值能够是像 20 这样的具体像素值,能够是像 '20%' 这样相对于容器高宽的百分比。
grid.bottom | string, number
[ default: 60 ]
grid 组件离容器下侧的距离。
bottom 的值能够是像 20 这样的具体像素值,能够是像 '20%' 这样相对于容器高宽的百分比。
grid.width | string, number
[ default: 'auto' ]
grid 组件的宽度。默认自适应。
grid.height | string, number
[ default: 'auto' ]
grid 组件的高度。默认自适应。
以上来自官方api
项目实例:
grid: { left: '3%', right: '3%', bottom: '5%',// 这几个属性能够控制图表上下左右的空白尺寸,能够本身试试。 containLabel: true }, dataZoom: dataZooms,//滚动条的实现