terezka/elm-charts

Dynamic Size

anagrius opened this issue · 1 comments

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.

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