ashish-chopra / ngx-gauge

A highly customizable Gauge component for Angular apps and dashboards
https://ashish-chopra.github.io/ngx-gauge
MIT License
216 stars 73 forks source link

Add option to size fit parent #18

Closed hassondaniel closed 4 years ago

hassondaniel commented 6 years ago

We need to add this to control the size if the parent size changes

r-havelka commented 6 years ago

you can do that with css.

// HTLM
<ngx-gauge class="gauge-width">

// CSS
.gauge-width {
  width: 100% !important;

  canvas {
    width: 80% !important;
    height: 100% !important;
  }
  .reading-label {
    width: 80% !important;
    height: 100% !important;
  }
}
amairose-papajohns commented 5 years ago

This can be accomplished by binding the size attribute to a variable in your component, and setting that variable whenever the window is resized. See this StackBlitz for an example: https://stackblitz.com/edit/angular-xuxawy

ashish-chopra commented 4 years ago

Closing this issue as we can acheive it with existing configuration as pointed in the stackblitz. Thanks @amairose-papajohns