Get Free Trial
API reference
Table of contents

amcharts.getMeasureNameByIndex

amcharts.getMeasureNameByIndex(rawData: Object, index: Number)

Returns the name of a measure with the specified index from data for the chart. Use amcharts.getMeasureNameByIndex() to set up the amCharts Value axis.

Parameters

amcharts.getMeasureNameByIndex() has the following parameters:

  • rawData – Object. The raw data that contains the measure name (check out the structure of rawData in getData()). The measures in rawData have the same order as in the slice.
  • index – Number. The index of the measure to get.

Returns

Returns a string representing the name of a measure with the given index.

Example

Here is an example of specifying the amCharts Value axis:

var series = chart.series.push(new am4charts.PieSeries());
series.dataFields.value = pivot.amcharts.getMeasureNameByIndex(rawData, 0);

See also

amcharts.getData
amcharts.getCategoryName
amcharts.getNumberOfMeasures
amcharts.getNumberFormatPattern