mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
27 lines
No EOL
697 B
PHP
27 lines
No EOL
697 B
PHP
<div id="chart" @if (isset($style))style="{{ $style }}" @endif></div>
|
|
|
|
<script>
|
|
const config = {!! $jsonConfig !!};
|
|
|
|
chart = document.getElementById('chart');
|
|
chart.innerHTML = '';
|
|
|
|
canvas = document.createElement('canvas');
|
|
canvas.id = 'myChart';
|
|
chart.appendChild(canvas);
|
|
|
|
@if (isset($withDataLabel) && $withDataLabel)
|
|
config.plugins = [ChartDataLabels];
|
|
@endif
|
|
|
|
@if (isset($showLabel) && $showLabel)
|
|
config.options.plugins.datalabels.formatter = function(value, context) {
|
|
return value + ' ' + context.dataset.label;
|
|
}
|
|
@endif
|
|
|
|
new Chart(
|
|
document.getElementById('myChart'),
|
|
config
|
|
);
|
|
</script> |