forio / contour

Apache License 2.0
120 stars 21 forks source link

Column/Bar chart does not respect axis max #275

Closed narenranjit closed 6 years ago

narenranjit commented 6 years ago

See http://jsfiddle.net/tff4w6jz/ (column chart) vs http://jsfiddle.net/tff4w6jz/1/ (line chart)

It is arguably somewhat nonsensical to limit the column chart this way when your data is explicitly higher, but it should behave equivalent to the line-chart for consistency.

@jaimedp

jaimedp commented 6 years ago

The difference is not really on the type of visualization but on the type of axis that is used, the default x-axis type for line charts is "linear" which implies a linearly increasing numeric series with a min and a max value, the column viz really only makes sense in an "ordinal" axis type, which is not based on an increasing numeric series, but on discrete categorical values (ie. strings or numbers or labels). In the ordinal axis it has no meaning to have a max or min since the categories can be strings or whatever. Makes sense?

You can see this also if you take the line chart example and add a type: 'ordinal' to the xAxis options, and that would make it behave the same as the column case.

narenranjit commented 6 years ago

Thanks that makes sense, thanks.