i'm trying to embed an interactive plotly (or bokeh) plot into excel.
To do this I've tried:
- embed a Microsoft Web Browser UserForm into excel, following:
This works and enables both online and offline html to be loaded
- creating a plotly html
'''
import plotly
import plotly.graph_objects as go
x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y = [i**2 for i in x]
fig = go.Figure()
fig.add_trace(go.Scatter(x=x, y=x, mode='markers', name="y=x", marker=dict(color='royalblue', size=8)))
fig.add_trace(go.Scatter(x=x, y=y, name="y=x^2", line=dict(width=3)))
plotly.offline.plot(fig, filename='C:/Users/.../pythonProject/test1.html')
- repointing the webbrowser object in excel using
.Navigate
to the local plotly.html. Banner pops up with
".... restricted this file from showing active content that could access your computer"
clicking on the banner, i run into this error:
The same HTML can be opened in a browser.
Anyway to show interactive plots in excel?
Many thanks,
dusio
from embed plotly in excel
No comments:
Post a Comment