Repository navigation
Charts: dashed pace for the month in progress; demo margins and two years - #17
Merged
Merged
Conversation
Each product gets its own share of costs, so the Products page shows 80%, 86% and 40% margins instead of the same figure three times. A second year gives the charts a year-earlier line.
Charts plotted the current month's amount so far, so every line dropped at the start of a month. The server now sends where that month lands at its pace so far: synced lines scale to the whole month and flat costs count once. The chart draws the last segment dashed to that value, and the tooltip shows the amount so far. MRR and subscriptions are snapshots and stay as they are.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes for what people see when they open /demo from the Reddit post.
The month in progress runs dashed
Charts plotted the current month's amount so far, so on October 7 profit looked like it fell from $8.7k to $2.4k. The server now sends where the month lands at its pace so far (
monthPaceinoverview.server.ts): synced lines scale by the share of the month that has passed, and flat costs count once. The chart ends the solid line at the last full month and draws a dashed segment to the pace. The tooltip on that point reads "Oct 2026, $2,390 so far" with "On pace for $9,339".This covers the overview chart, the Costs chart, the Products sparklines and public product pages. MRR and subscriptions are snapshots, so they stay as they are. On the last day of a month the pace is null and the line is solid.
Demo data
Checked
tsc, Biome andpnpm buildpass.monthPaceagainst fixed dates: a past month gives null, 7 days of October scale by 31/7, flat costs are added once, and the last day gives null.DEMO=onon October 7: overview (light), Costs and Products (dark), with the tooltip on the current month.