antvis/G2

BrushFilter 交互和 Tooltip 交互 crosshairs 消失不见 #4577

pearmini posted onGitHub

brush-tooltip

export async function indicesLineBrushSeries(): Promise<G2Spec> {
  const data = await csv('data/indices.csv', autoType);
  return {
    type: 'view',
    children: [
      {
        type: 'line',
        width: 800,
        paddingLeft: 50,
        data,
        axis: {
          y: { labelAutoRotate: false },
        },
        transform: [{ type: 'normalizeY', basis: 'first', groupBy: 'color' }],
        legend: false,
        encode: {
          x: 'Date',
          y: 'Close',
          color: 'Symbol',
          key: 'Symbol',
          title: (d) => new Date(d.Date).toUTCString(),
        },
      },
    ],
    interactions: [{ type: 'tooltip' }, { type: 'brushXFilter' }],
  };
}

posted by pearmini about 2 years ago

Fund this Issue

$0.00
Funded

Pull requests