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

柱状图同时设置scale.y.key和scrollbar,console会报错,滚动条失效 #5654

Closed
KuduroJS opened this issue Oct 18, 2023 · 1 comment · Fixed by #5815
Closed

柱状图同时设置scale.y.key和scrollbar,console会报错,滚动条失效 #5654

KuduroJS opened this issue Oct 18, 2023 · 1 comment · Fixed by #5815

Comments

@KuduroJS
Copy link

demo如下:

/**
 * A recreation of this demo: https://vega.github.io/vega-lite/examples/bar_grouped_repeated.html
 */
import { Chart } from '@antv/g2';

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

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

chart
  .interval()
  .transform({ type: 'groupX', y: 'sum' })
  .axis('y', { labelFormatter: '~s' })
  .axis('x', { labelTransform: 'rotate(90)' })
  .encode('x', 'Major Genre')
  .encode('y', 'Worldwide Gross')
  .encode('series', () => 'Worldwide Gross')
  .encode('color', () => 'Worldwide Gross')
  .tooltip({ channel: 'y', valueFormatter: '~s' })
  .scale('y', {
    key: "left", // ! 设置这里滚动会失效
  })
  .scrollbar("x", {});

chart.render();
@pearmini
Copy link
Member

估计是类似的问题:#5546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants