怎么才能使其显示在坐标轴里面,不要超出外面
配置项如下
option = {
title: {
text: '时间跨度图',
subtext: '数据来自网络'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: ['持续时间']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'time',
min:new Date("2015/08/22")
},
yAxis: {
type: 'category',
data: ['小明','小红','小刚','小算','小图','小美']
},
dataZoom: [
{
id: 'dataZoomX',
type: 'slider',
xAxisIndex: [0],
filterMode: 'none'
},
{
type: 'inside',
xAxisIndex: [0],
filterMode: 'none'
},
{
type: 'inside',
yAxisIndex: [0],
}
],
series: [
{
name: '开始时间',
type: 'bar',
stack:'ri',
itemStyle:{
normal:{
barBorderColor:'rgba(0,0,0,0)',
color:'rgba(0,0,0,0)'
},
emphasis:{
barBorderColor:'rgba(0,0,0,0)',
color:'rgba(0,0,0,0)'
}
},
data: ['2015-08-27', '2015-09-25', '2015-09-7', '2015-09-7','2015-09-12','2015-09-14']
},
{
name: '持续时间',
type: 'bar',
stack:'ri',
data: ['2015-09-27', '2015-10-25', '2015-10-7', '2015-10-7','2015-10-12','2015-10-14']
}
]
};