File tree Expand file tree Collapse file tree 11 files changed +179
-14
lines changed Expand file tree Collapse file tree 11 files changed +179
-14
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ There are some basic props defined in the BaseCharts. Because you `extend()` the
71
71
| width | chart width |
72
72
| height | chart height |
73
73
| chart-id | id of the canvas |
74
-
74
+ | css-classes | String with css classes for the surrounding div |
75
+ | styles | Object with css styles for the surrounding div container |
75
76
76
77
## Examples
77
78
@@ -176,7 +177,8 @@ export default Line.extend({
176
177
mixins: [reactiveProp],
177
178
props: [' options' ],
178
179
mounted () {
179
- // this.chartData is created in the mixin
180
+ // this.chartData is created in the mixin.
181
+ // If you want to pass options please create a local options object
180
182
this .renderChart (this .chartData , this .options )
181
183
}
182
184
})
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -20,7 +23,6 @@ export default Vue.extend({
20
23
]
21
24
)
22
25
} ,
23
-
24
26
props : {
25
27
chartId : {
26
28
default : 'bar-chart' ,
@@ -33,9 +35,22 @@ export default Vue.extend({
33
35
height : {
34
36
default : 400 ,
35
37
type : Number
38
+ } ,
39
+ cssClasses : {
40
+ type : String ,
41
+ default : ''
42
+ } ,
43
+ styles : {
44
+ type : Object ,
45
+ default ( ) {
46
+ return {
47
+ width : '100%' ,
48
+ height : '200%' ,
49
+ position : 'relative'
50
+ }
51
+ }
36
52
}
37
53
} ,
38
-
39
54
data ( ) {
40
55
return {
41
56
defaultOptions : {
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import { mergeOptions } from '../helpers/options'
5
5
export default Vue . extend ( {
6
6
render : function ( createElement ) {
7
7
return createElement (
8
- 'div' ,
8
+ 'div' , {
9
+ style : this . styles ,
10
+ class : this . cssClasses
11
+ } ,
9
12
[
10
13
createElement (
11
14
'canvas' , {
@@ -33,6 +36,20 @@ export default Vue.extend({
33
36
height : {
34
37
default : 400 ,
35
38
type : Number
39
+ } ,
40
+ cssClasses : {
41
+ type : String ,
42
+ default : ''
43
+ } ,
44
+ styles : {
45
+ type : Object ,
46
+ default ( ) {
47
+ return {
48
+ width : '100%' ,
49
+ height : '200%' ,
50
+ position : 'relative'
51
+ }
52
+ }
36
53
}
37
54
} ,
38
55
You can’t perform that action at this time.
0 commit comments