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

[v5] 面积图在 transpose 坐标系下绘制不出来 #4530

Closed
visiky opened this issue Dec 28, 2022 · 0 comments · Fixed by #4536
Closed

[v5] 面积图在 transpose 坐标系下绘制不出来 #4530

visiky opened this issue Dec 28, 2022 · 0 comments · Fixed by #4536
Assignees
Labels

Comments

@visiky
Copy link
Member

visiky commented Dec 28, 2022

描述

  • 不开启 chart.coordinate([{type:'transpose'}]), 面积图正常绘制。开启之后,面积图绘制不出来
期望 现状
image image

代码

/**
 * A recreation of this demo: https://www.anychart.com/zh/products/anychart/gallery/Combined_Charts/Range_Spline-Area,_Spline_and_Marker_Chart.php
 */
import { Chart } from '@antv/g2';

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

chart.data(getData())

chart.coordinate([{type:'transpose'}])

chart
  .area()
  .encode('x', d => new Date(d[0]))
  .encode('y', d => d[1])
  .encode('shape', 'smooth')
  .style('fillOpacity', 0.45)
  .style('fill', '#64b5f6')

chart
  .point()
  .encode('x', d => new Date(d[0]))
  .encode('y', d => d[1])

chart
  .line()
  .encode('shape', 'smooth')
  .encode('x',  d => new Date(d[0]))
  .encode('y', d => d[1])

chart.render();

function getData() {
  return [
    ['2015/9/01', 10],
    ['2015/9/02', 12],
    ['2015/9/03', 11],
    ['2015/9/04', 15],
    ['2015/9/05', 20],
    ['2015/9/06', 22],
    ['2015/9/07', 21],
    ['2015/9/08', 25],
    ['2015/9/09', 31],
    ['2015/9/10', 32],
    ['2015/9/11', 28],
    ['2015/9/12', 29],
    ['2015/9/13', 40],
    ['2015/9/14', 41],
    ['2015/9/15', 45],
    ['2015/9/16', 50],
    ['2015/9/17', 65],
    ['2015/9/18', 45],
    ['2015/9/19', 50],
    ['2015/9/20', 51],
    ['2015/9/21', 65],
    ['2015/9/22', 60],
    ['2015/9/23', 62],
    ['2015/9/24', 65],
    ['2015/9/25', 45],
    ['2015/9/26', 55],
    ['2015/9/27', 59],
    ['2015/9/28', 52],
    ['2015/9/29', 53],
    ['2015/9/30', 40]
  ];
}
@visiky visiky added the V5 label Dec 28, 2022
@hustcc hustcc self-assigned this Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants