Asset_Tile_Boolean
by Steve Thompson
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: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
colors: ['#4c4c4c', '#acacac'],
credits: {
enabled: false
},
exporting: {
enabled: false
},
title: {
text: chartTitle,
align: 'center',
style: {
color: '#333333',
fontSize: '28px',
fontWeight: 'normal'
},
verticalAlign: 'middle',
y: 0
},
tooltip: {
backgroundColor: 'rgba(52, 56, 59, 1)',
pointFormat: '<span style="color: white;"><b>{point.y}</b></span>',
headerFormat: '',
style: {
color: 'white'
}
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -100,
style: {
fontWeight: 'bold',
color: 'black'
}
},
startAngle: -90,
endAngle: 90
}
},
series: [{
type: 'pie',
innerSize: '50%',
data: [
{
dataLabels: {
},
name: 'y',
y: 560
},
{
name: 'n',
y: 201
}
]
}]
});
var chart = $('#container').highcharts();
var y = chart.series[0].data;
var n = chart.series[1].data;
var value = y / (y+n);
var chartTitle = value + '%';
});