mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-12-08 20:48:45 +00:00
✨ Add canvas id as prop
This commit is contained in:
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
|
|||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<canvas id="bar-chart" width="{{width}}" height="{{height}}" v-el:canvas></canvas>
|
<canvas id="{{chartId}}" width="{{width}}" height="{{height}}" v-el:canvas></canvas>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
chartId: {
|
||||||
|
default: 'bar-chart',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
width: {
|
width: {
|
||||||
default: 400,
|
default: 400,
|
||||||
type: Number
|
type: Number
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
|
|||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<canvas id="doughnut-chart" width={{width}} height={{height}} v-el:canvas></canvas>
|
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
chartId: {
|
||||||
|
default: 'doughnut-chart',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
width: {
|
width: {
|
||||||
default: 400,
|
default: 400,
|
||||||
type: Number
|
type: Number
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
|
|||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<canvas id="line-chart" width={{width}} height={{height}} v-el:canvas></canvas>
|
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
chartId: {
|
||||||
|
default: 'line-chart',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
width: {
|
width: {
|
||||||
default: 400,
|
default: 400,
|
||||||
type: Number
|
type: Number
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
|
|||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<canvas id="pie-chart" width={{width}} height={{height}} v-el:canvas></canvas>
|
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
chartId: {
|
||||||
|
default: 'pie-chart',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
width: {
|
width: {
|
||||||
default: 400,
|
default: 400,
|
||||||
type: Number
|
type: Number
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
|
|||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<canvas id="polar-chart" width={{width}} height={{height}} v-el:canvas></canvas>
|
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
chartId: {
|
||||||
|
default: 'polar-chart',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
width: {
|
width: {
|
||||||
default: 400,
|
default: 400,
|
||||||
type: Number
|
type: Number
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
|
|||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<canvas id="radar-chart" width={{width}} height={{height}} v-el:canvas></canvas>
|
<canvas id="{{chartId}}" width={{width}} height={{height}} v-el:canvas></canvas>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
chartId: {
|
||||||
|
default: 'radar-chart',
|
||||||
|
type: String
|
||||||
|
},
|
||||||
width: {
|
width: {
|
||||||
default: 400,
|
default: 400,
|
||||||
type: Number
|
type: Number
|
||||||
|
|||||||
Reference in New Issue
Block a user