terezka/line-charts

Legends.none still takes up space

Opened this issue ยท 4 comments

After changing Legends.default to Legends.none, there still is a space on the right that they would occupy. My intuition was that the rest of the plot should use this newly available space.

legends

I just figured it would be wise to add some source code :)
Here's the Ellie: https://ellie-app.com/7RDwvBQ5Ja1/2

Take a look at Container.spaced as you can set the margins yourself

container = Container.spaced ("line-chart-" ++ name) 0 10 50 40

Right, I was able to do Container.responsive without the legends margin like this:

        LCContainer.custom
            { attributesHtml = []
            , attributesSvg = []
            , size = LCContainer.relative
            , margin = LCContainer.Margin 40 30 60 80
            , id = "chart"
            }

I guess the question is: Shouldn't the final right margin value change based on whether the legends are there or not? Default chart with no Legends.none -> excess margin.

Hi! Thanks for adding the issue! I will think of a way to make it more intuitive and get back to you. Until then, Mark pointed out the mending configuration!