himynameisdave / svelte-frappe-charts

📈 Svelte bindings for frappe-charts.
https://frappe.io/charts
MIT License
308 stars 16 forks source link

Doesn't fill the chart with zero values when data is missing #58

Open faulander opened 2 years ago

faulander commented 2 years ago

according to the documentation, the chart should fill up missing values with 0 as long as the labels are set: i have 3 arrays with an amount for every weekday, today is wednesday, so the array has 3 items: image the chart is as following:

let chartData = {
        labels: ['MO', 'DI', 'MI', 'DO', 'FR'],
        datasets: [
            { name: 'Closed', values: myClosedTickets },
            { name: 'Worked', values: myWorkedTickets },
            { name: 'Minutes', values: myLoggedMinutes }
        ],
        title: 'Tickets'
    };

so the chart should show zero values for thursday and friday, since they are item 4 and 5 in the area, but it does not: image

himynameisdave commented 2 years ago

@faulander Is this a bug with frappe-charts or just with this library? Our documentation doesn't seem to mention this (unless I am missing something), so I'm guessing this bug exists upstream as well. Please test it out and get back to me.