Skip to content

Incorrect applied logical time range #1924

@kirchet

Description

@kirchet

Lightweight Charts™ Version: 5.0.8

Steps/code to reproduce:

const chart = LightweightCharts.createChart(
  document.body,
   {
      width: 400,
      height: 300,
      timeScale: {
        minBarSpacing: 0,
        maxBarSpacing: 100000,
      }
    },
  );
const lineSeries = chart.addSeries(LightweightCharts.LineSeries);
lineSeries.setData([
    { time: '2019-04-11', value: 80.01 },
    { time: '2019-04-12', value: 96.63 },
]);

chart.timeScale().setVisibleLogicalRange({ from: 0.49, to: 0.51 })

Actual behavior:

Provided logical range is applied incorrectly

Expected behavior:

Provided logical range is applied as expected

Screenshots:

Image

CodeSandbox/JSFiddle/etc link:

https://jsfiddle.net/kirchet/8gxu17zc/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected problem or unintended behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions