meo-canvas
    Preparing search index...

    Function linePoints

    • Where each point of a line series sits, as fractions of the plot.

      x = index / (labels - 1)     v1: chartX + index * (chartWidth / (labels - 1))
      y = 1 - value / maxValue     v1: chartY + h - (value / maxValue) * h
      

      Points span edge to edge, where bars are centred in slots — v1 divides by labels - 1 here and by labels there, so the first and last points sit on the plot's edges rather than inset. A single label has no span to divide, so v1 divides by one and the point sits at the left edge.

      Parameters

      • labels: number
      • values: readonly number[]
      • maxValue: number

      Returns { x: number; y: number }[]

      • x: number

        Distance across the plot, as a fraction of its width.

      • y: number

        Distance down the plot, as a fraction of its height.

        Inverted from the value: 0 is the top of the plot and 1 the bottom, so a point can be placed without the caller flipping it. A maximum of zero puts every point on the floor rather than dividing by it.