From bbe4d823037a397f6128058296d6556e9b5724de Mon Sep 17 00:00:00 2001 From: shibao Date: Mon, 18 Mar 2024 23:26:32 -0400 Subject: [PATCH] Use bar graph instead of line graph --- CHANGELOG.md | 1 + assets/js/shot_log_chart.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd55b32..adafbd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # v0.9.7 - Fix margin on bottom of page +- Use bar graph instead of line graph # v0.9.6 - Make ammo packs in containers directly navigable in table view diff --git a/assets/js/shot_log_chart.js b/assets/js/shot_log_chart.js index bd40ff5..066ed2d 100644 --- a/assets/js/shot_log_chart.js +++ b/assets/js/shot_log_chart.js @@ -1,13 +1,12 @@ -import { Chart, Title, Tooltip, Legend, LineController, LineElement, PointElement, TimeScale, LinearScale } from 'chart.js' +import Chart from 'chart.js/auto' import 'chartjs-adapter-date-fns' -Chart.register(Title, Tooltip, Legend, LineController, LineElement, PointElement, TimeScale, LinearScale) export default { initalizeChart (el) { const data = JSON.parse(el.dataset.chartData) this.el.chart = new Chart(el, { - type: 'line', + type: 'bar', data: { datasets: [{ label: el.dataset.label, @@ -51,7 +50,8 @@ export default { stacked: true, grace: '15%', ticks: { - padding: 15 + padding: 15, + precision: 0 } }, x: {