1
我有一個問題,請給我一些建議嗎?我想將piechart 2d轉換爲3d。請幫助我。請給我一些想法。 chek鏈接。 這是遵循鏈接是this is follow link is demo this is image of piechart如何將2D轉換爲3D餅圖?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script>
$(function() {
var colors = Highcharts.getOptions().colors,
categories = ['Opp', 'Guess','Thre'],
data = [ {
y: 10.38,
color: colors[2],
drilldown: {
name: 'Firefox versions',
categories: ['Streanth'],
data: [70],
color: colors[2]
}
},
{
y: 5.38,
color: colors[2],
drilldown: {
name: 'Firefox versions',
categories: ['Streanth'],
data: [70],
color: colors[2]
}
},
{
y: 10.03,
color: colors[1],
drilldown: {
name: 'Chrome versions',
categories: ['Weakness'
],
data: [30],
color: colors[1]
}
}],
browserData = [],
versionsData = [],
i,
j,
dataLen = data.length,
drillDataLen,
brightness;
// Build the data arrays
for (i = 0; i < dataLen; i += 1) {
// add browser data
browserData.push({
name: categories[i],
y: data[i].y,
color: data[i].color
});
// add version data
drillDataLen = data[i].drilldown.data.length;
for (j = 0; j < drillDataLen; j += 1) {
brightness = 0.2 - (j/drillDataLen)/5;
versionsData.push({
name: data[i].drilldown.categories[j],
y: data[i].drilldown.data[j],
color: Highcharts.Color(data[i].color).brighten(brightness).get()
});
}
}
// Create the chart
$('#container').highcharts({
chart: {
type: 'pie'
},
title: {
text: 'Browser market share, January, 2015 to May, 2015'
},
subtitle: {
text: 'Source: <a href="http://netmarketshare.com/">netmarketshare.com</a>'
},
yAxis: {
title: {
text: 'Total percent market share'
}
},
plotOptions: {
pie: {
shadow: false,
center: ['50%', '50%']
}
},
tooltip: {
valueSuffix: '%'
},
series: [{
name: 'Browsers',
data: browserData,
size: '60%',
dataLabels: {
formatter: function() {
return this.y > 5 ? this.point.name : null;
},
color: '#ffffff',
distance: -30
}
}, {
name: 'Versions',
data: versionsData,
size: '80%',
innerSize: '60%',
dataLabels: {
formatter: function() {
// display only if larger than 1
return this.y > 1 ? '<b>' + this.point.name + ':</b> ' + this.y + '%' : null;
}
}
}]
});
});
</script>
這是HTML代碼
<div id="container" style="width: 600px; height: 400px; margin: 0 auto"></div>
我建議閱讀以下內容:http://www.highcharts.com/docs/chart-concepts/3d-charts –