은 다음과 같습니다Highcharts 게이지 스타일과 추가 CSS 요소
을 현재, 나는 다음과 같은 모델 작업이 있습니다
을 (하시기 바랍니다
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'gauge'
},
title: {
text: 'Hydration Index'
},
pane: {
startAngle: -140,
endAngle: 140,
size: 200,
background: {
backgroundColor: {
linearGradient: [0, 300, 300, 300],
stops: [
[0, 'rgb(152, 230, 230)'],
[1, 'rgb(0, 0, 10)']
]
},
innerRadius: '70%',
outerRadius: '100%',
shape: 'arc',
}
},
yAxis: {
reversed: true,
min: 0,
max: 100,
plotBands: [{ // mark the weekend
}],
tickInterval: 600
},
plotOptions: {
gauge: {
dataLabels: {
enabled: false
},
dial: {
radius: '100%',
backgroundColor: 'black',
borderColor: 'white',
borderWidth: 0.5,
rearLength: 0,
baseWidth: 10,
topWidth: 1,
baseLength: '0%'
},
pivot: {
radius: 0
}
},
},
series: [{
name: 'Hydration percent',
data: [20],
}],
credits: {
enabled: false
},
});
});
) 가장 업데이트 된 코드의 바이올린 참조
1) 곡선의 가장자리를 계기의 한쪽면에만 어떻게 추가합니까?
2) 바늘 방향을 시계 방향에서 반 시계 방향으로 바꿀 수 있습니까? 그래프가 작동하는 방식으로 작동하도록 yaxis를 역전 시켰지만 카운터 직관적으로 높은 곳에서 시작하여 이후부터 진행합니다 (따라서 차트가 0-100에서 내 데이터 값이 10이면 시작됩니다. 100에서 10으로 이동).
3) 마지막으로, 결과에 따라 변경되는 동적 텍스트를 추가 할 수있는 방법이 있습니까? 이 렌더러는 Axis.getPlotBandPath
방법을 modyfying가되기 전에 당신이 SVG의 경로를 수정할 수 있습니다 -