Skip to content

Commit 7042074

Browse files
committed
Updated example
1 parent e548899 commit 7042074

File tree

5 files changed

+500
-445
lines changed

5 files changed

+500
-445
lines changed

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ For ChartJS 2, see [v0.3.0](https://github.com/J-T-McC/vue3-chartjs/tree/0.3.0)
1616
## Installation
1717

1818
```shell script
19-
yarn add chart.js
20-
yarn add @j-t-mcc/vue3-chartjs
19+
yarn add chart.js @j-t-mcc/vue3-chartjs
2120

22-
npm install chart.js
23-
npm install @j-t-mcc/vue3-chartjs
21+
npm install chart.js @j-t-mcc/vue3-chartjs
2422
```
2523

2624
## Configuration
@@ -340,11 +338,12 @@ Example usage with locally imported chart component:
340338

341339
```vue
342340
<template>
343-
<div style="height:600px;width: 600px; display: flex;flex-direction:column;">
341+
<div style="height:600px;width:600px;">
344342
<vue3-chart-js
345343
:id="lineChart.id"
346344
:type="lineChart.type"
347345
:data="lineChart.data"
346+
:options="lineChart.options"
348347
></vue3-chart-js>
349348
</div>
350349
</template>
@@ -368,7 +367,7 @@ export default {
368367
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
369368
datasets: [{
370369
label: '# of Votes',
371-
data: [12, 19, 3, 5, 2, 3],
370+
data: [50, 19, 3, 5, 2, 3],
372371
backgroundColor: [
373372
'rgba(255, 99, 132, 0.2)',
374373
'rgba(54, 162, 235, 0.2)',
@@ -389,26 +388,20 @@ export default {
389388
}]
390389
},
391390
options: {
392-
scales: {
393-
yAxes: [{
394-
ticks: {
395-
beginAtZero: true
396-
}
397-
}]
398-
},
399391
plugins: {
400392
zoom: {
401-
pan: {
402-
enabled: true,
403-
mode: 'y'
404-
},
405393
zoom: {
406-
enabled: true,
407-
mode: 'y'
408-
}
409-
}
410-
}
411-
}
394+
wheel: {
395+
enabled: true,
396+
},
397+
pinch: {
398+
enabled: true,
399+
},
400+
mode: "y",
401+
},
402+
},
403+
},
404+
},
412405
}
413406
414407
return {

dist/vue3-chartjs.es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue3-chartjs.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@j-t-mcc/vue3-chartjs",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"author": "Tyson McCarney <[email protected]> (https://tysonmccarney.com)",
55
"description": "Vue3 wrapper for Chart.js",
66
"license": "MIT",

0 commit comments

Comments
 (0)