柱形范围图给的两个值相同,表中不显示
lgwResources opened this issue · comments
你好,我想问下柱形范围图给的最大最小值一样,在表中能显示出图来么
使用 JavaScript 配置 Highcharts:
Highcharts.chart('container', {
chart: {
type: 'columnrange',
inverted: true
},
title: {
text: 'Temperature variation by month'
},
subtitle: {
text: 'Observed in Vik i Sogn, Norway, 2021 | ' +
'Source: <a href="https://www.vikjavev.no/ver/" target="_blank">Vikjavev</a>'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
title: {
text: 'Temperature ( °C )'
}
},
tooltip: {
valueSuffix: '°C'
},
plotOptions: {
columnrange: {
borderRadius: '50%',
dataLabels: {
enabled: true,
format: '{y}°C'
}
},
series: {
minPointLength: 3
}
},
legend: {
enabled: false
},
series: [{
name: 'Temperatures',
data: [
[-13.9, 5.2],
[-16.7, 10.6],
[0, 0],
[-4.4, 16.8],
[-2.1, 27.2],
[5.9, 29.4],
[6.5, 29.1],
[4.7, 25.4],
[4.3, 21.6],
[-3.5, 15.1],
[-9.8, 12.5],
[-11.5, 8.4]
]
}]
});
由图中显示的内容可以看出: 值为 [0, 0],
的地方, 仍有宽度为 3
的棱柱, 其中起作用的关键内容为:
plotOptions: {
...
...
series: {
minPointLength: 3 //柱状图, 条形图, 柱形范围图, 瀑布图, 箱线图(盒须图)直接设置单个图形元素的最小高度
}
},
你可以在这个在线编辑工具中测试此示例代码:
关键属性 minPointLength
请参考在线文档:
我用的AAChartKit-Pro ,因为需要用到AAChartTypeXrange,但是这里好像没有这个属性
我按照AAChartKitLib库中的AASeries和AAColumn中添加了minPointLength属性 可以显示出来了