Chartjs-Ajax automatically placing double quotes around variable data returned in success call

0👍

Based on your code I think you need to define array not string for your variables. Example:

                var sDate = [];
                var ooSum = [];
                var bgC = [];
                for (var i = 0; i < adata.length; i++) {
                    sDate.push(adata[i].startDate);
                    ooSum.push(adata[i].oSum);
                    bgC.push(adata[i].bgcolor);

                }

then replace

                    data: {
                        labels: sDate,
                        datasets: [
                            {
                                label: 'Start Date',
                                backgroundColor: bgC,
                                data: ooSum
                            }
                        ]
                    },

Leave a comment