Add chartId as prop and fix width and height props

Signed-off-by: Jakub Juszczak <netghost03@gmail.com>
This commit is contained in:
Jakub Juszczak
2016-09-23 13:29:03 +02:00
parent 3c252ce904
commit 975a804570
7 changed files with 35 additions and 7 deletions

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="bar-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'bar-chart',
type: String
},
width: {
default: 400,
type: Number

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="bar-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'bubble-chart',
type: String
},
width: {
default: 400,
type: Number

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="doughnut-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'doughnut-chart',
type: String
},
width: {
default: 400,
type: Number

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="line-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'line-chart',
type: String
},
width: {
default: 400,
type: Number

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="pie-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'pie-chart',
type: String
},
width: {
default: 400,
type: Number

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="polar-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'polar-chart',
type: String
},
width: {
default: 400,
type: Number

View File

@@ -5,11 +5,15 @@ import { mergeOptions } from '../helpers/options'
export default Vue.extend({
template: `
<div>
<canvas id="radar-chart" width=width height=height ref="canvas"></canvas>
<canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
</div>
`,
props: {
chartId: {
default: 'radar-chart',
type: String
},
width: {
default: 400,
type: Number