Skip to content

[BUG] Barchart: setting xaxes 'type: time' is causing bars to be drawn off canvas. #5312

@cmflynn

Description

@cmflynn

Expected Behavior

All bars should be drawn on canvas and visible.

Current Behavior

Currently, the bars at the beginning and end of the datasets are being drawn off canvas.

Possible Solution

Currently can be fixed by removing type: 'time' and letting chartjs infer the type.
Also can be "fixed" by adding offset: true to the x-axis, however, this adds large margins to the start and of end of chart and looks really bad.

Steps to Reproduce (for bugs)

jsfiddle

  1. comment out line 68 type: 'time'

Screenshot:

image

Environment

  • Chart.js version: 2.7.2
  • Browser name and version: Chrome Version 64.0.3282.186 (Official Build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions