Compare commits
6 Commits
v2.3.0
...
nicko170/m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6f04ca4c3 | ||
|
|
327665919f | ||
|
|
879734fe9c | ||
|
|
6754e94cde | ||
|
|
a7364ad51c | ||
|
|
47d0f028af |
2
.github/workflows/phpunit.yml
vendored
2
.github/workflows/phpunit.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
php-version: '8.0'
|
||||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, exif, imagick, bcmath
|
||||
coverage: none
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2|^7.3|^7.4|^8.0",
|
||||
"illuminate/support": "^7.0|^8.0",
|
||||
"illuminate/support": "^7.0|^8.0|^9.0",
|
||||
"livewire/livewire": "^2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^4.0|^5.0",
|
||||
"orchestra/testbench": "^5.0|^6.0|^7.0",
|
||||
"phpunit/phpunit": "^8.0"
|
||||
},
|
||||
"autoload": {
|
||||
|
||||
12136
package-lock.json
generated
12136
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -20,13 +20,14 @@ const pieChart = () => {
|
||||
const onSliceClickEventName = component.get('pieChartModel.onSliceClickEventName')
|
||||
const data = component.get('pieChartModel.data')
|
||||
const sparkline = component.get('pieChartModel.sparkline')
|
||||
const type = component.get('pieChartModel.type')
|
||||
|
||||
const options = {
|
||||
series: data.map(item => item.value),
|
||||
|
||||
chart: {
|
||||
height: '100%',
|
||||
type: 'pie',
|
||||
type: type,
|
||||
|
||||
...sparkline,
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ class PieChartModel extends BaseChartModel
|
||||
|
||||
public $opacity;
|
||||
|
||||
public $type;
|
||||
|
||||
public $data;
|
||||
|
||||
public function __construct()
|
||||
@@ -23,6 +25,8 @@ class PieChartModel extends BaseChartModel
|
||||
|
||||
$this->opacity = 0.75;
|
||||
|
||||
$this->type = 'pie';
|
||||
|
||||
$this->data = collect();
|
||||
}
|
||||
|
||||
@@ -33,6 +37,13 @@ class PieChartModel extends BaseChartModel
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withOnSliceClickEvent($onSliceClickEventName)
|
||||
{
|
||||
$this->onSliceClickEventName = $onSliceClickEventName;
|
||||
@@ -57,6 +68,7 @@ class PieChartModel extends BaseChartModel
|
||||
return array_merge(parent::toArray(), [
|
||||
'onSliceClickEventName' => $this->onSliceClickEventName,
|
||||
'opacity' => $this->opacity,
|
||||
'type' => $this->type,
|
||||
'data' => $this->data->toArray(),
|
||||
]);
|
||||
}
|
||||
@@ -69,6 +81,8 @@ class PieChartModel extends BaseChartModel
|
||||
|
||||
$this->opacity = data_get($array, 'opacity', 0.75);
|
||||
|
||||
$this->type = data_get($array, 'type', 'pie');
|
||||
|
||||
$this->data = collect(data_get($array, 'data', []));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user