trash-and-fire / svelte-lightweight-charts

Svelte wrapper for financial lightweight charts
MIT License
106 stars 13 forks source link

Lineseries: Uncaught Error: Value is null #66

Closed IamNomadSauce closed 1 year ago

IamNomadSauce commented 1 year ago

I am having a problem where it is returning a null value, this is the data Im using. I dont see why its a problem, I have also tried converting the dateformat.

let temp_data = [
        {time: 1661126400000, value: 19510}, 
        {time: 1662336000000, value: 21850}, 
        {time: 1662336000000, value: 18500}, 
        {time: 1662940800000, value: 22794}, 
        {time: 1663545600000, value: 18120}, 
        {time: 1664755200000, value: 20442}, 
        {time: 1665360000000, value: 18156}, 
        {time: 1668988800000, value: 15459}, 
        {time: 1670803200000, value: 18350}, 
        {time: 1667174400000, value: 21466}, 
        {time: 1671408000000, value: 16230}, 
        {time: 1675036800000, value: 24284}, 
        {time: 1675641600000, value: 21451}, 
        {time: 1676246400000, value: 25262}, 
        {time: 1676246400000, value: 21325}
    ]
<Chart 
            {...options} 
            >
<LineSeries 
                        data={temp_data}
                        priceScaleId="right"
                        color="rgba(4, 111, 232, 1)"
                        lineWidth={2}
                        />

        </Chart>
trash-and-fire commented 1 year ago

Can you create a minimal reproduction in the REPL: https://svelte.dev/repl ?

IamNomadSauce commented 1 year ago

I ended up fixing it by converting the time data into the y-m-d format instead of milliseconds