-
Notifications
You must be signed in to change notification settings - Fork 81
/
script.blade.php
49 lines (47 loc) · 1.5 KB
/
script.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<script>
var options =
{
chart: {
type: '{!! $chart->type() !!}',
height: {!! $chart->height() !!},
width: '{!! $chart->width() !!}',
toolbar: {!! $chart->toolbar() !!},
zoom: {!! $chart->zoom() !!},
fontFamily: '{!! $chart->fontFamily() !!}',
foreColor: '{!! $chart->foreColor() !!}',
sparkline: {!! $chart->sparkline() !!},
@if($chart->stacked())
stacked: {!! $chart->stacked() !!},
@endif
},
plotOptions: {
bar: {!! $chart->horizontal() !!}
},
colors: {!! $chart->colors() !!},
series: {!! $chart->dataset() !!},
dataLabels: {!! $chart->dataLabels() !!},
@if($chart->labels())
labels: {!! json_encode($chart->labels(), true) !!},
@endif
title: {
text: "{!! $chart->title() !!}"
},
subtitle: {
text: '{!! $chart->subtitle() !!}',
align: '{!! $chart->subtitlePosition() !!}'
},
xaxis: {
categories: {!! $chart->xAxis() !!}
},
grid: {!! $chart->grid() !!},
markers: {!! $chart->markers() !!},
@if($chart->stroke())
stroke: {!! $chart->stroke() !!},
@endif
legend: {
show: {!! $chart->showLegend() !!}
}
}
var chart = new ApexCharts(document.querySelector("#{!! $chart->id() !!}"), options);
chart.render();
</script>