$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'emmisions2015',
type: 'pie'
},
title: {
text: ''
},
plotOptions: {
pie: {
innerSize: '60%'
}
},
series: [{
data: [
['Direct Emissions', 5],
['Purchased Electricity', 15],
['Transport', 40]
]}]
},
// using
function(chart) { // on complete
var xpos = '50%';
var ypos = '53%';
var circleradius = 102;
// Render the circle
chart.renderer.circle(xpos, ypos, circleradius).attr({
fill: '#fff',
}).add();
// Render the text
chart.renderer.text('2015', 370, 225).css({
width: circleradius*2,
color: '#87868a',
fontSize: '23px',
textAlign: 'center'
}).attr({
// why doesn't zIndex get the text in front of the chart?
zIndex: 999
}).add();
});
});
我们有这段代码可以生成de图,但它不会采用我们想要的自定义颜色。换句话说,我们尝试添加我们的自定义颜色代码,但似乎并没有采用它们。 TIA为您提供帮助/想法。
非常感谢最后我们管理! – Bastcri