当max设置为非常大的数字(例如666772)时,会发生此问题。Highcharts将采用该数字并将其四舍五入,具体取决于tickPixelInterval设置为什么。
如果将tickPixelInterval值设置为更接近0,则“量表”图表上的最大数字开始接近666772,但仍取整。我想min从0开始(确实如此),然后再使它max成为确切的数字(666772),甚至是四舍五入的版本(667k)。
有没有一种方法可以仅使用仪表图上的min和来执行此操作max?
var gaugeOptions = {
chart: {
type: 'solidgauge'
},
title: null,
pane: {
center: ['50%', '85%'],
size: '140%',
startAngle: -90,
endAngle: 90,
background: {
backgroundColor: '#EEE',
innerRadius: '60%',
outerRadius: '100%',
shape: 'arc'
}
},
// the value axis
yAxis: {
stops: [
[0.1, '#DF5353'], // green
[0.5, '#DDDF0D'], // yellow
[0.9, 'green'] // red
],
lineWidth: 0,
minorTickInterval: null,
tickPixelInterval: 400,
tickWidth: 0, …Run Code Online (Sandbox Code Playgroud) 我希望设定一个最小值和最大值(0-200)并将量程线限制在200.数据可能超过200,但是压力表上的线仍然需要限制在200.
有没有参数可以做到这一点?
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'Speedometer'
},
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%' …Run Code Online (Sandbox Code Playgroud)