I have created a chart with highcharts where I need to know the percentage of financial input and output.
<div id="container" style="min-width: 410px; height: 500px; max-width: 600px; margin: 0 auto; margin-top: 25px"></div>
<script>
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Gastos Periodo - <?php echo $periodoEntrada . ' - ' . $periodoSaida?>'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
series: [{
colorByPoint: true,
data: [{
name: 'Entradas',
y: <?php echo str_replace(",", ".", $entrada);?>,
}, {
name: 'Saidas',
y: <?php echo str_replace(",", ".", $saida);?>,
}]
}]
});
</script>
How do I go where Series is?
Entrada
- Porcentagem - 93%
- Valor - 500,00