I need to add up down arrow on my amcharts V5 stockchart

37 Views Asked by At

when I click on buy/sell button I need to show an arrow on the on last candle when the button was clicked here is the view of my chart enter image description here

I need something like this but in amcharts version 5 enter image description here

I have tried to implement the following but it is giving errors as chart is not defined or createChild is not a function etc it is not working at all.

function addArrow() {         
var candlestick = mainPane.plotContainer.dataItems.getIndex(0);
var arrow = candlestick.createChild(am5xy.Line);
arrow.stroke = am5.color("red");
arrow.strokeOpacity = 1;
arrow.strokeWidth = 2;
arrow.path = "M0,0 L10,10 M0,10 L10,0"; // Adjust the arrow shape as needed
arrow.x = 100; // Adjust the X-coordinate of the arrow
arrow.y = 100; // Adjust the Y-coordinate of the arrow
}
0

There are 0 best solutions below