How to fix the position of LegendBox in the chart?

242 Views Asked by At

I am using LightningChartJS to create chart. Currently the position of legend box can be changed by dragging it. How can I fix the position of the legend box? ​


const legend = chart.addLegendBox()
.setOrigin(UIOrigins.RightTop)
.setPosition({ x: 90, y: 90 })
.setMargin({ left: 10, right: 10, top: 10, bottom: 10 })
legend.add(chart)

1

There are 1 best solutions below

0
On BEST ANSWER

Dragging can be disabled with

legend.setDraggingMode( UIDraggingModes.notDraggable )