Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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]分面图旋转子视图的时候坐标轴显示错误 #5616

Closed
yuanyongbin opened this issue Oct 8, 2023 · 0 comments
Closed

[BUG]分面图旋转子视图的时候坐标轴显示错误 #5616

yuanyongbin opened this issue Oct 8, 2023 · 0 comments

Comments

@yuanyongbin
Copy link

yuanyongbin commented Oct 8, 2023

复现步骤:

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

fetch("https://assets.antv.antgroup.com/g2/barley.json")
  .then((res) => res.json())
  .then((data) => {
    const chart = new Chart({
      container: "container",
      height: 1000,
      width: 1300,
      paddingLeft: 140,
      paddingRight: 130,
      paddingBottom: 60,
      frame: false
    });

    const facetRect = chart
      .facetRect()
      .data(data)
      .encode("y", "site")
      .encode("x", "variety");

    facetRect
      .interval()
      .scale("color", { type: "ordinal" })
      .encode("x", "year")
      .encode("y", "yield")
      .coordinate({ transform: [{ type: "transpose" }] });  // 关键: 图形旋转

    chart.render();
  });

给子视图设置了: coordinate({ transform: [{ type: "transpose" }] }); 后 x、y 轴显示错误。

预期结果

  1. 最后一行显示 x 轴, 第一列显示 y 轴。
  2. 可以让用户自己控制坐标轴的显示呢?
@yuanyongbin yuanyongbin changed the title 分面图旋转子视图的时候坐标轴显示错误 [BUG]分面图旋转子视图的时候坐标轴显示错误 Oct 8, 2023
@antvis antvis locked and limited conversation to collaborators Oct 11, 2023
@pearmini pearmini converted this issue into discussion #5627 Oct 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant