Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
explorerEzreal opened this issue May 7, 2024 · 0 comments

Comments

@explorerEzreal
Copy link

问题描述

当我拖动热力的范围图例,如果这个范围没有数据,则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]

屏幕截图或视频(可选)

image

补充说明(可选)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant