Padding on top, bottom and right in LightningChart JS

Sometimes my line chart is at very bottom right of the screen which makes it little hard to read. How can I set the padding around multiple line charts?

I tried something like this but I get a max stack call size error:

// Bind X Axes together.
const HandleScaleChangeX = (chartIndex) => {
    return (start, end) => {
        for (let i = 0; i < charts.length; i++) {
            const axis = charts[i].getDefaultAxisX()
  
            if (end !== xVal) {
                axis.setInterval(start, xVal+50, false, true)
            }
        }
    }
}
for (let i = 0; i < charts.length; i++) {
    const chart = charts[i]
    chart.getDefaultAxisX()
         .onScaleChange(HandleScaleChangeX(i))
}

Whereas the following line, where xVal is the length of the chart, works fine:

axis.setInterval(start, xVal, false, true) 

4 thoughts on “Padding on top, bottom and right in LightningChart JS”

Leave a Comment