antvis / antvis/G2Plot

🤔 [QUESTION] 在绘制折线图时,x轴是时间序列,如何限定区间范围

Open
#3,799 0 comments 0 reactions 0 assignees View on GitHub
Question
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Question description [Please make everyone to understand it]

![image](https://github.com/user-attachments/assets/5a0c2e37-2369-4ac4-9474-1be0693f9d40)

如图所示,我希望只显示 9:30 ~ 11:30 和 13:00 ~ 15:00 两段区间的数据。头尾的限制已经使用min和max限制,中间如何隐藏?

```
meta: {
time: {
type: 'timeCat',
mask: 'HH:mm',
},
},
xAxis: {
nice: false,
type: 'time',
min: startDate.getTime(), // 9:30
max: endDate.getTime(), // 15:00
},
```

### 💻 Link to minimal reproduction

Please provide a link by forking these links [g2plot](https://codesandbox.io/s/g2plot-reproduction-template-gyej1) or GitHub repo. What is a minimal reproduction, and why is it required?

### 🏞 Expected result

### 🚑 Any additional [like screenshots]

* **G2Plot Version**: 2.4.31
* **Platform**: 所有平台

Contributor guide

Open the contributing guide

Research direction

No source file, test, or minimal reproduction is provided. Start by reproducing the time-axis configuration in the linked G2Plot CodeSandbox template, then determine whether discontinuous ranges are supported; done means a documented configuration or a clear limitation or workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.