-3
我想創建如下面的圖像中的測量儀。 建設量表以顯示顏色的百分比值範圍
我嘗試了一些不同的Highcharts選項,但這些值看起來不正確。下面是與我使用的代碼fiddle。
$(function() {
$("#container").highcharts({
"chart": {
"height": 250,
"renderTo": "container",
"plotBackgroundColor": null,
"plotBackgroundImage": null,
"plotBorderWidth": 0,
"plotShadow": false,
"backgroundColor": "transparent"
},
"credits": {
"enabled": false
},
"tooltip": {
"enabled": false
},
"title": {
"useHtml": true,
"text": "<div style=\"font-size: 24px;\">99%</div><br><div style=\"font-size: 12px;\" \"font-size: 12px;\"></div>",
"align": "center",
"verticalAlign": "top",
"y": 100,
"useHtml": true
},
"subtitle": {
"useHtml": true,
"text": "<div style=\"font-size: 13px;\"></div>",
"align": "center",
"verticalAlign": "top",
"y": 175,
"useHtml": true
},
"pane": {
"size": "78%",
"startAngle": -140,
"endAngle": 140,
"background": {
"borderWidth": 0,
"backgroundColor": "transparent",
"innerRadius": "100%",
"outerRadius": "100%",
"shape": "arc"
}
},
"yAxis": [{
"lineWidth": 0,
"min": 0,
"max": 125,
"minorTickLength": 0,
"tickLength": 0,
"tickWidth": 0,
"labels": {
"enabled": false
},
"title": {
"text": "",
"useHTML": false,
"y": 80
},
"pane": 0
}],
"plotOptions": {
"series": {
"enableMouseTracking": false
},
"pie": {
"dataLabels": {
"enabled": true,
"distance": 0,
"style": {
"fontWeight": "bold",
"color": "white",
"textShadow": "0px 1px 2px black"
}
},
"startAngle": -140,
"endAngle": 140
},
"gauge": {
"dataLabels": {
"enabled": false
},
"pivot": {
"radius": 75,
"borderWidth": 1,
"borderColor": "transparent",
"backgroundColor": "white"
},
"dial": {
"radius": "110%",
"backgroundColor": "white",
"borderColor": "gray",
"baseWidth": 140,
"topWidth": 1,
"baseLength": "5%",
"rearLength": "5%"
}
}
},
"series": [
{
"type": "pie",
"name": "Risk",
"innerSize": "80%",
"data": [
{
"y": 99,
"name": "0-74 percent",
"color": "#FA524D"
}, {
"y": 74,
"name": "75-99 percent",
"color": "#F3D307"
}, {
"y": 10,
"name": ">99 percent",
"color": "#9DC546"
}]
},
{
"type": "gauge",
"name": "Success",
"data": [99],
"dial": {
"rearLength": 0
}
}
],
});
});
我該如何做到這樣的測量圖?