Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: fallthrough props to canvas (#955)
fallthrough non-chart props to canvas, chart props were renamed BREAKING CHANGE: div wrapper was removed, `chartData` prop was renamed to `data`, `chartOptions` prop was renamed to `options`, `generateChart` was renamed to `createTypedChart`
- Loading branch information
Showing
116 changed files
with
1,110 additions
and
2,908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
{ | ||
"name": "vue-chartjs-bar-example", | ||
"scripts": { | ||
"start": "vite" | ||
}, | ||
"dependencies": { | ||
"chart.js": "^3.8.0", | ||
"typescript": "^4.6.2", | ||
"vue": "^3.2.31", | ||
"vue-chartjs": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~5.0.0" | ||
"@vitejs/plugin-vue": "^3.0.1", | ||
"typescript": "^4.9.3", | ||
"vite": "^3.2.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
<template> | ||
<BarChart /> | ||
<Bar :data="data" :options="options" /> | ||
</template> | ||
|
||
<script> | ||
import BarChart from './components/barChart' | ||
<script lang="ts"> | ||
import { | ||
Chart as ChartJS, | ||
Title, | ||
Tooltip, | ||
Legend, | ||
BarElement, | ||
CategoryScale, | ||
LinearScale | ||
} from 'chart.js' | ||
import { Bar } from 'vue-chartjs' | ||
import * as chartConfig from './chartConfig' | ||
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend) | ||
export default { | ||
name: 'App', | ||
components: { | ||
BarChart | ||
Bar | ||
}, | ||
data() { | ||
return chartConfig | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export const data = { | ||
labels: [ | ||
'January', | ||
'February', | ||
'March', | ||
'April', | ||
'May', | ||
'June', | ||
'July', | ||
'August', | ||
'September', | ||
'October', | ||
'November', | ||
'December' | ||
], | ||
datasets: [ | ||
{ | ||
label: 'Data One', | ||
backgroundColor: '#f87979', | ||
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11] | ||
} | ||
] | ||
} | ||
|
||
export const options = { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
|
||
export default defineConfig({ | ||
plugins: [vue()] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
{ | ||
"name": "vue-chartjs-bubble-example", | ||
"scripts": { | ||
"start": "vite" | ||
}, | ||
"dependencies": { | ||
"chart.js": "^3.8.0", | ||
"typescript": "^4.6.2", | ||
"vue": "^3.2.31", | ||
"vue-chartjs": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~5.0.0" | ||
"@vitejs/plugin-vue": "^3.0.1", | ||
"typescript": "^4.9.3", | ||
"vite": "^3.2.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
<template> | ||
<BubbleChart /> | ||
<Bubble :data="data" :options="options" /> | ||
</template> | ||
|
||
<script> | ||
import BubbleChart from './components/bubbleChart' | ||
<script lang="ts"> | ||
import { | ||
Chart as ChartJS, | ||
Tooltip, | ||
Legend, | ||
PointElement, | ||
LinearScale | ||
} from 'chart.js' | ||
import { Bubble } from 'vue-chartjs' | ||
import * as chartConfig from './chartConfig' | ||
ChartJS.register(LinearScale, PointElement, Tooltip, Legend) | ||
export default { | ||
name: 'App', | ||
components: { | ||
BubbleChart | ||
Bubble | ||
}, | ||
data() { | ||
return chartConfig | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
export const data = { | ||
datasets: [ | ||
{ | ||
label: 'Data One', | ||
backgroundColor: '#f87979', | ||
data: [ | ||
{ | ||
x: 20, | ||
y: 25, | ||
r: 5 | ||
}, | ||
{ | ||
x: 40, | ||
y: 10, | ||
r: 10 | ||
}, | ||
{ | ||
x: 30, | ||
y: 22, | ||
r: 30 | ||
} | ||
] | ||
}, | ||
{ | ||
label: 'Data Two', | ||
backgroundColor: '#7C8CF8', | ||
data: [ | ||
{ | ||
x: 10, | ||
y: 30, | ||
r: 15 | ||
}, | ||
{ | ||
x: 20, | ||
y: 20, | ||
r: 10 | ||
}, | ||
{ | ||
x: 15, | ||
y: 8, | ||
r: 30 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
export const options = { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} |
Oops, something went wrong.