File tree Expand file tree Collapse file tree 8 files changed +131
-37
lines changed Expand file tree Collapse file tree 8 files changed +131
-37
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
@@ -51,7 +63,6 @@ export default Vue.extend({
51
63
methods : {
52
64
renderChart ( data , options , type ) {
53
65
let chartOptions = mergeOptions ( this . defaultOptions , options )
54
-
55
66
this . _chart = new Chart (
56
67
this . $refs . canvas . getContext ( '2d' ) , {
57
68
type : type || 'bar' ,
Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
Original file line number Diff line number Diff line change @@ -3,11 +3,23 @@ import Chart from 'chart.js'
3
3
import { mergeOptions } from '../helpers/options'
4
4
5
5
export default Vue . extend ( {
6
- template : `
7
- <div>
8
- <canvas :id="chartId" :width="width" :height="height" ref="canvas"></canvas>
9
- </div>
10
- ` ,
6
+ render : function ( createElement ) {
7
+ return createElement (
8
+ 'div' ,
9
+ [
10
+ createElement (
11
+ 'canvas' , {
12
+ attrs : {
13
+ id : this . chartId ,
14
+ width : this . width ,
15
+ height : this . height
16
+ } ,
17
+ ref : 'canvas'
18
+ }
19
+ )
20
+ ]
21
+ )
22
+ } ,
11
23
12
24
props : {
13
25
chartId : {
Original file line number Diff line number Diff line change @@ -1535,6 +1535,10 @@ dateformat@^1.0.6:
1535
1535
get-stdin "^4.0.1"
1536
1536
meow "^3.3.0"
1537
1537
1538
+ de-indent@^1.0.2 :
1539
+ version "1.0.2"
1540
+ resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
1541
+
1538
1542
1539
1543
version "0.7.4"
1540
1544
resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39"
@@ -2527,7 +2531,7 @@ hawk@~3.1.3:
2527
2531
hoek "2.x.x"
2528
2532
sntp "1.x.x"
2529
2533
2530
-
2534
+
2531
2535
version "1.1.0"
2532
2536
resolved "https://registry.yarnpkg.com/he/-/he-1.1.0.tgz#29319d49beec13a9b1f3c4f9b2a6dde4859bb2a7"
2533
2537
@@ -5501,6 +5505,13 @@ vue-style-loader@^1.0.0:
5501
5505
dependencies :
5502
5506
loader-utils "^0.2.7"
5503
5507
5508
+ vue-template-compiler@^2.1.6 :
5509
+ version "2.1.6"
5510
+ resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.1.6.tgz#f96f968652fc1e861bb0052f61993ba1fdc18ad3"
5511
+ dependencies :
5512
+ de-indent "^1.0.2"
5513
+ he "^1.1.0"
5514
+
5504
5515
vue-template-es2015-compiler@^1.2.2 :
5505
5516
version "1.4.0"
5506
5517
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.4.0.tgz#7b88853ca4bf8d84ae54ab9e56771de271e60198"
You can’t perform that action at this time.
0 commit comments