Question

I am trying to make the labels on the x-axis two lined but its cut off. Here is my code

<!DOCTYPE html >
<html>
    <head>
        <script src="RGraph.common.core.js" ></script>
        <script src="RGraph.line.js" ></script>
   </head>
    <body>
        <canvas id="cvs" width="320" height="320">[No canvas support]</canvas>
        <script>
        window.onload = function ()
        {  
            var line = new RGraph.Line('cvs', [0,52,90,86,86,75,75,75,75,75,60,60,60,60,60,60,100,95,53,53]);
            line.Set('chart.labels',['10/05\n21:00','11/05\n08:00','11/05\n20:00','12/05\n08:00','12/05\n20:00']);
            line.Draw();
        }
        </script>
    </body>
</html>

This is how it looks like

enter image description here

I already played around with the canvas height but it does not change it.

Was it helpful?

Solution

Increase the chart.gutter.bottom setting. It defaults to 25 - so set it to 35 or 40.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top