- npm install:
npm i quasar-components-chart --save
You need to import the component
import QChart from 'quasar-components-chart'
Now you need to register the component
import QChart from "chart.js";
export default {
components: { QChart },
data() {
return {};
}
}
You can use the component
<q-chart
identifier="myChart"
stilo="height:30vh; width: 100%"
:type="line"
:labels="labels"
:datasets="datasets"
:options="options"
/>
- identifier = ID
- stilo = CSS
- type = Chart type
- labels = Labels of chart js
- datasets = Datasets of Chart js
- options = Options of Chart js