ixfx
    Preparing search index...

    Class CartesianCanvasPlot

    Simple plotting of cartesian values.

    Create a plot that fills screen

    const p = Plot.insert({fill`viewport});
    const dataSet = p.dataSet;

    // Add data
    ds.add({ x: 1, y: 2 });

    // Draw
    p.draw();

    Create a plot that fills a container

    const p = Plot.insert({parent:`#someel`});
    

    Add data using the created data set


    // Add a value to the `alpha` series
    p.dataSet.add({x:1,y:1}, `alpha`);

    Set default series formatting

    p.setMeta(`default`, {
    colour: `hsl(50,100%,50%)`,
    lineWidth: 10
    });

    Series can have metadata associated with it in the DataSet

    // Use 'pink' by default for the series 'alpha'
    p.setMeta(`alpha`, { colour: `pink` });

    Constructors

    Properties

    actualDataRange: Geometry.RectPositioned = Rects.EmptyPositioned
    axisRounder: (v: number) => number = ...
    onInvalidated: undefined | () => void
    overlayLines: (Geometry.Line & LineStyle)[] = []

    List of lines to draw after drawing everything else. Lines are given in value-coordinate space

    visibleRange: Geometry.RectPositioned = Rects.PlaceholderPositioned
    whiskerLength: number

    Accessors

    Methods

    • Returns void

    • Draws a line in value-coordinate space

      Parameters

      Returns void

    • When range is auto, returns the range of the data Otherwise returns the user-provided range.

      Returns PointMinMax

    • Returns void

    • Positions an element at the viewport location of data point. Ensure the element has position:absolute set.

      Parameters

      • data: Geometry.Point
      • elementToPosition: string | HTMLElement
      • by: "middle" | "top-left" = ...
      • OptionalrelativeToQuery: string | HTMLElement

      Returns void

    • Parameters

      Returns void

    • Parameters

      Returns { x: number; y: number; z?: number }

    • Parameters

      Returns { x: number; y: number }