Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Wrong width and position of non-equidistant bars with {x, y} data points #4666

Closed
andig opened this issue Aug 16, 2017 · 3 comments
Closed

Comments

@andig
Copy link
Contributor

andig commented Aug 16, 2017

#4565 added support for data point objects for bars, but current implementation assume equidistant bars.

Expected Behavior

When a series of bars has a single missing point, remaining bars should have equal width and be centered at their x or t location.

Current Behavior

See https://jsfiddle.net/andig2/sb3vzw5n/1/

screen shot 2017-08-16 at 20 26 00

With missing 3rd bar, bars 2 and 4 become too large and are no longer centered around their x position.

Possible Solution

Bar drawing should determined smallest bar first, then draw all bars with that width at the desired location.

Steps to Reproduce (for bugs)

See https://jsfiddle.net/andig2/sb3vzw5n/1/

Environment

Current master

@andig andig changed the title [BUG] Width and position of non-equidistant bars with {x, y} data point on a time scale are undefined [BUG] Wrong width and position of non-equidistant bars with {x, y} data points Aug 16, 2017
@andig
Copy link
Contributor Author

andig commented Aug 16, 2017

cc @nagix as you have already researched this area (7dc71d0#diff-5d42034a6fdb9268bcdfd72b4ee5e34fL309)

@nagix
Copy link
Contributor

nagix commented Aug 17, 2017

Yes, this was discussed and prototyping was done in #4545, but we decided to leave it for another PR. barThickness: 'min' was originally suggested for it, which means adjusting all the bar widths to the minimum one. However, barThickness is intended to set the width of bar 'rectangles', and not to control the sample width that is a base for bar width calculation using categoryPercentage and barPercentage. So, I'm wondering if another option should be introduced.

@matildasmeds
Copy link

I am having the same issue. My time series data has gaps, i.e. not every date / hour has a datapoint. As a framework user, I can add zero-values in the dataset, so that the distance between datapoints stays the same. However, that increases the dataset size and adds another step of processing.

Personally, I would like to have same width bars, as default behavior. I think same width bars has been the default previously, as we didn't see this issue with 2.5.0. I'm not aware of use cases for varied width bars, though of course there may be some/plenty. 😄 📊

Would that (same width bars, as default behavior) be an acceptable fix for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants