gpt4 book ai didi

highcharts - Highchart - 如何在半圆饼图中创建附加的图像仪表

转载 作者:行者123 更新时间:2023-12-04 16:12:10 28 4
gpt4 key购买 nike

带三角规的半圆饼

Semi Circle Pie With Triangle Gauge

如何在图表顶部创建带有三角形仪表的上述半圆饼图。

我的车速表可以工作,但不能满足需要。

在highchart api中有没有办法使用三角形作为仪表,而不是车速表?

谢谢

最佳答案

这是调整后的 JSON 的 fiddle 。

https://jsfiddle.net/mschreiberjdi/nwb7vL62/

$(function() {
$('#container').highcharts({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: '40%<br>Probability Of <br>Success',
align: 'center',
verticalAlign: 'bottom',
y: -145
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
pane: {
center: ['50%', '75%'],
size: '50%',
startAngle: -90,
endAngle: 90,
background: {
borderWidth: 0,
backgroundColor: 'none',
innerRadius: '60%',
outerRadius: '100%',
shape: 'arc'
}
},
yAxis: [{
lineWidth: 0,
min: 0,
max: 90,
minorTickLength: 0,
tickLength: 0,
tickWidth: 0,
labels: {
enabled: false
},
title: {
text: '', //'<div class="gaugeFooter">46% Rate</div>',
useHTML: true,
y: 80
},
/*plotBands: [{
from: 0,
to: 46,
color: 'pink',
innerRadius: '100%',
outerRadius: '0%'
},{
from: 46,
to: 90,
color: 'tan',
innerRadius: '100%',
outerRadius: '0%'
}],*/
pane: 0,

}],
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
},
gauge: {
dataLabels: {
enabled: false
},
pivot: {
radius: 80,
borderWidth: 2,
borderColor: 'transparent',
backgroundColor: 'white'
},
dial: {
radius: '100%',
backgroundColor: 'gray',
borderColor: 'gray',
baseWidth: 140,
topWidth: 1,
baseLength: '10%', // of radius
rearLength: '10%'
}
}
},

series: [{
type: 'pie',
name: 'Browser share',
innerSize: '50%',
data: [
['Low', 25],
['Medium', 25],
['HIgh', 25]
]
}, {
type: 'gauge',
data: [40],
dial: {
rearLength: 0
}
}],
});
});

关于highcharts - Highchart - 如何在半圆饼图中创建附加的图像仪表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38722989/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com