Skip to content

fixLeftEdge unsupported for space on both sides of the chart #1925

@maxming2333

Description

@maxming2333

Lightweight Charts™ Version: 5.0.6

Steps/code to reproduce:

chart.applyOptions({
  timeScale: {
    fixLeftEdge: true,
    barSpacing: 1,
    minBarSpacing: 0.001,
    maxBarSpacing: 18,
  },
})


timeScale.setVisibleLogicalRange({
    from: -20.5,
    to: 806,
  });

Actual behavior:

The right gap is fine, but the left side is always fixed at the left edge, and the expected gap cannot be achieved.

Expected behavior:

I hope the chart is drawn from left to right, which is why I set fixLeftEdge.
At the same time, it also needs to support the gap on both sides of the chart, so I use the setVisibleLogicalRange recommended by the official to create the gap.

Screenshots:

Image

CodeSandbox/JSFiddle/etc link:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions