From f113a3528d602e558ef7d3c056a819a7b08f2609 Mon Sep 17 00:00:00 2001 From: Toma Rares Date: Mon, 22 Feb 2021 17:19:18 +0200 Subject: [PATCH] Feat: run lint --- src/components/Charts/Chart.js | 2 +- src/views/Dashboard.vue | 152 +++++++++++++++++---------------- 2 files changed, 80 insertions(+), 74 deletions(-) diff --git a/src/components/Charts/Chart.js b/src/components/Charts/Chart.js index bb708ba8..066f33dc 100644 --- a/src/components/Charts/Chart.js +++ b/src/components/Charts/Chart.js @@ -86,7 +86,7 @@ export const ordersChart = { }; const funcs = { - ordersChart() {} + ordersChart() {}, }; export default funcs; diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 76ed2f2d..233d48e0 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -177,7 +177,82 @@ export default { methods: { initBigChart(index) { chart.destroy(); - chart = new Chart(document.getElementById(this.salesChartID).getContext("2d"), { + chart = new Chart( + document.getElementById(this.salesChartID).getContext("2d"), + { + type: "line", + data: { + labels: ["May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + datasets: [ + { + label: "Performance", + tension: 0.4, + borderWidth: 4, + borderColor: "#5e72e4", + pointRadius: 0, + backgroundColor: "transparent", + data: this.bigLineChart.allData[index], + }, + ], + }, + options: { + responsive: true, + maintainAspectRatio: false, + legend: { + display: false, + }, + tooltips: { + enabled: true, + mode: "index", + intersect: false, + }, + scales: { + yAxes: [ + { + barPercentage: 1.6, + gridLines: { + drawBorder: false, + color: "rgba(29,140,248,0.0)", + zeroLineColor: "transparent", + }, + ticks: { + padding: 0, + fontColor: "#8898aa", + fontSize: 13, + fontFamily: "Open Sans", + }, + }, + ], + xAxes: [ + { + barPercentage: 1.6, + gridLines: { + drawBorder: false, + color: "rgba(29,140,248,0.0)", + zeroLineColor: "transparent", + }, + ticks: { + padding: 10, + fontColor: "#8898aa", + fontSize: 13, + fontFamily: "Open Sans", + }, + }, + ], + }, + layout: { + padding: 0, + }, + }, + } + ); + this.bigLineChart.activeIndex = index; + }, + }, + mounted() { + chart = new Chart( + document.getElementById(this.salesChartID).getContext("2d"), + { type: "line", data: { labels: ["May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], @@ -189,7 +264,7 @@ export default { borderColor: "#5e72e4", pointRadius: 0, backgroundColor: "transparent", - data: this.bigLineChart.allData[index], + data: this.bigLineChart.allData[1], }, ], }, @@ -242,77 +317,8 @@ export default { padding: 0, }, }, - }); - this.bigLineChart.activeIndex = index; - }, - }, - mounted() { - chart = new Chart(document.getElementById(this.salesChartID).getContext("2d"), { - type: "line", - data: { - labels: ["May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - datasets: [ - { - label: "Performance", - tension: 0.4, - borderWidth: 4, - borderColor: "#5e72e4", - pointRadius: 0, - backgroundColor: "transparent", - data: this.bigLineChart.allData[1], - }, - ], - }, - options: { - responsive: true, - maintainAspectRatio: false, - legend: { - display: false, - }, - tooltips: { - enabled: true, - mode: "index", - intersect: false, - }, - scales: { - yAxes: [ - { - barPercentage: 1.6, - gridLines: { - drawBorder: false, - color: "rgba(29,140,248,0.0)", - zeroLineColor: "transparent", - }, - ticks: { - padding: 0, - fontColor: "#8898aa", - fontSize: 13, - fontFamily: "Open Sans", - }, - }, - ], - xAxes: [ - { - barPercentage: 1.6, - gridLines: { - drawBorder: false, - color: "rgba(29,140,248,0.0)", - zeroLineColor: "transparent", - }, - ticks: { - padding: 10, - fontColor: "#8898aa", - fontSize: 13, - fontFamily: "Open Sans", - }, - }, - ], - }, - layout: { - padding: 0, - }, - }, - }); + } + ); ordersChart.createChart(this.ordersChartID); }, };