我在ordert中使用Echarts
来创建一些图表。
我的问题是,当我从toolbox
更改图表类型时,新图表超出了绘图区域。我只对bar
有这个问题。
每秒使用轮询器刷新图表。
toolbox:
{
show: true,
feature:
{
magicType:
{
show: true,
title:
{
line: "Line",
bar: "Bar",
tiled: "Tiled"
},
type: ["line", "bar", "tiled"]
},
restore:
{
show: true
},
saveAsImage:
{
show: true
}
}
},
答案 0 :(得分:0)
这是因为条形图位于 x轴刻度线上,而不是位于之间。
这可能是由boundaryGap: false
引起的。
尝试将x轴设置为:
xAxis: {
boundaryGap : true,
}
如果您不希望标签位于x轴刻度之间,请使用:
xAxis: {
boundaryGap : true,
xAxisTicks : {
alignWithLabel : true
}
}