I'm facing an issue with printing my Morris bar chart results. Everything looks fine in HTML, but when I try to print it, the layout seems off. Here is what I have tried so far:
<script>
function myFunction() {
window.print();
}
</script>
<div id="bar" class="bar" class="col-sm-12"></div>
<script>
Morris.Bar({
barGap:4,
barSizeRatio:0.90,
element: 'bar',
data: dataChart,
xkey: 'y',
ykeys: ['a'],
labels: ['Actuel'],
});
</script>
When viewing the normal print preview (which doesn't look good as it's too large):
However, if I refresh the printing page, the size adjustment is much better:
It appears that there might be an issue with the svg rendering, as after refreshing, the size is correct:
If you have any suggestions or ideas on how to resolve this, please let me know.
Thank you for your assistance and time.