Problem with candlestick chart in Flask

I am currently working on multipage app that shows cryptocurrency graph. I got data from https://www.bitstamp.net/api/v2/ohlc/btcusd/, made it into df with pandas, and got needed data (time, open, high, low, close), and transformed it into JSON so js script in my graph.html template could get it. I made similar function in template in script in js (plotly.js is already installed) and made div id=โ€˜graphโ€™ with proper CSS styling. When I load page the graph is not loading, what you can see is just empty space for graph. I tried many ways to handle that, search internet for couple of hours for solution and nothing worked. Take into consideration that function which gets data is in registered blueprint (I do not know if that may be the issue), also Flask app is in function in init.py.

script js function
`var data = JSON.parse(โ€˜{{ make_graph()|safe }}โ€™);

Plotly.newPlot(โ€˜graphโ€™, [{
x: data.x,
close: data.close,
high: data.high,
low: data.low,
open: data.open,
type: โ€˜candlestickโ€™,
xaxis: โ€˜xโ€™,
yaxis: โ€˜yโ€™,
}]);`
pics of make_graph() and init.py


Thank you in advance