in src/visual.ts [498:523]
private static createAxesLabels(categoryAxisProperties: DataViewObject,
valueAxisProperties: DataViewObject,
category: DataViewMetadataColumn,
values: DataViewMetadataColumn[]) {
let xAxisLabel = null;
let yAxisLabel = null;
if (categoryAxisProperties) {
// Take the value only if it"s there
if (category && category.displayName) {
xAxisLabel = category.displayName;
}
}
if (valueAxisProperties) {
let valuesNames: string[] = [];
if (values) {
// Take the name from the values, and make it unique because there are sometimes duplications
valuesNames = values.map(v => v ? v.displayName : "").filter((value, index, self) => value !== "" && self.indexOf(value) === index);
yAxisLabel = valueFormatter.formatListAnd(valuesNames);
}
}
return { xAxisLabel, yAxisLabel };
}