RhoInc / Webcharts

Reusable, flexible, interactive charts with JavaScript
MIT License
34 stars 6 forks source link

Distinguish Between x and y range_band #191

Closed pburnsdata closed 6 years ago

pburnsdata commented 6 years ago

Right now range_band applies to any variables that are ordinal. So if both x and y are ordinal they are both affected. If you have two ordinal variables, you might only want the range_band to apply to one of them (like if you're making a heatmap and you don't want the rects to be squares). Right now working around this by making the x axis linear at the start then recoding it later)

Test notes

jwildfire commented 6 years ago

@pburnsdata Good find - want to work on a PR?

pburnsdata commented 6 years ago

@jwildfire AYE

jwildfire commented 6 years ago

I think I would add a range_band property to both the config.x and config.y. To maintain backwards compatibility, if a user just sets, config.range_band then it should be applied to both places, but if both config.range_band and config.x.range_band are set x.range_band should take precedence.

Make sense to you @samussiah?

dschwentker commented 6 years ago

Tested and passed in Webcharts visual tests using version x-y-range-band. Can update the object settings to add range_band: x to either a y-axis or x-axis ordinal bar chart and change the size of the bars accordingly.