Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I need help with python visuals. The following script works fine in jupiter notebook, but I face an issue when passing it to PBI Ithe plotting part). It plots (displays a picture) in a separate HTML page rather than in the framework itself.
Any idea on how to get the picture in the PBI page ?
Thanks in advance. V.
import pandas as pd
from pandas_datareader import data
import pandas_datareader as pdr
import datetime as dt
import seaborn as sns
from dateutil.relativedelta import relativedelta
import pandas_datareader.data as web
import plotly.graph_objects as go
import pandas_datareader.data as web
# getting yahoo data
end = dt.date.today()
start = end - relativedelta(months=3)
df = web.DataReader('AAPL','yahoo',start,end)
df.reset_index(inplace=True)
# polotting it
fig = go.Figure(data=[go.Candlestick(x=df['Date'],
open=df['Open'],
high=df['High'],
low=df['Low'],
close=df['Close'], increasing_line_color= 'cyan', increasing_line_width = 1,decreasing_line_color= 'gray')])
fig.update_layout(title_text='AAPL STOCKS',
title_font_size=20, title_font_color = 'red',
yaxis_title='USD' , yaxis_title_font_color ='black', xaxis_title=' DATE', plot_bgcolor='azure')
fig.update_xaxes(showgrid=True, gridwidth=1, gridcolor='grey')
fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='grey')
fig.show()
You may check if the post below helps.
Hi, thanks for the reply, not quite….. I do not have a problem downloading the data with Python, and even visualizing goes well – the only problem is that it displays it in the separate HTML page rather than the PBI page itself.
V.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |