terezka / elm-charts

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

`roundTop` display issues #93

Open jaredramirez opened 3 years ago

jaredramirez commented 3 years ago

Hey there,

First off, thanks for the super rad package!

When using bar stacks with roundTop, I've come across two kind of obscure display issues when using CA.roundTop on C.bars within a stack

  1. Only the topmost bar of the entire graph is rounded, rather than the topmost bar of that stack. In the following screenshot, I would expect the top of the only visible bar on the 9/16 to be rounded Screen Shot 2021-09-21 at 3 34 43 PM
  2. Sometimes, when showing bars where some columns have very high values and others have very low, the rounded top produces unexpected results. In the case of the Week of Aug 23, there's a bit of the bar displayed below the x axis. Screen Shot 2021-09-21 at 3 27 05 PM

The code is roughly:

C.bars [ CA.roundTop 0.3 ]
     [ C.stacked [ ... ]
     ]
     data

If it'd be helpful, I can also re-create these issues in an Ellie.