Added helper methods for PieChartModel
This commit is contained in:
10
README.md
10
README.md
@@ -210,11 +210,13 @@ for each type of chart.
|
||||
|
||||
### LivewirePieChart
|
||||
|
||||
| Method | Description |
|
||||
|--------|-------------|
|
||||
| setOpacity(int $opacity) | Sets slices' opacity |
|
||||
| Method | Description |
|
||||
|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
|
||||
| setOpacity(int $opacity) | Sets slices' opacity |
|
||||
| asPie() | Displays chart as pie |
|
||||
| asDonut() | Displays chart as donut |
|
||||
| addSlice(string $title, double $value, string $color, array $extras = []) | Adds a slice to the chart with the specified color. `$extras` is forwarded on click event |
|
||||
| withOnSliceClickEvent(string $eventName) | Event Name that will be fired when a column of the chart is clicked |
|
||||
| withOnSliceClickEvent(string $eventName) | Event Name that will be fired when a column of the chart is clicked |
|
||||
|
||||
### LivewireAreaChart
|
||||
|
||||
|
||||
@@ -44,6 +44,16 @@ class PieChartModel extends BaseChartModel
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asPie()
|
||||
{
|
||||
return $this->setType('pie');
|
||||
}
|
||||
|
||||
public function asDonut()
|
||||
{
|
||||
return $this->setType('donut');
|
||||
}
|
||||
|
||||
public function withOnSliceClickEvent($onSliceClickEventName)
|
||||
{
|
||||
$this->onSliceClickEventName = $onSliceClickEventName;
|
||||
|
||||
Reference in New Issue
Block a user