Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
actual-vt-capstone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danieljk
actual-vt-capstone
Commits
3e03718f
Unverified
Commit
3e03718f
authored
10 months ago
by
Neil
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix spending report error (#2745)
* spending error * fixes * notes
parent
9c3075f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
+10
-8
10 additions, 8 deletions
...op-client/src/components/reports/graphs/SpendingGraph.tsx
upcoming-release-notes/2745.md
+6
-0
6 additions, 0 deletions
upcoming-release-notes/2745.md
with
16 additions
and
8 deletions
packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
+
10
−
8
View file @
3e03718f
...
...
@@ -145,8 +145,12 @@ export function SpendingGraph({
:
b
,
).
months
[
lastMonth
][
balanceTypeOp
];
const
maxYAxis
=
selectionMax
>
thisMonthMax
;
const
dataMax
=
Math
.
max
(...
data
.
intervalData
.
map
(
i
=>
i
[
balanceTypeOp
]));
const
dataMin
=
Math
.
min
(...
data
.
intervalData
.
map
(
i
=>
i
[
balanceTypeOp
]));
const
dataMax
=
Math
.
max
(
...
data
.
intervalData
.
map
(
i
=>
i
.
months
[
thisMonth
].
cumulative
),
);
const
dataMin
=
Math
.
min
(
...
data
.
intervalData
.
map
(
i
=>
i
.
months
[
thisMonth
].
cumulative
),
);
const
tickFormatter
=
tick
=>
{
if
(
!
privacyMode
)
return
`
${
amountToCurrencyNoDecimal
(
tick
)}
`
;
// Formats the tick values as strings with commas
...
...
@@ -154,18 +158,16 @@ export function SpendingGraph({
};
const
gradientOffset
=
()
=>
{
if
(
dataMax
<=
0
)
{
if
(
!
dataMax
||
dataMax
<=
0
)
{
return
0
;
}
if
(
dataMin
>=
0
)
{
if
(
!
dataMin
||
dataMin
>=
0
)
{
return
1
;
}
return
dataMax
/
(
dataMax
-
dataMin
);
};
const
off
=
gradientOffset
();
const
getVal
=
(
obj
,
month
)
=>
{
if
(
month
===
'
average
'
)
{
return
obj
[
month
]
&&
-
1
*
obj
[
month
];
...
...
@@ -246,7 +248,7 @@ export function SpendingGraph({
y2
=
"1"
>
<
stop
offset
=
{
off
}
offset
=
{
gradientOffset
()
}
stopColor
=
{
theme
.
reportsGreen
}
stopOpacity
=
{
0.2
}
/>
...
...
@@ -259,7 +261,7 @@ export function SpendingGraph({
y2
=
"1"
>
<
stop
offset
=
{
off
}
offset
=
{
gradientOffset
()
}
stopColor
=
{
theme
.
reportsGreen
}
stopOpacity
=
{
1
}
/>
...
...
This diff is collapsed.
Click to expand it.
upcoming-release-notes/2745.md
0 → 100644
+
6
−
0
View file @
3e03718f
---
category
:
Bugfix
authors
:
[
carkom
]
---
Fixes a NaN error in spending report.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment