Skip to content

Commit 975a804

Browse files
committed
✨ Add chartId as prop and fix width and height props
Signed-off-by: Jakub Juszczak <[email protected]>
1 parent 3c252ce commit 975a804

File tree

7 files changed

+35
-7
lines changed

7 files changed

+35
-7
lines changed

src/BaseCharts/Bar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="bar-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'bar-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

src/BaseCharts/Bubble.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="bar-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'bubble-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

src/BaseCharts/Doughnut.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="doughnut-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'doughnut-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

src/BaseCharts/Line.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="line-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'line-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

src/BaseCharts/Pie.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="pie-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'pie-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

src/BaseCharts/PolarArea.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="polar-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'polar-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

src/BaseCharts/Radar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
55
export default Vue.extend({
66
template: `
77
<div>
8-
<canvas id="radar-chart" width=width height=height ref="canvas"></canvas>
8+
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
99
</div>
1010
`,
1111

1212
props: {
13+
chartId: {
14+
default: 'radar-chart',
15+
type: String
16+
},
1317
width: {
1418
default: 400,
1519
type: Number

0 commit comments

Comments
 (0)