python - 使用 plotly 和 xlwings 将 html 添加到 excel 中
问题描述
我创建了一个生成为 HTML 文件的绘图图。我能够运行脚本并将图表作为 PNG 文件嵌入到 Excel 中。有没有办法将其嵌入为 HTML 文件?
部分代码如下
import xlwings as xw
import pandas as pd
import plotly.graph_objs as go
import plotly.io as pio
fig = dict(data=data, layout=layout)
file = 'filename.png'
pio.write_image(fig, file)
xw.sheets.active.pictures.add(file, name='pyxl', update=True)
解决方案
推荐阅读
- python - 如何在 Odoo 10 中以编辑模式打开现有记录?
- java - 请帮助在 Java 中的 String.split() 方法中转义 NPE 错误
- php - 使用 select sum case 获取输出
- dependency-injection - Typo3 在 null 上调用成员函数
- javascript - 闭包的外部和内部函数中的相同变量
- sql - 在水晶报表中抑制字段的条件
- qt - 如何使用 v3 rest api 从谷歌驱动器下载文件?
- eclipse-che - 如何向 eclipse che 添加新的语言支持
- angular - 对 Observable zip 订阅执行操作
- python-3.x - 如何获取与给定正则表达式匹配的所有 xpath?