UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

51 lines (45 loc) 911 B
import { getAllCategories, getPointSeries } from "../utils/chart"; import { DHIS2Chart } from "./index"; export class DHIS2ColumnChart extends DHIS2Chart { getCategories() { return undefined; } getHighchartsType() { return "column"; } getPlotOptions() { return { column: { dataLabels: { enabled: true } } }; } getSeries() { return getPointSeries(this.analytics, this.config, "column"); } getXAxis() { return { type: "category", categories: getAllCategories(this.analytics, this.config), crosshair: true, labels: { enabled: true }, title: { text: "" } }; } } export class DHIS2StackedColumnChart extends DHIS2ColumnChart { getPlotOptions() { return { column: { stacking: "normal", ...super.getPlotOptions().column } }; } }