terezka / line-charts

Archived in favor of terezka/elm-charts.
https://terezka.github.io/line-charts
BSD 3-Clause "New" or "Revised" License
456 stars 45 forks source link

Legends.none still takes up space #41

Open Janiczek opened 6 years ago

Janiczek commented 6 years ago

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

Janiczek commented 6 years ago

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

MarkNijhof commented 6 years ago

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

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

Janiczek commented 6 years ago

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.

terezka commented 6 years ago

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!