Skip to content

[FEATURE] Show zero values in bar graph. #3915

@Moghul

Description

@Moghul

A while ago, a fix was introduced to remove 0 value representation on bar graphs.

I understand why it was done (not wanting to show incorrect values and all that), but I need to be able to show something because in my situation, the data shown on a graph can be for the same label, but from multiple sessions (datasets).

Expected Behavior

A bar of very small size should be visible for 0 values.

Current Behavior

Currently, a value of 0, on a bar graph is not represented. However, if I mouse over it, I get my custom tooltip telling me it's 0.

Possible Solution

For my needs, something like a 'representZero' boolean (default value false) under the 'ticks' key would be an excellent feature.

Perhaps set a minimum non-zero pixel length for a bar?

Context

While in our system, a client can mouse over where the bar might be, and get a tooltip telling them the value is 0, but if they print out the graph, it's difficult to understand that there is supposed to be something there.

Environment

  • Chart.js version: 2.5.0
  • Browser name and version: Irrelevant.
  • Link to your project:

PS: If this is already possible, it means I have missed it in the documentation. If this is the case, I apologize and would appreciate a push in the right direction. Alternatively, if anyone else has implemented an alternative for this, I would love to have an explanation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions