terezka / elm-charts

Create SVG charts in Elm.
https://www.elm-charts.org
BSD 3-Clause "New" or "Revised" License
711 stars 67 forks source link

Dynamic Size #61

Closed anagrius closed 3 years ago

anagrius commented 7 years ago

Hi, I am no SVG expert. But for our application we need charts that can be resized based on the parent container. When the window resizes or a number of other event occur that impact the space available for the chart, it should size-to-fit.

Currently we have to set the width and height in the configuration of the chart. Now understand why that is, but at the same time, SVG also has support for different kinds of scaling, e.g. preserveAspectRatio.

I don't know if it is possible to preserve text scale and stroke width while spacing out ticks etc based on the space available. We would love to say { width: 100%, height: 100% } to avoid all the bookkeeping we have to do now.

terezka commented 7 years ago

Hi! I'm looking into creating a proper API for the resizing trouble! Thanks for letting me know though!