Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Value is null error while set the data is container has 0x0 size #821

Closed
timocov opened this issue Aug 20, 2021 · 2 comments · Fixed by #822
Closed

Error: Value is null error while set the data is container has 0x0 size #821

timocov opened this issue Aug 20, 2021 · 2 comments · Fixed by #822
Assignees
Labels
bug Unexpected problem or unintended behavior.
Milestone

Comments

@timocov
Copy link
Contributor

timocov commented Aug 20, 2021

Lightweight Charts Version: 3.5.0

Steps/code to reproduce:

<div id="container" style="width: 0; height: 0;"></div>
const chart = LightweightCharts.createChart(document.getElementById('container'), {
	  timeScale: {
		  fixLeftEdge: true,
	  },
});

chart.addLineSeries().setData([ { time: 0, value: 10 } ]);

Actual behavior:

Error in the console:

lightweight-charts.standalone.development.js:137 Uncaught Error: Value is null
    at ensureNotNull (lightweight-charts.standalone.development.js:137)
    at TimeScale._private__doFixLeftEdge (lightweight-charts.standalone.development.js:3347)
    at TimeScale._internal_setBaseIndex (lightweight-charts.standalone.development.js:3003)
    at ChartModel._internal_updateTimeScale (lightweight-charts.standalone.development.js:6940)
    at ChartApi._private__sendUpdateToChart (lightweight-charts.standalone.development.js:10882)
    at ChartApi._internal_applyNewData (lightweight-charts.standalone.development.js:10844)
    at SeriesApi.setData (lightweight-charts.standalone.development.js:10275)

Expected behavior:

No errors and nothing is displayed.

CodeSandbox/JSFiddle/etc link:

https://jsfiddle.net/qg1h9k0p/

@timocov timocov added the bug Unexpected problem or unintended behavior. label Aug 20, 2021
@timocov timocov self-assigned this Aug 20, 2021
timocov added a commit that referenced this issue Aug 20, 2021
Even if we have firstIndex value, it doesn't mean that visibleRange will not but null.

Fixes #821
@timocov timocov added this to the 3.6 milestone Aug 24, 2021
@supriyakhankarnw18
Copy link

@timocov when this fix will be available?

@timocov
Copy link
Contributor Author

timocov commented Aug 25, 2021

@supriyakhankarnw18 we need to prepare a new release. you can subscribe on new releases here on github to be notified when the new version is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants