meo-canvas
    Preparing search index...

    Interface BaseChartOptions

    Options every chart understands, as v1 spells them.

    interface BaseChartOptions {
        axisColor?: string;
        grid?: { color?: string; show?: boolean };
        innerRadius?: number;
        labelColor?: string;
        labelFontSize?: number;
        legendPosition?: LegendPosition;
        renderLabelItem?: (
            props: { index: number; item: string },
        ) => SceneNode | null | undefined;
        renderLegendItem?: (
            props: {
                color: string;
                index: number;
                item: ChartDataset | PieChartDataPoint;
            },
        ) => SceneNode
        | null
        | undefined;
        renderValueItem?: (
            props: { datasetIndex: number; index: number; item: number },
        ) => SceneNode | null | undefined;
        showLabels?: boolean;
        showLegend?: boolean;
        showValues?: boolean;
        showYAxis?: boolean;
        valueColor?: string;
        valueFontSize?: number;
        xAxisLabelFormatter?: (label: string, index: number) => string;
        yAxisColor?: string;
        yAxisFontSize?: number;
        yAxisLabelFormatter?: (value: number) => string;
    }
    Index
    axisColor?: string

    Colour of the axis rules themselves, as distinct from their text.

    grid?: { color?: string; show?: boolean }

    The horizontal gridlines behind the plot. Absent draws none.

    Type Declaration

    • Optional Readonlycolor?: string

      Their colour.

    • Optional Readonlyshow?: boolean

      Draw them. Absent draws none, so the object alone is not enough.

    innerRadius?: number

    A doughnut's hole, as a fraction of its outer radius.

    v1's outerRadius * (innerRadius ?? 0.6), so the default is the same hole and a caller can change it. Ignored by the other three kinds, as v1 ignores it.

    labelColor?: string

    Colour of the category labels.

    labelFontSize?: number

    Type size for the category labels, in pixels.

    legendPosition?: LegendPosition

    Which side the legend sits on.

    renderLabelItem?: (
        props: { index: number; item: string },
    ) => SceneNode | null | undefined

    Draw the label beside each value yourself.

    The signature is v1's and the contract is not. v1 lays the returned node out detached during painting and draws it at a position derived from its measured size. Here the node is placed — centred on the same point by ordinary layout — so it participates in the scene rather than being measured and discarded.

    renderLegendItem?: (
        props: {
            color: string;
            index: number;
            item: ChartDataset | PieChartDataPoint;
        },
    ) => SceneNode
    | null
    | undefined

    As renderLabelItem, for one legend entry.

    renderValueItem?: (
        props: { datasetIndex: number; index: number; item: number },
    ) => SceneNode | null | undefined

    As renderLabelItem, for the value drawn against each bar.

    showLabels?: boolean

    Draw the category names along the x axis.

    showLegend?: boolean

    Draw the legend. A chart whose series have no label has nothing to put in it.

    showValues?: boolean

    Draw each datum's own number beside it.

    showYAxis?: boolean

    Draw the y axis and its scale.

    valueColor?: string

    Colour of the per-datum values.

    valueFontSize?: number

    Type size for the per-datum values.

    xAxisLabelFormatter?: (label: string, index: number) => string

    Formats a category label before it is drawn. v1 passes the index too.

    yAxisColor?: string

    Colour of the y axis scale text.

    yAxisFontSize?: number

    Type size for the y axis scale.

    yAxisLabelFormatter?: (value: number) => string

    Formats a y axis number before it is drawn — for a unit, a currency or a thousands separator.

    Receives the raw value, so the formatter decides the rounding as well as the text.