-
Notifications
You must be signed in to change notification settings - Fork 4
Unexpected behaviour is_stock_chart = True #67
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hello @hcpchris,
I wanted to open the issue as i have found what seems to be some strange behaviour with the is_stock_chart = True variable.
Here are 3 cases:
First case generates no issue:
import pandas as pd
import numpy as np
from highcharts_stock.chart import Chart
start_date = '2020-01-01'
end_date = '2024-01-01'
df = pd.DataFrame(pd.date_range(start = start_date, end = end_date))
df = df.rename(columns = {0: "date"} )
df['number'] = 1
#df['date'] = df['date'].astype(np.int64) // 10**6
chart.is_stock_chart = True
chart = Chart.from_pandas(df, series_type = 'line', property_map = {
'x': 'date',
'y': "number"
},
options_kwargs = chart_options )
#chart.is_stock_chart = True
chart.display() Second case generates an issue:
import pandas as pd
import numpy as np
from highcharts_stock.chart import Chart
start_date = '2020-01-01'
end_date = '2024-01-01'
df = pd.DataFrame(pd.date_range(start = start_date, end = end_date))
df = df.rename(columns = {0: "date"} )
df['number'] = 1
#df['date'] = df['date'].astype(np.int64) // 10**6
#chart.is_stock_chart = True
chart = Chart.from_pandas(df, series_type = 'line', property_map = {
'x': 'date',
'y': "number"
},
options_kwargs = chart_options )
chart.is_stock_chart = True
chart.display()I get the following generic error:
Something went wrong with the Highcharts.js script. It should have been automatically loaded, but it did not load for over 5 seconds. Check your internet connection, and then if the problem persists please reach out for support. (You can also check your browser's console log for more details.)
Detailed Error Message:
x[p] is undefined
Third case no issue:
import pandas as pd
import numpy as np
from highcharts_stock.chart import Chart
start_date = '2020-01-01'
end_date = '2024-01-01'
df = pd.DataFrame(pd.date_range(start = start_date, end = end_date))
df = df.rename(columns = {0: "date"} )
df['number'] = 1
df['date'] = df['date'].astype(np.int64) // 10**6
#chart.is_stock_chart = True
chart = Chart.from_pandas(df, series_type = 'line', property_map = {
'x': 'date',
'y': "number"
},
options_kwargs = chart_options )
chart.is_stock_chart = True
chart.display()I believe there might be some sort of edge case not delt correctly somewhere in the code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
