[Vuejs]-Relative axis values are infinity on drag event AMCHARTS 4 + Vue

0👍

After hours of trying to find the best approach , realized that cursor object is the best way to get reference to axis value accrodingly to current position.

 this.chart.cursor.events.on("cursorpositionchanged", function(ev) {
          var yAxis = ev.target.chart.yAxes.getIndex(0);
          console.log("y: ", yAxis.positionToValue(yAxis.toAxisPosition(ev.target.yPosition)));
      });

https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/

or event on dragging event you can still access

const yAxis = this.chart.yAxes.getIndex(0);
const axisValue = yAxis.positionToValue(yAxis.toAxisPosition(this.chart.cursor.yPosition)

Leave a comment