Chalkboard - v3.0.1
    Preparing search index...

    Function barplot

    • Plots a bar plot/chart/graph for an array of data with bins specified by another array.

      Parameters

      • arr: number[]

        The data array

      • bins: number[]

        The bins array (must be sorted in ascending order)

      • config: {
            context: CanvasRenderingContext2D;
            fillStyle: string;
            lineWidth: number;
            size: number;
            strokeStyle: string;
            x: number;
            y: number;
        }
        • context: CanvasRenderingContext2D

          Optional custom canvas context to draw on

        • fillStyle: string

          Fill color for bars

        • lineWidth: number

          Stroke width for bars

        • size: number

          Scale, defaults to 1, divided by 100 internally for finer control

        • strokeStyle: string

          Stroke color for bars

        • x: number

          x-offset (canvas translation), defaults to canvas center

        • y: number

          y-offset (canvas translation), defaults to canvas center

      Returns number[][]