Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
victoriavd
Frequent Visitor

Python visuals plotting graph_objects

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()

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@victoriavd 

 

You may check if the post below helps.

https://community.powerbi.com/t5/Desktop/how-to-download-daily-stock-prices-in-a-calculated-table/m-...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.