File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 127
127
// chart area
128
128
if ( v . is_front == true ) { // jshint ignore:line
129
129
$ ( '#' + id ) . css ( 'position' , 'relative' ) ;
130
- chartjs . canvas . parentNode . style . height = settings . height ;
131
- chartjs . canvas . parentNode . style . width = settings . width ;
130
+ var height = settings . height . indexOf ( '%' ) === - 1 ? ( settings . height + 'px' ) : settings . height ;
131
+ var width = settings . width . indexOf ( '%' ) === - 1 ? ( settings . width + 'px' ) : settings . width ;
132
+ if ( settings . height ) {
133
+ chartjs . canvas . parentNode . style . height = height ;
134
+ $ ( '#' + id + ' canvas' ) . css ( 'height' , height ) ;
135
+ }
136
+ if ( settings . width ) {
137
+ chartjs . canvas . parentNode . style . width = width ;
138
+ $ ( '#' + id + ' canvas' ) . css ( 'width' , width ) ;
139
+ }
132
140
}
133
141
134
142
// allow user to extend the settings.
You can’t perform that action at this time.
0 commit comments