antvis/G2

trail 支持断开的情况 #5184

pearmini posted onGitHub

Discussed in https://github.com/antvis/G2/discussions/5183

<div type='discussions-op-text'>

<sup>Originally posted by blacksidev98 June 9, 2023</sup> 如下图的折线图能用轨迹表达出来 <img width="694" alt="image" src="https://github.com/antvis/G2/assets/68337739/6b0d6a75-f160-46fb-8769-0f2c9af643de"> 以下是本例的代码

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

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

chart.data({
  type: 'fetch',
  value: 'https://assets.antv.antgroup.com/g2/aapl.json',
});

chart
  .line()
  .encode('x', (d) => new Date(d.date))
  .encode('y', (d) => (new Date(d.date).getUTCMonth() <= 3 ? NaN : d.close))
  .encode('size', 'close')
  // .style('shape', 'trail')

chart.render();

</div>


Fund this Issue

$0.00
Funded

Pull requests