Chartjs v2.0: stacked bar chart

With v2.1.x, you can achieve this using the stacked option … options: { scales:{ xAxes: [{ stacked: true }], yAxes: [{ stacked: true }] } } … Stack Snippet var config = { type: ‘bar’, data: { labels: [“January”, “February”, “March”, “April”, “May”, “June”, “July”], datasets: [{ type: ‘line’, label: ‘Dataset 2’, data: [-65, -10, … Read more

Chartjs change grid line color

It is possible to either remove the grid lines or have them display in a different color. In both options.scales.xAxes and options.scales.yAxes you can add gridLines: { display: false , color: “#FFFFFF” }, (obviously you do not need to assign a colour if you are not disaplying them) var chartColors = { red: ‘rgb(255, 99, … Read more

Chart.js V2: Add prefix or suffix to tooltip label

In the V2.0 the tooltipTemplate option is deprecated. Instead you can use callbacks to modify the displayed tooltips. There is a sample for the usage of callbacks here and you can find the possible callbacks in the documentation under Chart.defaults.global.tooltips In your case I would do the following: window.myLine = new Chart(chart, { type: ‘line’, … Read more

Error: “category” is not a registered scale

Like the error says you are using the category scale so you will need to import and register it like so: import {CategoryScale} from ‘chart.js’; Chart.register(CategoryScale); Or you can choose to not use treeshaking and import everything like so: import Chart from ‘chart.js/auto’; For all available things you might need to import and register please … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)