1

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 Answers1

2

Dragging can be disabled with

legend.setDraggingMode( UIDraggingModes.notDraggable )
Niilo Keinänen
  • 2,187
  • 1
  • 7
  • 12