@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
27 lines (26 loc) • 927 B
TypeScript
import { DashboardDataResponse } from '../../../types/Metrics';
import { ChartMeasure, VisualisationDefinitionKey } from '../../_dashboards/dashboard-visualisation/types';
export default class ChartLabelsHelper {
/**
* Gets the axis labels
*
* @param {ChartMeasure} measures
* @memberof ChartLabelsHelper
*/
getLabels: (measures: ChartMeasure[]) => string[];
/**
* Gets the dataset label
* Dataset label = the label seen in the legend
*
* @memberof ChartLabels
*/
getDatasetLabel: (keys: VisualisationDefinitionKey[], row: DashboardDataResponse) => string;
/**
* Gets the axis labels when the column values are used
*
* @param {DashboardDataResponse[][]} groups
* @param {string} axisId
* @memberof ChartLabelsHelper
*/
getListLabels: (groups: DashboardDataResponse[][], axisId: string, unitSymbol?: string) => string[];
}