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

fix(chart): autoFit do not set width and height of chart options #4922

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

pearmini
Copy link
Member

  • 问题:设置了 autoFit 之后,chart options 里的 width 和 height 会被设置。这样其实不太合理,应为用户并没有设置 width 和 height,拿到的 options 就和最开始的设置不同。
<div id="container" style="width: 640px; height: 480px"></div>
const chart = new Chart({
  autoFit: true,
  container: 'container',
});

// ...

chart.render();
// 实际
chart.options().width; // 640
chart.options().height; // 480

// 期望
chart.options().width; // undefined
chart.options().height; // undefined

@pearmini pearmini requested review from lxfu1 and pepper-nice April 27, 2023 04:33
@pearmini pearmini removed the request for review from lxfu1 April 27, 2023 04:34
@pearmini pearmini force-pushed the fix/chart-auto-fit branch from efea11c to 7721c4b Compare April 27, 2023 04:35
@pepper-nice
Copy link
Contributor

ci解决一下,看起来没问题。我通过了。

Copy link
Contributor

@pepper-nice pepper-nice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@pearmini pearmini force-pushed the fix/chart-auto-fit branch from 31b9786 to d49e72c Compare April 27, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants