Get Free Trial
API reference
Table of contents

amcharts.getCategoryName

amcharts.getCategoryName(rawData: Object)

Returns the name of a field that represents a category in data for the chart. It is needed to set up the amCharts Category axis

Parameters
amcharts.getCategoryName() has the following parameter:

  • rawData – Object. Raw data that contains the category (check out the structure of rawData in getData()).

Returns

Returns a string, which is the name of a field representing a category in the chart’s data.

Example

Here is an example of setting the name for the amCharts Category axis:

var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
categoryAxis.dataFields.category = pivot.amcharts.getCategoryName(rawData);

See also

amcharts.getData
amcharts.getMeasureNameByIndex
amcharts.getNumberOfMeasures
amcharts.getNumberFormatPattern