Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

display a point if only one element is present on chart

Blue Mouse919e153b4a97
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsx
index 21741629b..be930cdc0 100644
--- a/src/pages/Project/View/ViewProject.jsx
+++ b/src/pages/Project/View/ViewProject.jsx
@@ -60,28 +60,6 @@ countries.registerLocale(countriesZh)
countries.registerLocale(countriesSv)
const getColumns = (chart, showTotal, t) => {
-
- if (chart.x.length === 1 && chart.uniques.length === 1 && chart.visits.length === 1) {
- // eslint-disable-next-line no-extend-native
- Date.prototype.addHours= function(h){
- this.setHours(this.getHours()+h);
- return this;
- }
-
- if (showTotal) {
- return [
- ['x', ..._map(chart.x, el => dayjs(el).toDate()), dayjs(new Date(chart.x[0]).addHours(1)).toDate()],
- [t('project.unique'), ...chart.uniques, ...chart.uniques],
- [t('project.total'), ...chart.visits, ...chart.visits ],
- ]
- }
-
- return [
- ['x', ..._map(chart.x, el => dayjs(el).toDate()), dayjs(new Date(chart.x[0]).addHours(1)).toDate()],
- [t('project.unique'), ...chart.uniques, ...chart.uniques]
- ]
- }
-
if (showTotal) {
return [
['x', ..._map(chart.x, el => dayjs(el).toDate())],
@@ -165,7 +143,7 @@ const getSettings = (chart, timeBucket, showTotal = true, t) => {
},
point: {
focus: {
- only: true,
+ only: xAxisSize > 1,
},
pattern: [
'circle',