antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

聚合热力图在拖动图例范围的时候,x、y轴的缩略轴会出现undefined #6218

explorerEzreal posted onGitHub

问题描述

当我拖动热力的范围图例,如果这个范围没有数据,则x、y轴都会变成undefined

重现链接

https://g2.antv.antgroup.com/zh/examples/general/cell/#cell-aggregated

重现步骤

代码 /**

const chart = new Chart({ container: 'container', height: 300, });

const data = [ { "date": "2012-01-01T00:00:00.000Z", "precipitation": 0, "temp_max": 200, "temp_min": 5, "wind": 4.7, "weather": "drizzle" }, { "date": "2012-01-02T00:00:00.000Z", "precipitation": 10.9, "temp_max": 10, "temp_min": 2.8, "wind": 4.5, "weather": "rain" }, { "date": "2012-01-03T00:00:00.000Z", "precipitation": 0.8, "temp_max": 2, "temp_min": 7.2, "wind": 2.3, "weather": "rain" }, { "date": "2012-01-05T00:00:00.000Z", "precipitation": 1.3, "temp_max": 8.9, "temp_min": 2.8, "wind": 6.1, "weather": "rain" }, { "date": "2012-01-06T00:00:00.000Z", "precipitation": 2.5, "temp_max": 4.4, "temp_min": 2.2, "wind": 2.2, "weather": "rain" }, { "date": "2012-01-07T00:00:00.000Z", "precipitation": 0, "temp_max": 7.2, "temp_min": 2.8, "wind": 2.3, "weather": "rain" }, { "date": "2012-01-08T00:00:00.000Z", "precipitation": 0, "temp_max": 10, "temp_min": 2.8, "wind": 2, "weather": "sun" }, ]

chart .cell() .data(data) // .transform({ type: 'group', color: 'max' }) .encode('x', 'date') .encode('y', 'weather') .encode('color', 'temp_max') .slider('x') .slider('y') .style('inset', 0.5) .scale('color', { palette: 'gnBu' }) .animate('enter', { type: 'fadeIn' });

chart.render();

预期行为

预期不应该是undefined,可以为空或者 0

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

<img width="1248" alt="image" src="https://github.com/antvis/G2/assets/84378981/cc5b4d86-eaf4-413f-b9b9-edb966dd9e05">

补充说明(可选)

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests