diff --git a/docs/components/analytics.md b/docs/components/analytics.md index a8ac71a24..0ba7cfcd9 100644 --- a/docs/components/analytics.md +++ b/docs/components/analytics.md @@ -28,6 +28,33 @@ ] }" /> + + + + diff --git a/lib/components/base/LineChart.vue b/lib/components/base/LineChart.vue index 7aee0212b..332f76fb5 100644 --- a/lib/components/base/LineChart.vue +++ b/lib/components/base/LineChart.vue @@ -42,7 +42,7 @@ const chartData = ref({ labels: props.data.labels.map((date) => props.formatLabels(date)), datasets: props.data.data.map((project) => ({ label: project.title, - backgroundColor: decimalToRgba(project.color, 0.75), + backgroundColor: decimalToRgba(project.color, 0.5), borderColor: decimalToRgba(project.color), data: project.data, })), @@ -69,7 +69,9 @@ const chartOptions = ref({ }, }, interaction: { - mode: 'x', + mode: 'index', + intersect: false, + axis: 'xy', }, plugins: { legend: { diff --git a/lib/components/base/PieChart.vue b/lib/components/base/PieChart.vue index caa5c0f58..e30317a45 100644 --- a/lib/components/base/PieChart.vue +++ b/lib/components/base/PieChart.vue @@ -21,7 +21,7 @@ const props = defineProps({ }, }) -const decimalToRgba = (decimalColor, alpha = 0.75) => { +const decimalToRgba = (decimalColor, alpha = 1) => { const red = (decimalColor >> 16) & 255 const green = (decimalColor >> 8) & 255 const blue = decimalColor & 255 @@ -34,8 +34,8 @@ const chartData = ref({ datasets: [ { label: props.data.title, - backgroundColor: props.data.data.map((project) => decimalToRgba(project.color)), - borderColor: getComputedStyle(document.documentElement).getPropertyValue('--color-button-bg'), + backgroundColor: props.data.data.map((project) => decimalToRgba(project.color, 0.5)), + borderColor: props.data.data.map((project) => decimalToRgba(project.color)), data: props.data.data.map((project) => project.data), fill: true, }, diff --git a/lib/components/index.js b/lib/components/index.js index 6151b05eb..41faa5859 100644 --- a/lib/components/index.js +++ b/lib/components/index.js @@ -26,6 +26,7 @@ export { default as DropdownButton } from './base/DropdownButton.vue' export { default as ShareModal } from './base/ShareModal.vue' export { default as LineChart } from './base/LineChart.vue' export { default as PieChart } from './base/PieChart.vue' +export { default as BarChart } from './base/BarChart.vue' export { default as Categories } from './search/Categories.vue' export { default as SearchFilter } from './search/SearchFilter.vue' diff --git a/package.json b/package.json index 66ecf50e5..bd790694d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "omorphia", "type": "module", - "version": "0.4.39", + "version": "0.4.40", "files": [ "dist", "lib"