Question
Hello All,
Im using Xubuntu version 26:
Distributor ID: Ubuntu
Description: Ubuntu 26.04 LTS
Release: 26.04
Codename: resolute
In this os, while running a code to make a chart, I get error in the way candles are assigned time.
Case 1:
I used AAPL stock data from Yfinance, even though candles are of different dates, Im shown candles with date 21 Jan 1970, and candles varying in minutes.
Here is the code that I have used:
`import pandas as pd
from lightweight_charts import Chart
if name == 'main':
chart = Chart()
df = pd.read_csv('aapl.csv')
chart.set(df)
chart.show(block=True)`
and the output that I get is as below:
Here is the file aapl.csv:
aapl.csv
Case 2:
Here I have used personal data which contains time in timestamp. In this case, all candles are superimposed on top of each other, result is I get a single candle. What I suspect is that all candles are of same time 1 Jan 1970, which causes it to come on top of the previous one.
Code:
`import pandas as pd
from lightweight_charts import Chart
if name == 'main':
chart = Chart()
df = pd.read_csv('../data.csv')
df['time'] = pd.to_datetime(df['time'], unit = 's')
chart.set(df)
chart.show(block=True)`
The output in this case is as below:
The data file data.csv is as below:
data.csv
Python version: 3.14
Lightweight_charts version: 2.1
(eryan) eryan@eryan:~/Desktop/popaPig/pythonLightWeightCharts/test$ python --version
Python 3.14.4
(eryan) eryan@eryan:~/Desktop/popaPig/pythonLightWeightCharts/test$ pip show lightweight-charts
Name: lightweight-charts
Version: 2.1
Summary: Python framework for TradingView's Lightweight Charts JavaScript library.
Home-page: https://github.com/louisnw01/lightweight-charts-python
Author: louisnw
Author-email:
License: MIT
Location: /home/eryan/Desktop/popaPig/eryan/lib/python3.14/site-packages
Requires: pandas, pywebview
Required-by:
The same code works fine in Windows, Please suggest me the errors that might be behind this behaviour.
Thanks for the help.
Regards,
Aryan.
Code example
Question
Hello All,
Im using Xubuntu version 26:
Distributor ID: Ubuntu
Description: Ubuntu 26.04 LTS
Release: 26.04
Codename: resolute
In this os, while running a code to make a chart, I get error in the way candles are assigned time.
Case 1:
I used AAPL stock data from Yfinance, even though candles are of different dates, Im shown candles with date 21 Jan 1970, and candles varying in minutes.
Here is the code that I have used:
`import pandas as pd
from lightweight_charts import Chart
if name == 'main':
and the output that I get is as below:
Here is the file aapl.csv:
aapl.csv
Case 2:
Here I have used personal data which contains time in timestamp. In this case, all candles are superimposed on top of each other, result is I get a single candle. What I suspect is that all candles are of same time 1 Jan 1970, which causes it to come on top of the previous one.
Code:
`import pandas as pd
from lightweight_charts import Chart
if name == 'main':
The output in this case is as below:
The data file data.csv is as below:
data.csv
Python version: 3.14
Lightweight_charts version: 2.1
The same code works fine in Windows, Please suggest me the errors that might be behind this behaviour.
Thanks for the help.
Regards,
Aryan.
Code example