22 lines
918 B
PHP
22 lines
918 B
PHP
<canvas id="{!! $element !!}" width="{!! $size['width'] !!}" height="{!! $size['height'] !!}">
|
|
<script nonce="{{$nonce}}">
|
|
document.addEventListener("DOMContentLoaded", function(event) {
|
|
(function() {
|
|
"use strict";
|
|
var ctx = document.getElementById("{!! $element !!}");
|
|
window.{!! $element !!} = new Chart(ctx, {
|
|
type: '{!! $type !!}',
|
|
data: {
|
|
labels: {!! json_encode($labels) !!},
|
|
datasets: {!! json_encode($datasets) !!}
|
|
},
|
|
@if(!empty($optionsRaw))
|
|
options: {!! $optionsRaw !!}
|
|
@elseif(!empty($options))
|
|
options: {!! json_encode($options) !!}
|
|
@endif
|
|
});
|
|
})();
|
|
});
|
|
</script>
|
|
</canvas>
|