question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chart resizes when it get's new data via setting results

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior I’m testing a line chart, but I would think this is also a problem with others. I’m not using a view-option, thus the chart should redraw on window changes.

If I load the site everything is fine. When I then get new data and refresh the data inside results height changes. It seems to want to endup somewhere around the 400px mark.

Here a example snippet from the html.

<div class="card-body m-2">
  <ngx-charts-line-chart [results]="chartData" [xAxis]="true" [yAxis]="true"
    [showYAxisLabel]="true" [yAxisLabel]="yAxisLabel">
  </ngx-charts-line-chart>
</div>

Expected behavior

I would expect the component to not resize, or at least resize and still honor the window it is in.

Reproduction of the problem

Wasn’t able to get a plnkr going that also has this problem. 😦

What is the motivation / use case for changing the behavior? Well I don’t want ngx-charts to kill my layout 😃

Please tell us about your environment: Windows + NPM

  • ngx-charts version: 7.1.1

  • Angular version: 5.2.4

  • Browser: Tested current chrome and firefox bot have this.

  • Language: Tested with Typescript

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marjan-georgievcommented, Apr 4, 2018

Does the card-body div have any padding? That can usually cause this.

0reactions
razzeeecommented, Apr 4, 2018

well it has margin via bootstraps mt-2 and i’ve set padding: 0px; not sure if that qualifies as any

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found