pianello-api/resources/js/components/pie-chart/index.js
Ale Gallo 82f958e5da Committing laravel (part 3)
committing js templating files and components
2023-11-10 16:00:59 +01:00

43 lines
1.4 KiB
JavaScript

(function () {
"use strict";
// Chart
if ($(".pie-chart").length) {
let ctx = $(".pie-chart")[0].getContext("2d");
let myPieChart = new Chart(ctx, {
type: "pie",
data: {
labels: ["Html", "Vuejs", "Laravel"],
datasets: [
{
data: [15, 10, 65],
backgroundColor: [
getColor("pending", 0.9),
getColor("warning", 0.9),
getColor("primary", 0.9),
],
hoverBackgroundColor: [
getColor("pending", 0.9),
getColor("warning", 0.9),
getColor("primary", 0.9),
],
borderWidth: 5,
borderColor: $("html").hasClass("dark")
? getColor("darkmode.700")
: getColor("white"),
},
],
},
options: {
maintainAspectRatio: false,
plugins: {
legend: {
labels: {
color: getColor("slate.500", 0.8),
},
},
},
},
});
}
})();