📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
fix refunds chart
Blue Mouse06a4efac1e8f
diff --git a/web/app/pages/Project/View/ViewProject.helpers.tsx b/web/app/pages/Project/View/ViewProject.helpers.tsxindex b390f29a3..11e1eb3a4 100644--- a/web/app/pages/Project/View/ViewProject.helpers.tsx+++ b/web/app/pages/Project/View/ViewProject.helpers.tsx@@ -908,15 +908,30 @@ const getSettings = (if (chart?.$ && chart.$.bar?.bars) {chart.$.bar.bars.each(function (this: SVGPathElement, d: any) {- if (d?.id === 'refundsAmount' && Number(d?.value || 0) > 0) {- this.style.stroke = '#ea580c'- this.style.strokeWidth = '1.5px'- this.style.strokeDasharray = '6,4'- } else if (d?.id === 'refundsAmount') {- // Avoid a dashed "cap" on top of revenue when refunds are 0.- this.style.strokeDasharray = ''- this.style.strokeWidth = '0'- this.style.stroke = 'none'+ const value = Number(d?.value || 0)++ if (d?.id === 'refundsAmount') {+ if (value > 0) {+ this.style.stroke = '#ea580c'+ this.style.strokeWidth = '1.5px'+ this.style.strokeDasharray = '6,4'+ this.style.display = ''+ } else {+ this.style.strokeDasharray = ''+ this.style.strokeWidth = '0'+ this.style.stroke = 'none'+ this.style.display = 'none'+ }+ } else if (d?.id === 'revenue') {+ if (value === 0) {+ this.style.strokeWidth = '0'+ this.style.stroke = 'none'+ this.style.display = 'none'+ } else {+ this.style.strokeWidth = '1.5px'+ this.style.stroke = '#ea580c'+ this.style.display = ''+ }}})}diff --git a/web/app/styles/ProjectViewStyle.css b/web/app/styles/ProjectViewStyle.cssindex 2a1b63716..d416c7c51 100644--- a/web/app/styles/ProjectViewStyle.css+++ b/web/app/styles/ProjectViewStyle.css@@ -77,7 +77,7 @@ body.dark .bb-ygrid {.bb-bar {fill-opacity: 0.3;- stroke-width: 1.5 !important;+ stroke-width: 1.5;}/* Custom events stacked chart: remove outlines (dynamic series) */@@ -112,12 +112,12 @@ body.dark .bb-ygrid {/* Revenue chart styling */.bb-target-revenue .bb-bar {- stroke: #ea580c !important;+ stroke: #ea580c;fill-opacity: 0.85 !important;}.bb-target-refundsAmount .bb-bar {- stroke: #ea580c !important;+ stroke: #ea580c;fill-opacity: 1 !important; /* keep rgba() fill visible (don't multiply by .bb-bar opacity) */}