提问人:Sheldon 提问时间:9/29/2023 更新时间:9/29/2023 访问量:26
如何使用 iPhone 的文件应用程序可视化使用 plotly.graph_objects 创建的 html 文件?
How to visualize an html file created using plotly.graph_objects using an iPhone's File App?
问:
我正在创建html报告,并将其作为电子邮件附件发送给自己。
我使用 plotly.graph_objects 函数来创建这些 html 文件。
这些可以在使用网络浏览器(例如Firefox)下载时可视化。但是,在我的 iPhone 上下载它们时,我无法使用文件应用程序可视化它们。write_html
下面是一个示例脚本:
import pandas as pd
import plotly.graph_objects as go
import numpy as np
def create_report(df):
## PIE CHART
mypiechart = go.Pie(labels=df.B.unique(), values=df.groupby('B').count()['A'].astype('int').to_list())
fig = go.Figure()
fig.add_trace(
mypiechart
)
fig.update_layout(
height=800,
width=1400,
bargap=0.15,
bargroupgap=0.1,
barmode="stack",
hovermode="x",
margin=dict(r=1, l=1, b=1, t=100))
fig.write_html("report.html")
return
df = pd.DataFrame()
df['A'] = np.random.randn(10)
df['B'] = ['Category1','Category1','Category1','Category2','Category1','Category1','Category2','Category1','Category1','Category1']
create_report(df)
这是上述代码输出的报告:
如何使用文件应用程序可视化这些文件?
答: 暂无答案
评论