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

Bug Multiview 的annotation没效果 #3363

Closed
SerenaLin2020 opened this issue Apr 7, 2021 · 1 comment
Closed

Bug Multiview 的annotation没效果 #3363

SerenaLin2020 opened this issue Apr 7, 2021 · 1 comment

Comments

@SerenaLin2020
Copy link

  • 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, 但是没有效果

@visiky
Copy link
Member

visiky commented Apr 7, 2021

提交到 G2Plot

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

2 participants