question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught Error: Value is null

See original GitHub issue

Lightweight Charts Version: 3.1.3

I am using your chart for the cryptocurrency trade application in Vue project but no matter what I get this error below is a sample code

There is no duplicated or null data.

import {createChart} from "lightweight-charts";
export default {
data() {
return {
                chartProperties: {
                  width: 700,
                  height: 300,
                  timeScale: {
                     timeVisible: true,
                     secondsVisible: false
                },
                layout: {
                    //backgroundColor: '#262C49', //Dark Theme
                    //textColor: '#80859E',
                    fontSize: 12,
                    fontFamily: 'irsans ,Calibri'
                }
            },
            chartData: [],
            candleSeries: null,
}
}
mounted() {

let cdata = [
{
close: 22750.76
high: 22759.53
low: 22750.25
open: 22752.8
time: 1608635340
},
....
];

this.chartElement = document.getElementById('chart');
this.chartProperties.width = this.chartElement.offsetWidth;
this.chart = createChart(this.chartElement, this.chartProperties);
this.candleSeries = this.chart.addCandlestickSeries();

this.candleSeries.setData(cdata);

Actual behavior:

The chart is drawn with no candlestick

chart1

and repeated error of Uncaught Error: Value is null

chart2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
timocovcommented, Dec 22, 2020

https://api.huobi.pro/market/history/kline?period=1min&symbol=btcusdt

data should be ordered by time in asc order, not in desc.

1reaction
inji-kimcommented, Jun 8, 2021

@miladganjali thanks, I have solve it.

const sortedData = data.sort((a, b) => a.time - b.time);

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'value' of null
It has no problem when I execute this codes, but when I'm on other part of my codes this error occurs. Uncaught TypeError:...
Read more >
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
Uncaught Error: value is null · Issue #859 - GitHub
Uncaught Error: value is null #859 ... No candles displayed and error displayed in console. Expected behavior: Candles to be displayed.
Read more >
How to Fix TypeError: Null is Not an Object in JavaScript
The JavaScript error TypeError: null is not an object occurs when a property is accessed or a method is called on a null...
Read more >
TypeError: Cannot read property 'value' of Null in JS
To solve the "Cannot read property 'value' of null" error, make sure that the JS script tag is placed at the bottom of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found