[Due for payment 2026-10-21] [Insights polish] [R1] Draw `Spend over time` as a bar when there's only one point to plot
Background
Spend over time is a line chart, which means it needs at least two points to draw a line. With the Custom day Date option, there's only one point, so the graph shows a lone dot with no line, no area fill, and a y-axis scaled around a single value. Previous period adds a second lone dot for the day before, which is just as hard to read.
Accordingly, this issue draws Spend over time as a vertical bar whenever there's only one point to plot.
Product and design details
When the vertical bar is used
- The rule is based on the number of points, not on the Date option, so whenever
Spend over timehas exactly one point to plot, we draw a vertical bar. That coversCustom dayand any range with expenses in only one period. - The moment there are two or more points, the graph is a line chart as today.
The bar
- The bar uses the same vertical bar styling as the ranking charts in https://github.com/Expensify/App/issues/102814: rounded corners and the 400-level swatch.
- I believe we're using a max width of 320px to avoid getting very wide bars
- The x-axis label names the period, e.g.
Dec 3. The y-axis scales from zero, so the bar's height reads as an amount. - The tooltip and hover target follow https://github.com/Expensify/App/issues/102814's bar chart rules: the target is the full-height rectangle covering the bar, and the tooltip is unchanged.
- Clicking the bar behaves the same as clicking a point on the line chart.
With Compare
Previous period: a bar pair, current period in the 400-level swatch and the prior period in the 200-level swatch, using https://github.com/Expensify/App/issues/102814's pair styling. ForCustom day, the prior period is the day before, as defined in R2.Average: a horizontal line across the bar at the average value, labeled the same way as the line chart'sAverageline.
In-progress period
- When the single point is the period that contains today, e.g.
Custom dayset to today, the bar follows https://github.com/Expensify/App/issues/103089's in-progress treatment. - The tooltip's
so farlabel is unchanged.
Issue Owner
Current Issue Owner: @mallenexpensify
When the single point is the period that contains today, e.g. Custom day set to today, the bar follows https://github.com/Expensify/App/issues/103089 in-progress treatment.
is the bar supposed to look different for in-progress period? we only updated the line to be dashed in that other issue. @dannymcclain
is the bar supposed to look different for in-progress period? we only updated the line to be dashed in that other issue.
Yeah I think if we want it to look different for an in-progress period we'll need to come up with a new style for the bar.
I can work on some ideas, but I think for now we might want to continue ahead without an in-progress bar style for now.
okie, thanks!
@cristipaval / @luacmartins @mhawryluk / @OlGierd03
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.8-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/103579
Assigned my self since i was C+ of this PR
BugZero Checklist:
-
[x] [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A
-
[x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
-
[x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
-
[x] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/694129
Regression Test Proposal
Precondition:
Test:
- Enable the insightsPage beta.
- Open Insights.
- Set date and group-by so that there's a single data point.
- Verify the line chart turns into a bar chart.
- Set date and group-by so that there's more than one data point.
- Verify Spend over time is again a line chart.
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-7111-a367-31c4-a81769380d44
Waiting for the regression period to end. Thanks for the testing steps!
Triggered auto assignment to @mallenexpensify (Awaiting Payment)
Payment Summary
Resolving PRs:
-
https://github.com/Expensify/App/pull/103579
-
Contributor: @mhawryluk does not require payment (Contractor)
-
Contributor: @OlGierd03 does not require payment (Contractor)
-
Reviewer: @daledah owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
- [ ] I have confirmed assignees, roles, and Upwork contracts look correct
- [ ] I have paid out Upwork contracts / manual NewDot requests
- [ ] [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
Payment Summary
Contributor+: @daledah due $250 via NewDot
Part of insights project
Approved $250 to @daledah