它似乎是选项startOnTick,endOnTick对boxplot没有影响.无论如何使用箱线图将最外面的刻度线对齐到图形边缘?
xAxis: {
startOnTick: true,
endOnTick: true,
min: -1,
max: 6,
},
Run Code Online (Sandbox Code Playgroud)
我尝试添加minPadding/maxPadding,tickmarkPlacement的大多数组合:在/之间,并且用tickPositioner手动设置滴答,没有任何运气.我唯一的解决方法是缩小min/max,以便padding自行修复.我更喜欢更好的解决方案,因为这种解决方法对于动态数据变得非常难看.
调查这个导致我将这些评论隐藏在部分/ Axis.js中.
if (!axis.single) {
// minPointOffset is the value padding to the left of
// the axis in order to make room for points with a
// pointRange, typically columns. When the
// pointPlacement option is 'between' or 'on', this
// padding does not apply.
minPointOffset = Math.max(
minPointOffset,
isString(pointPlacement) ? 0 : seriesPointRange / 2
);
// Determine the total padding needed to the length of
// the axis to make room for the pointRange. If the
// series' pointPlacement is 'on', no padding is added.
pointRangePadding = Math.max(
pointRangePadding,
pointPlacement === 'on' ? 0 : seriesPointRange
);
}
Run Code Online (Sandbox Code Playgroud)
问题是由点填充引起的,可能出现在任何列样式图上.如果在系列中pointPlacement设置'on'或填充,则将忽略填充'between'.
series: {
type: 'boxplot',
pointPlacement: 'on',
data: ...
}
Run Code Online (Sandbox Code Playgroud)
这是工作小提琴.