You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source height is 0.
HeatmapLayer.js :
update: function(data, width, height, normalize, colorFunc, isInRange) {
......
var canvas = this.canvas;
var ctx = canvas.getContext('2d');
var len = data.length;
canvas.width = width;
canvas.height = height;
......
// colorize the canvas using alpha value and set with gradient
var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
One-line summary [问题简述]
在 react 中封装了 ECharts,初始化时设置 { width: '100%', height: '1px' },通过 width*scale 设置正确
height 后重新渲染。
其他图表都可以正常自适应显示,但是热力图不显示,报错信息:
Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source height is 0.
HeatmapLayer.js :
我发现,在 div height 为 1 时,update 方法中 height 为 0.8 ,canvas.height 却为 0, 赋值的时候是只取整吗?
Version & Environment [版本及环境]
Expected behaviour [期望结果]
请问
ECharts option [ECharts配置项]
option 直接使用的官方实例:热力图 - 全国主要城市空气质量
The text was updated successfully, but these errors were encountered: