WebDataRocks End User License Agreement (“Agreement”) has been revised and is effective as of April 18, 2024.
The following modifications have been made:
The modified version of WebDataRocks End User License Agreement is available here.
Downloading, installing, and/or continuing to use WebDataRocks after April 18, 2024, constitutes your acceptance of the terms and conditions of the modified version of WebDataRocks End User License Agreement. If you do not agree to any of these terms and conditions, do not download, install, use, or access (or continue to access) WebDataRocks.
webdatarocks.amcharts.getNumberOfMeasures(rawData: Object): Number
Returns the total number of measures that are specified in the data slice.
The common use case is to use this method in a for-loop when creating multiple series for a certain type of chart. Often used together with the amcharts.getMeasureNameByIndex()
method.
1) Here is an example of how to configure the series for a stacked bar chart using amcharts.getNumberOfMeasures()
, amcharts.getMeasureNameByIndex()
, and amcharts.getCategoryName()
:
/* Create and configure series for a stacked bar chart */ for (s = 0; s < pivot.amcharts.getNumberOfMeasures(rawData); s++) { var series = chart.series.push(new am4charts.ColumnSeries()); series.dataFields.valueX = pivot.amcharts.getMeasureNameByIndex(rawData, s); series.dataFields.categoryY = pivot.amcharts.getCategoryName(rawData); series.stacked = true; series.name = pivot.amcharts.getMeasureNameByIndex(rawData, s); var labelBullet = series.bullets.push(new am4charts.LabelBullet()); labelBullet.locationX = 0.5; labelBullet.label.text = "{valueX}"; labelBullet.label.fill = am4core.color("#fff"); }