Echarts 相关用例
Echarts 自定义保存为图片按钮的样式及icon, 自定义一个按钮
toolbox: { feature: { saveAsImage: { pixelRatio: 2, title:'下载', icon:'image://https://cache..com/upload/information/20200311/54/208549.jpg' }, myTool1: { show: true, title: '自定义扩展方法1', icon: 'image://https://cache..com/upload/information/20200311/54/208549.jpg', onclick: function (){ alert('myToolHandler1') } } },
Echarts 自定义按钮实现保存图片
$("#button-download").click(function() { var i = myChart.getDataURL({ type:'png', backgroundColor:'white' // 导出的图片分辨率比例,默认为 1。 //pixelRatio: number, }); console.log(i); $(this).attr("href",i); $(this).attr("download","test.png"); });