javascript - Echarts 库中是否有任何函数可以在 angulajs 中获取 SVG?
问题描述
我正在尝试在 angularjs 中获取 Echarts 元素的SVG,我搜索了很多但没有找到任何有用的解决方案。我需要一些像我在 highchart 中使用的功能:
const chartContainerId = `#targetChart-${id}`;
if ($(chartContainerId).highcharts()) {
chartElementSVG = $(chartContainerId)
.highcharts()
.getSVG();
$(chartContainerId).html(chartElementSVG);
}
我现在正在使用 Echart 库,并希望重构此代码,以检查容器是否为 Echart 元素,如果是则 getSVG。任何帮助请..
解决方案
您可以将较新版本的 eCharts 的渲染器指定为 SVG 而不是画布。
通过 Canvas 或 SVG 渲染 这可能会让您更轻松地提取 svg。
推荐阅读
- momentjs - 使用 Moment 库格式化日期
- javascript - 在 html 中创建表格的脚本未正确放置
- ios - firebase_screen_class 是什么意思
- go - sync.Mutex.Lock 是 FIFO 吗?
- groovy - 带有接收器的 Kotlin 函数参数,从 Groovy 调用
- angular - 向 Spotify API 端点发出请求失败
- javascript - rxjs 将来自 2 个不同可观察对象的 2 个对象组合在一起
- nhibernate - NHibernate 问题:未知的持久类
- r - PDF 和 Excel 样式与闪亮的数据表按钮扩展
- django - 防止从 URL 中删除等号的 URL 编码