Skip to content

Bar chart for only dataset.data value #4907

Description

@GTDunk

Starting from version 2.7.0 'Bar chart' have changed the logic of showing data values: if there is only one value inside dataset.data the chart spreads the data on full width.

Expected Behavior

" If these are set to an array value, the first value applies to the first bar, the second value to the second bar, and so on."(http://www.chartjs.org/docs/latest/charts/bar.html)

The example with Chartjs version 2.6.0: https://codepen.io/GTDunk/pen/gXpPwJ

image

Current Behavior

The example with Chartjs version 2.7.1: https://codepen.io/GTDunk/pen/pdzYvJ

image

Possible Solution

How about a flag which could change the behavior?

Environment

  • Chart.js version: 2.6.0 & 2.7.1
  • Browser name and version: chrome ^58

Activity

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

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