SPP CT: Chart Donut
by Jens Kühn
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 250px; height: 350px; margin: 0 auto"></div>
JavaScript
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: '<b>Strompreis</b><br/><span style="line-height: 28px">für KWK-Strom</span><br/><span style="font-size: 28px; font-weight: bold;line-height:14px">20,23</span><br/>ct/kWh',
verticalAlign: 'top',
floating: true,
x: 0,
y: 120,
style:{ fontSize: '12px'}
},
tooltip: {
pointFormat: '<b>{point.y}</b>',
valueDecimals: 2,
valueSuffix: ' ct/kWh'
},
navigation: {
buttonOptions: {
enabled: false
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
innerSize: 120,
animation: false,
shadow: false,
dataLabels: {
enabled: true,
color: '#000000',
connectorColor: '#000000',
connectorWidth: 0.5,
connectorPadding: 15,
softConnector: false,
padding: 5,
distance: 15,
formatter: function() {
return '<b>'+ this.point.name +'</b><br/>'+ this.point.y +' ct/kWh';
}
},
showInLegend: true
}
},
series: [{
type: 'pie',
name:...