lumean / svg-graph2

SVG:::Graph is a pure Ruby library for generating charts, which are a type of graph where the values of one axis are not scalar. SVG::Graph has a verry similar API to the Perl library SVG::TT::Graph, and the resulting charts also look the same. This isn't surprising, because SVG::Graph started as a loose port of SVG::TT::Graph.
Other
50 stars 20 forks source link

Legend inline at bottom #18

Open noraj opened 4 years ago

noraj commented 4 years ago

key_position: :right

image

key_position: :bottom

image

Feels like when using :bottom, the legend should be inline rather than in block.

lumean commented 4 years ago

@noraj could you please indicate where you would expect the legend? or are you asking for an additional option to place the legend as overlay on the graph?

noraj commented 4 years ago

@noraj could you please indicate where you would expect the legend?

Exactly where it is but diplayed inline rather than in block when bottom is used.

lumean commented 4 years ago

thanks for the reply, but can you please give some more details? I dont understand what you mean. What is the difference between inline and block? Are you referring to CSS properties or something else? e.g. display all legend items on a single line instead of multiple lines?

noraj commented 4 years ago

display all legend items on a single line instead of multiple lines?

Yes exactly, like this, in a line rather than in a block:

image

A block is nice to be displayed in a column (vertical), eg with key_position: :right and in a line is nice to be displayed in a row (horizontal) eg. key_position: :bottom.

A block when horizontal waste too much space.

lumean commented 4 years ago

Ok thanks for clarification. Will mark this as enhancement and we can introduce either a new attribute for legend style or another position option. E.g. single column or single row or even grid layout might make sense.