From e7350de10b46554a2dab78261f6f6b69537e40c4 Mon Sep 17 00:00:00 2001 From: Jan Michek <15363559+janmichek@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:11:03 +0100 Subject: [PATCH] feat: Names charts (#641) --- src/components/LineChart.vue | 5 +-- src/components/NamesChartPanel.vue | 56 ++++++++++++++++++++++++++++++ src/pages/names/index.vue | 12 ++++++- src/stores/names.js | 16 +++++++++ 4 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 src/components/NamesChartPanel.vue diff --git a/src/components/LineChart.vue b/src/components/LineChart.vue index b622a3121..a9c29e6a6 100644 --- a/src/components/LineChart.vue +++ b/src/components/LineChart.vue @@ -46,10 +46,10 @@ function formatDate(label) { const date = DateTime.fromISO(label) if (props.selectedInterval === 'month') { - return date.toFormat('yyyy-MM') + return date.toFormat('yyyy/MM') } - return date.toFormat('MM-dd') + return date.toFormat('MM/dd') } function formatNumberFractions(number) { @@ -100,6 +100,7 @@ const chartOptions = { display: false, }, ticks: { + precision: 0, callback: function(value) { return formatNumberFractions(value) }, diff --git a/src/components/NamesChartPanel.vue b/src/components/NamesChartPanel.vue new file mode 100644 index 000000000..09d509db4 --- /dev/null +++ b/src/components/NamesChartPanel.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/pages/names/index.vue b/src/pages/names/index.vue index f632d510d..8e47983ae 100644 --- a/src/pages/names/index.vue +++ b/src/pages/names/index.vue @@ -5,7 +5,6 @@ Names -