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

【需求】区间条形图(interval)配置的滑块(Slider)支持改变坐标轴刻度间隔 #3776

Closed
1 task
dlspacezero opened this issue Jan 12, 2022 · 3 comments

Comments

@dlspacezero
Copy link

dlspacezero commented Jan 12, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

期望在类似时间条形图( https://g2-v4.antv.vision/zh/examples/bar/basic#time-bar )的图形上,通过slider 改变时间轴的刻度线间隔,而不是截取一段刻度。

What does the proposed API look like?

chart.option('slider', {
type: 'time',
});

@visiky
Copy link
Member

visiky commented Feb 18, 2022

表述不太明确?本意是希望 slider 在做过滤的时候,对应的任务不要被过滤掉是么?

@zhgw01
Copy link

zhgw01 commented May 7, 2022

感觉跟我想要的需求有点类似,开始数据对应的时间跨度比较大,绘制的时候x轴间隔以天为单位,当拖拽slidier缩小范围的时候,过滤后的数据都在一天内,这时候x轴能自动变成小时为间隔就好了,目前g2还是以天为间隔

@hustcc
Copy link
Member

hustcc commented Dec 6, 2022

数据的 x 轴是日期类型,日期类型其实是连续的,所以在 slider 滑动范围的时候,两个日期之间的间距是有变化的。但是当前不会对日期展示的文本有变化。

所以做法有的,但是很难处理精确:判断 slider 当前的 start end,然后根据 start end 的大小,来决定 axis 的格式化方式。

chart.axis('x', { label: { formmatter: () => {} } })

@hustcc hustcc closed this as completed Dec 6, 2022
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

4 participants