zrender icon indicating copy to clipboard operation
zrender copied to clipboard

自定义图例icon页面卡死

Open erjun opened this issue 4 years ago • 3 comments

我用的版本号是5.1.1,不过5.1.2应该也有问题。 在官网的实例也能复现。

option = { title: { text: '折线图堆叠' }, tooltip: { trigger: 'axis' }, legend: { data: [{ name:'邮件营销', icon:'path://<svg t="1595383875026" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1434" width="200" height="200"><path d="M921.6 563.2H102.4c-30.72 0-51.2-20.48-51.2-51.2s20.48-51.2 51.2-51.2h819.2c30.72 0 51.2 20.48 51.2 51.2s-20.48 51.2-51.2 51.2z" p-id="1435"></path></svg>' }, '联盟广告', '视频广告', '直接访问', '搜索引擎'] }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, toolbox: { feature: { saveAsImage: {} } }, xAxis: { type: 'category', boundaryGap: false, data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'] }, yAxis: { type: 'value' }, series: [ { name: '邮件营销', type: 'line', stack: '总量', data: [120, 132, 101, 134, 90, 230, 210] }, { name: '联盟广告', type: 'line', stack: '总量', data: [220, 182, 191, 234, 290, 330, 310] }, { name: '视频广告', type: 'line', stack: '总量', data: [150, 232, 201, 154, 190, 330, 410] }, { name: '直接访问', type: 'line', stack: '总量', data: [320, 332, 301, 334, 390, 330, 320] }, { name: '搜索引擎', type: 'line', stack: '总量', data: [820, 932, 901, 934, 1290, 1330, 1320] } ] }; 重点是这个: icon:'path://<svg t="1595383875026" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1434" width="200" height="200"><path d="M921.6 563.2H102.4c-30.72 0-51.2-20.48-51.2-51.2s20.48-51.2 51.2-51.2h819.2c30.72 0 51.2 20.48 51.2 51.2s-20.48 51.2-51.2 51.2z" p-id="1435"></path></svg>'

erjun avatar Jun 15 '21 02:06 erjun

path 后格式不对,只支持路径 M921.6 563.2H102.4c...,不支持 svg 标签。

plainheart avatar Jun 16 '21 00:06 plainheart

path 后格式不对,只支持路径 M921.6 563.2H102.4c...,不支持 svg 标签。

以前是支持的,我升级到最新的后才有问题。。。

erjun avatar Jun 16 '21 03:06 erjun

以前是哪个版本?方便在 https://www.makeapie.com/editor.html 给个例子吗?

plainheart avatar Jun 18 '21 00:06 plainheart