antvis/G2

【v5】折线图断掉的地方往后,label 不显示了 #5165

Deathsteps posted onGitHub

问题描述

<img width="1167" alt="image" src="https://github.com/antvis/G2/assets/1549118/c443cd2b-00a9-40d9-bab7-5d50bc438404">

期望结果

线可以断了再续,label 应该也一样

如何重现

官方代码修改

import { Chart } from '@antv/g2';

const data = [
  { time: '10:10', call: 4, waiting: 2, people: 2 },
  { time: '10:15', call: 2, waiting: 6, people: 3 },
  { time: '10:20', call: 13, waiting: 2 },
  { time: '10:25', call: 9, waiting: 9, people: 1 },
  { time: '10:30', call: 5, waiting: 2, people: 3 },
  { time: '10:35', call: 8, waiting: 2, people: 1 },
  { time: '10:40', call: 13, waiting: 1, people: 2 },
];

const chart = new Chart({
  container: 'container',
  theme: 'classic',
  autoFit: true,
});

chart.data(data);

chart
  .line()
  .encode('x', 'time')
  .encode('y', 'people')
  .encode('shape', 'smooth')
  .label({ text: 'people' });

chart.render();

额外信息

  • G2 5.0.11

https://github.com/antvis/G2#L105-L107

这里 concat 第二个参数有问题。

posted by hustcc almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests