控制台報錯: 不支持顏色:none
解決辦法:參考 https://developers.weixin.qq.com/community/enterprisewechat/doc/0000c66e358490a3e89c7a7fc56400 下的回答
在 echarts 的 ec-canvas 目錄下應該有一個 wx-canvas.js 文件,這個文件里應該提供了一個類,里面在初始化化會執行一個 _initStyle 方法,可以在這個方法中加入下面這段代碼:
var styles = [ "fillStyle", "strokeStyle", "globalAlpha", "textAlign", "textBaseAlign", "shadow", "lineWidth", "lineCap", "lineJoin", "lineDash", "miterLimit", "fontSize", ]; styles.forEach((style) => { Object.defineProperty(ctx, style, { set: (value) => { if ( (style !== "fillStyle" && style !== "strokeStyle") || (value !== "none" && value !== null) ) { ctx["set" + style.charAt(0).toUpperCase() + style.slice(1)](value); } }, }); });
已解決