Skip to content

Bug in calculateBarIndexPixels #4825

@benmccann

Description

@benmccann

Context

@tchan originally reported this bug in #4814. There are two separate issues in his example, so I'm opening this bug to track the bar chart issue

Steps to Reproduce (for bugs)

Here's a fiddle: https://codepen.io/anon/pen/JrpVza

Expected Behavior

The data point for 2017-01-17 18:00:00 should be charted before the tick for 2017-01-18

Current Behavior

The data point for 2017-01-17 18:00:00 is charted next to the tick for 2017-01-19

Possible Solution

I believe the bug is in calculateBarIndexPixels. The 17th element (i.e. the one with index=16) has a fullBarSize of 265 pixels, which is why it is mis-positioned by hundreds of pixels.

It's very strange that the bars in this chart have different sizes. I don't understand the intended behavior here, but I don't think it's a good default. If you do a Google Image search for 'bar chart' then all the examples have all the bars being the same size. Different widths is extremely uncommon

screenshot from 2017-10-07 12-39-17

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions