You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| setJsonConfig(array $config) | Adds extra customization to charts by passing Apex charts properties keys and values. Nested keys must be added using dot (.) notation |
187
188
188
189
### LivewireLineChart
189
190
@@ -256,6 +257,31 @@ inside your resources folder. You can then adjust imports as you see fit in your
256
257
257
258
>Note: You must remove @livewireChartsScripts directive so it doesn't clash with the scripts in your build system.
258
259
260
+
261
+
## Advanced Usage - Custom Json Configs
262
+
263
+
The `setJsonConfig()` method on every chart allows adding custom Apex properties not provided first hand by the package.
264
+
This means that any chart property supported by Apex chart can be passed down using this method.
265
+
266
+
```php
267
+
$chart->setJsonConfig([
268
+
'plotOptions.pie.startAngle' => -90,
269
+
'plotOptions.pie.endAngle' => 90,
270
+
'plotOptions.pie.offsetY' => 10,
271
+
'grid.padding.bottom' => -180,
272
+
]);
273
+
```
274
+
275
+
>Note: If you want to add nested properties, you can use dot (.) notation for this matter.
276
+
277
+
You can even pass down simple JS functions. For example, for formatting you can pass down your own closure
278
+
279
+
```php
280
+
$chart->setJsonConfig([
281
+
'tooltip.y.formatter' => '(val) => `$${val} million dollars baby!`'
282
+
])
283
+
```
284
+
259
285
## Troubleshooting
260
286
261
287
Chart components must be placed inside a container with fixed height. This is because the chart will use all the given
0 commit comments