antvis / antvis/G2Plot

[BUG] Multiview 添加 regionFilter annotation 后没有效果

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

Description

* **G2 Version**: 4.1.0
* **Platform**: macOS
* **Mini Showcase(like screenshots)**:
*
Screen Shot 2021-04-07 at 3 34 00 PM

* **Steps to reporduce**:
1. open https://g2plot.antv.vision/zh/examples/plugin/multi-view#range-area
2. paste the following code to this website

```
import { MultiView } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/antfincdn/qE48lpzwRc/range-area-data.json')
.then((data) => data.json())
.then((data) => {
const { area: data1, line: data2 } = data;
const rangeAreaPlot = new MultiView('container', {
appendPadding: 8,
syncViewPadding: true,
tooltip: { shared: true, showMarkers: false, showCrosshairs: true, offsetY: -50 },
views: [
{
data: data1,
axes: {},
meta: {
time: {
type: 'time',
mask: 'YYYY-MM-DD',
nice: true,
tickInterval: 24 * 3600 * 1000 * 2,
range: [0, 1],
},
temperature: {
nice: true,
sync: true,
alias: '温度范围',
},
},
// view1: prepare a area plot, mapping position to `time*temperature`
geometries: [
{
type: 'area',
xField: 'time',
yField: 'temperature',
mapping: {},
},
]
},
{
data: data2,
axes: false,
meta: {
time: {
type: 'time',
mask: 'YYY-MM-DD',
nice: true,
tickInterval: 24 * 3600 * 1000 * 2,
range: [0, 1],
},
temperature: {
sync: 'temperature',
alias: '温度',
},
},
// view2: prepare a line plot and point plot, mapping position to `time*temperature` (share data)
geometries: [
{
type: 'line',
xField: 'time',
yField: 'temperature',
mapping: {},
},
{
type: 'point',
xField: 'time',
yField: 'temperature',
mapping: {
shape: 'circle',
style: {
fillOpacity: 1,
},
},
},
],

annotations: [
{
type: 'regionFilter',
start: ['2009-07-01', '22'],
end: ['2009-07-29', '0'],
color: 'red',
},
]
},
],
});

// Step 3: 渲染图表
rangeAreaPlot.render();
});

```

已经配置了line view的annotations, 但是没有效果

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the G2Plot MultiView range-area example using the supplied configuration, then inspect how the line view handles its regionFilter annotation. Confirm the annotation is rendered with the configured start, end, and color, and verify the behavior in the example after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.