Search code examples
javascriptangulartypescriptchartsamcharts

Get X value from stacked series barchat on typescript - amCharts


I need to retrieve the value of the XAxis on typescript

enter image description here

Actually I tried using adapter in this way, but value is filled with {valueX}

this.series.adapter.add( 'tooltipText', (value:any , target) => {
  var ticks: number = (value) as number;
  return value; //this return {valueX}
});

I need the exact value that is showing on chart (for example 34,590,000,000), not the tooltipText template


Solution

  • I resolved in this way 😃

    this.series.adapter.add( 'tooltipText', (text: string, target) => {
      var value = target.tooltipDataItem.values.valueX.value;
      return value;
    });