Skip to content

Commit 8287c7a

Browse files
set chart area
1 parent e99715e commit 8287c7a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

js/render-chartjs.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@
104104
}
105105

106106
if(v.is_front == false){ // jshint ignore:line
107+
// this line needs to be included twice. This is not an error.
108+
// if this one is removed, the preview gets messed up.
109+
// if this line is included all the time, in this very place (out of the if), the front-end gets messed up.
107110
$.extend(settings, { responsive: true, maintainAspectRatio: false });
108111
}
109112

@@ -118,6 +121,16 @@
118121
options: settings
119122
});
120123

124+
// this line needs to be included twice. This is not an error.
125+
$.extend(settings, { responsive: true, maintainAspectRatio: false });
126+
127+
// chart area
128+
if(v.is_front == true){ // jshint ignore:line
129+
$('#' + id).css('position', 'relative');
130+
chartjs.canvas.parentNode.style.height = settings.height;
131+
chartjs.canvas.parentNode.style.width = settings.width;
132+
}
133+
121134
// allow user to extend the settings.
122135
$('body').trigger('visualizer:chart:settings:extend', {id: id, chart: chart, settings: settings});
123136

0 commit comments

Comments
 (0)