frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.9k stars 716 forks source link

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

Open micahblu opened 1 year ago

micahblu commented 1 year ago

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

Sorizz commented 1 year ago

Do you want the chart to render like this?

Chart Preview Chart Code