Download the PHP package vemcogroup/nova-charts without Composer
On this page you can find all versions of the php package vemcogroup/nova-charts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vemcogroup/nova-charts
More information about vemcogroup/nova-charts
Files in vemcogroup/nova-charts
Package nova-charts
Short Description A Laravel Nova card to show charts from the Chart.js library.
License MIT
Homepage https://github.com/vemcogroup/nova-charts
Informations about the package nova-charts
A Nova card to use add ChartJS charts
This card tool gives the possibility to add cards with charts from Chart.js.
Installation
You can install the nova tool in to a Laravel app that uses Nova via composer:
Usage
You can now use add card with charts from your resources data.
First you need to add the trait HasGraphData
to the models that should show chart data.
The trait has 2 functions which can be extended to show chart data:
When adding the chart card to a resource these options are available:
At the moment its only possible to use chart on resource detail page
Title
You can set the title of the card.
Description
You can set the description of the card which will be shown below title.
Type
There are at the moment 3 types of charts available:
You can set your chart type like this, default is bar
Labels
If you dont want to display labels on the chart, you able to hide them.
Legends
If you dont want to display legends on the chart, you able to hide them.
Selections
You are able to create a section of selections below the chart that, when clicked, will change the data with the selection ex. selections of years.
By default selections are hidden until set.
You are also able to select which selection to start from.
Model (v3.x)
Only for version 3.x
Its required to set the model from where you want the data.
Resource (2.x | 1.x)
Only for version 1.x | 2.x
If you want to show a chart on a dashboard the chart dont know what resources to take data from, this can be defined by this option.
Remember to type resource as plural, ex companies
When using a chart on dashboard remember to override the function chartDashboardData($selection)