I create a lightweight chart with candlestick data. If I left click and keep pressed on the chart I can move the candles on the horizontal axis, but not vertically on the y axis. The candles are kind of stuck on the current price scale.
If I rescale the y axis manually using click and hold the left mouse button on the y axis and move to rescale, I’m able to move the chart freely in both axis.
I tried using
handleScroll: {
vertTouchDrag: true,
},
or
handleScale: {
priceAxisPressedMouseMove: true,
timeAxisPressedMouseMove: true,
},
or
rightPriceScale: {
mode: LightweightCharts.PriceScaleMode.Normal, // Enable normal scaling mode
},
handleScale: {
axisPressedMouseMove: {
time: true,
price: true,
},
},
handleScroll: {
mouseWheel: true, // Enable scrolling with the mouse wheel
pressedMouseMove: true, // Allow dragging with the mouse
},
but none worked. But I think some don’t work because of outdated settings. I’m using latest 4.2.2.
Anyone knows, how to allow moving the chart freely from the beginning?
A very simple example for testing is like this
var chart = LightweightCharts.createChart(document.body, {
width: 400, height: 300,
handleScroll: {
vertTouchDrag: true,
},
});
var lineSeries = chart.addCandlestickSeries();
lineSeries.setData([
{ time: '2019-04-11',open: 80.01, close: 82, high: 83, low: 79 },
]);
chart.timeScale().fitContent();