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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script type="text/javascript">
var {{ $model->id }};
$(function () {
{{ $model->id }} = new Highcharts.Chart({
colors: [
@foreach($model->colors as $c)
"{{ $c }}",
@endforeach
],
chart: {
renderTo: "{{ $model->id }}",
@include('charts::_partials.dimension.js2')
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
@if($model->title)
title: {
text: "{!! $model->title !!}"
},
@endif
@if(!$model->credits)
credits: {
enabled: false
},
@endif
tooltip: {
pointFormat: '{point.y} <b>({point.percentage:.1f}%)</strong>'
},
plotOptions: {
pie: {
innerSize: '50%',
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</strong>: {point.y} ({point.percentage:.1f}%)',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
legend: {
@if(!$model->legend)
enabled: false
@endif
},
series: [{
colorByPoint: true,
data: [
@for ($l = 0; $l < count($model->values); $l++)
{
name: "{!! $model->labels[$l] !!}",
y: {{ $model->values[$l] }}
},
@endfor
]
}]
})
});
</script>
@if(!$model->customId)
@include('charts::_partials.container.div')
@endif