@swimlane/ngx-charts
Version:
Declarative Charting Framework for Angular2 and beyond!
15 lines (12 loc) • 373 B
text/typescript
import * as moment from 'moment';
export function tickFormat(fieldType, groupByType): Function {
return function(label: string): string {
if (label === 'No Value' || label === 'Other') {
return label;
}
if (fieldType === 'date' && groupByType === 'groupBy') {
return moment(label).format('MM/DD/YYYY');
}
return label.toString();
};
}