6 Commits

Author SHA1 Message Date
asantibanez
e6f04ca4c3 Merge branch 'master' of https://github.com/asantibanez/livewire-charts into nicko170/master 2022-02-14 10:58:40 -05:00
Andrés Santibáñez
327665919f Merge pull request #69 from asantibanez/update-to-laravel-9
Added support for L9. Upgraded dependencies
2022-02-14 10:42:35 -05:00
asantibanez
879734fe9c Updated CI 2022-02-14 10:33:10 -05:00
asantibanez
6754e94cde Added support for L9. Upgraded dependencies 2022-02-14 10:26:17 -05:00
nicko170
a7364ad51c compile 2021-08-27 16:14:40 +10:00
nicko170
47d0f028af adding pie chart type 2021-08-27 16:05:53 +10:00
6 changed files with 32 additions and 12129 deletions

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -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,

View File

@@ -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', []));
}
}