Skip to content

Line chart y-axis is dynamic instead of starting at Zero #407

Open
@micahblu

Description

@micahblu

Expected Behaviour

The line chart's y-axis should either start at zero or allow me to set it to zero. (I searched the docs and could not find a way of setting min/max y-axis values)

Actual Behaviour

The line chart's y-axis starts at the minimum value from the values charted

Steps to Reproduce:

const data = {
labels: ['Feb 12', '13', '14', '15', '16', '17', '18', '19'],
datasets: [
{
values: [250, 500, 100, 105, 180, 320, 270, 140]
}
],
min: 0
}

new Chart("#chart", {
  data: data,
  type: 'line', // or 'bar', 'line', 'scatter', 'pie', 'percentage'
  height: 350,
  colors: ['#7cd6fd'],
})

Screen Shot 2023-03-22 at 11 41 09 AM

Frappé Charts version:
1.6.2

Codepen / Codesandbox:
https://codesandbox.io/s/dry-water-hz7jcn?file=/src/index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions