File tree Expand file tree Collapse file tree 15 files changed +20
-192
lines changed Expand file tree Collapse file tree 15 files changed +20
-192
lines changed Original file line number Diff line number Diff line change 56
56
"release" : " webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js" ,
57
57
"prepublishOnly" : " yarn run lint && yarn run test && yarn run build"
58
58
},
59
- "dependencies" : {
60
- "lodash.merge" : " ^4.6.0"
61
- },
59
+ "dependencies" : {},
62
60
"peerDependencies" : {
63
61
"chart.js" : " 2.7.x"
64
62
},
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -52,25 +51,6 @@ export default {
52
51
data ( ) {
53
52
return {
54
53
_chart : null ,
55
- defaultOptions : {
56
- scales : {
57
- yAxes : [ {
58
- ticks : {
59
- beginAtZero : true
60
- } ,
61
- gridLines : {
62
- display : false
63
- }
64
- } ] ,
65
- xAxes : [ {
66
- gridLines : {
67
- display : false
68
- } ,
69
- categoryPercentage : 0.5 ,
70
- barPercentage : 0.2
71
- } ]
72
- }
73
- } ,
74
54
_plugins : this . plugins
75
55
}
76
56
} ,
@@ -80,12 +60,11 @@ export default {
80
60
this . $data . _plugins . push ( plugin )
81
61
} ,
82
62
renderChart ( data , options ) {
83
- let chartOptions = mergeOptions ( this . defaultOptions , options )
84
63
this . $data . _chart = new Chart (
85
64
this . $refs . canvas . getContext ( '2d' ) , {
86
65
type : 'bar' ,
87
66
data : data ,
88
- options : chartOptions ,
67
+ options : options ,
89
68
plugins : this . $data . _plugins
90
69
}
91
70
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,25 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- scales : {
59
- yAxes : [ {
60
- ticks : {
61
- beginAtZero : true
62
- } ,
63
- gridLines : {
64
- display : false
65
- }
66
- } ] ,
67
- xAxes : [ {
68
- gridLines : {
69
- display : false
70
- } ,
71
- categoryPercentage : 0.5 ,
72
- barPercentage : 0.2
73
- } ]
74
- }
75
- } ,
76
56
_plugins : this . plugins
77
57
}
78
58
} ,
@@ -82,13 +62,11 @@ export default {
82
62
this . $data . _plugins . push ( plugin )
83
63
} ,
84
64
renderChart ( data , options ) {
85
- let chartOptions = mergeOptions ( this . defaultOptions , options )
86
-
87
65
this . $data . _chart = new Chart (
88
66
this . $refs . canvas . getContext ( '2d' ) , {
89
67
type : 'bubble' ,
90
68
data : data ,
91
- options : chartOptions ,
69
+ options : options ,
92
70
plugins : this . $data . _plugins
93
71
}
94
72
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,8 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- } ,
59
56
_plugins : this . plugins
60
57
}
61
58
} ,
@@ -64,14 +61,13 @@ export default {
64
61
addPlugin ( plugin ) {
65
62
this . $data . _plugins . push ( plugin )
66
63
} ,
67
- renderChart ( data , options ) {
68
- let chartOptions = mergeOptions ( this . defaultOptions , options )
69
64
65
+ renderChart ( data , options ) {
70
66
this . $data . _chart = new Chart (
71
67
this . $refs . canvas . getContext ( '2d' ) , {
72
68
type : 'doughnut' ,
73
69
data : data ,
74
- options : chartOptions ,
70
+ options : options ,
75
71
plugins : this . $data . _plugins
76
72
}
77
73
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,25 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- scales : {
59
- yAxes : [ {
60
- ticks : {
61
- beginAtZero : true
62
- } ,
63
- gridLines : {
64
- display : false
65
- }
66
- } ] ,
67
- xAxes : [ {
68
- gridLines : {
69
- display : false
70
- } ,
71
- categoryPercentage : 0.5 ,
72
- barPercentage : 0.2
73
- } ]
74
- }
75
- } ,
76
56
_plugins : this . plugins
77
57
}
78
58
} ,
@@ -81,13 +61,12 @@ export default {
81
61
addPlugin ( plugin ) {
82
62
this . $data . _plugins . push ( plugin )
83
63
} ,
84
- renderChart ( data , options , type ) {
85
- let chartOptions = mergeOptions ( this . defaultOptions , options )
64
+ renderChart ( data , options ) {
86
65
this . $data . _chart = new Chart (
87
66
this . $refs . canvas . getContext ( '2d' ) , {
88
67
type : 'horizontalBar' ,
89
68
data : data ,
90
- options : chartOptions ,
69
+ options : options ,
91
70
plugins : this . $data . _plugins
92
71
}
93
72
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,23 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- scales : {
59
- yAxes : [ {
60
- ticks : {
61
- beginAtZero : true
62
- } ,
63
- gridLines : {
64
- display : false
65
- }
66
- } ] ,
67
- xAxes : [ {
68
- gridLines : {
69
- display : false
70
- }
71
- } ]
72
- }
73
- } ,
74
56
_plugins : this . plugins
75
57
}
76
58
} ,
@@ -80,13 +62,11 @@ export default {
80
62
this . $data . _plugins . push ( plugin )
81
63
} ,
82
64
renderChart ( data , options ) {
83
- let chartOptions = mergeOptions ( this . defaultOptions , options )
84
-
85
65
this . $data . _chart = new Chart (
86
66
this . $refs . canvas . getContext ( '2d' ) , {
87
67
type : 'line' ,
88
68
data : data ,
89
- options : chartOptions ,
69
+ options : options ,
90
70
plugins : this . $data . _plugins
91
71
}
92
72
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,8 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- } ,
59
56
_plugins : this . plugins
60
57
}
61
58
} ,
@@ -65,13 +62,11 @@ export default {
65
62
this . $data . _plugins . push ( plugin )
66
63
} ,
67
64
renderChart ( data , options ) {
68
- let chartOptions = mergeOptions ( this . defaultOptions , options )
69
-
70
65
this . $data . _chart = new Chart (
71
66
this . $refs . canvas . getContext ( '2d' ) , {
72
67
type : 'pie' ,
73
68
data : data ,
74
- options : chartOptions ,
69
+ options : options ,
75
70
plugins : this . $data . _plugins
76
71
}
77
72
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,8 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- } ,
59
56
_plugins : this . plugins
60
57
}
61
58
} ,
@@ -65,13 +62,11 @@ export default {
65
62
this . $data . _plugins . push ( plugin )
66
63
} ,
67
64
renderChart ( data , options ) {
68
- let chartOptions = mergeOptions ( this . defaultOptions , options )
69
-
70
65
this . $data . _chart = new Chart (
71
66
this . $refs . canvas . getContext ( '2d' ) , {
72
67
type : 'polarArea' ,
73
68
data : data ,
74
- options : chartOptions ,
69
+ options : options ,
75
70
plugins : this . $data . _plugins
76
71
}
77
72
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,8 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- } ,
59
56
_plugins : this . plugins
60
57
}
61
58
} ,
@@ -65,13 +62,11 @@ export default {
65
62
this . $data . _plugins . push ( plugin )
66
63
} ,
67
64
renderChart ( data , options ) {
68
- let chartOptions = mergeOptions ( this . defaultOptions , options )
69
-
70
65
this . $data . _chart = new Chart (
71
66
this . $refs . canvas . getContext ( '2d' ) , {
72
67
type : 'radar' ,
73
68
data : data ,
74
- options : chartOptions ,
69
+ options : options ,
75
70
plugins : this . $data . _plugins
76
71
}
77
72
)
Original file line number Diff line number Diff line change 1
1
import Chart from 'chart.js'
2
- import { mergeOptions } from '../helpers/options'
3
2
4
3
export default {
5
4
render : function ( createElement ) {
@@ -54,14 +53,6 @@ export default {
54
53
data ( ) {
55
54
return {
56
55
_chart : null ,
57
- defaultOptions : {
58
- scales : {
59
- xAxes : [ {
60
- type : 'linear' ,
61
- position : 'bottom'
62
- } ]
63
- }
64
- } ,
65
56
_plugins : this . plugins
66
57
}
67
58
} ,
@@ -71,13 +62,11 @@ export default {
71
62
this . $data . _plugins . push ( plugin )
72
63
} ,
73
64
renderChart ( data , options ) {
74
- let chartOptions = mergeOptions ( this . defaultOptions , options )
75
-
76
65
this . $data . _chart = new Chart (
77
66
this . $refs . canvas . getContext ( '2d' ) , {
78
67
type : 'scatter' ,
79
68
data : data ,
80
- options : chartOptions ,
69
+ options : options ,
81
70
plugins : this . $data . _plugins
82
71
}
83
72
)
You can’t perform that action at this time.
0 commit comments