forked from coroo/nova-chartjs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDoughnutChart.php
More file actions
76 lines (61 loc) · 1.73 KB
/
Copy pathDoughnutChart.php
File metadata and controls
76 lines (61 loc) · 1.73 KB
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
68
69
70
71
72
73
74
75
76
<?php
namespace Coroowicaksono\ChartJsIntegration;
use Laravel\Nova\Card;
class DoughnutChart extends Card
{
/**
* The width of the card (1/3, 1/2, or full).
*
* @var string
*/
public $width = 'full';
public function __construct($component = null)
{
parent::__construct($component);
}
/**
* Get the component name for the element.
*
* @return string
*/
public function component()
{
return 'doughnut-chart';
}
public function series(array $series): self
{
return $this->withMeta(['series' => $series]);
}
public function type(string $type): self
{
return $this->withMeta(['type' => $type]);
}
public function options(array $options): self
{
return $this->withMeta(['options' => (object) $options]);
}
public function animations(array $animations): self
{
return $this->withMeta(['animations' => $animations]);
}
public function title(string $title): self
{
return $this->withMeta(['title' => $title]);
}
public function model(string $model): self
{
return $this->withMeta(['model' => $model]);
}
public function col_xaxis(string $col_xaxis): self
{
return $this->withMeta(['col_xaxis' => $col_xaxis]);
}
public function uriKey(string $uriKey)
{
return $this->withMeta(['uriKey' => $uriKey]);
}
public function join(string $joinTable, string $joinColumnFirst, string $joinEqual, string $joinColumnSecond): self
{
return $this->withMeta(['join' => ['joinTable' => $joinTable, 'joinColumnFirst' => $joinColumnFirst, 'joinEqual' => $joinEqual, 'joinColumnSecond' => $joinColumnSecond]]);
}
}