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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
guilhermesilva
Regular Visitor

Power BI shows plotly graph in the browser instead of Power BI framework with python

Hi There!

Right now I can use plotly with Power BI via Python. 

However, it shows the graph in another window:

guilhermesilva_0-1642538579974.png

Inside of Power BI I get this:

guilhermesilva_1-1642538611375.png

It says: It is not possible to show this visual. No Image was created. Check whether your Python script results in a standard device graph of Python.

 

Here is my code:

 

# dataset = pandas.DataFrame(Predito_Acumulado, Predito_Acumulado_l, Predito_Acumulado_u, DT_CONTATO)
# dataset = dataset.drop_duplicates()
# Cole ou digite aqui seu código de script:
baux = dataset
import plotly.graph_objs as go

fig = go.Figure([
    
    go.Scatter(
        name='Máximo',
        x=baux['DT_CONTATO'],
        y=baux['Predito_Acumulado'],
        mode='lines',
        line=dict(color='rgb(31, 119, 180)'),
    ),
    go.Scatter(
        name='Predição',
        x=baux['DT_CONTATO'],
        y=baux['Predito_Acumulado_u'],
        mode='lines',
        marker=dict(color="#444"),
        line=dict(width=0),
        showlegend=False
    ),
    go.Scatter(
        name='Mínimo',
        x=baux['DT_CONTATO'],
        y=baux['Predito_Acumulado_l'],
        marker=dict(color="#444"),
        line=dict(width=0),
        mode='lines',
        fillcolor='rgba(68, 68, 68, 0.3)',
        fill='tonexty',
        showlegend=False
    )
])
fig.update_layout(
    yaxis_title='Número de Matrículas',
    hovermode="x"
)
fig.show()

 

Thanks!!

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @guilhermesilva 

 

Check this in the doc:

  • Only plots that are plotted to the Python default display device are displayed correctly on the canvas. Avoid explicitly using a different Python display device.

vjaneygmsft_0-1642746011485.png

I'm not good at Python, I suggest you test whether a simple graph can be displayed normally, if not, you can rule out the code problem.

Make sure you have properly configured the python script:

Use an external Python IDE with Power BI - Power BI | Microsoft Docs

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @guilhermesilva 

 

Check this in the doc:

  • Only plots that are plotted to the Python default display device are displayed correctly on the canvas. Avoid explicitly using a different Python display device.

vjaneygmsft_0-1642746011485.png

I'm not good at Python, I suggest you test whether a simple graph can be displayed normally, if not, you can rule out the code problem.

Make sure you have properly configured the python script:

Use an external Python IDE with Power BI - Power BI | Microsoft Docs

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors