Skip to content

chart weekly display improvement #2013

Description

@jycouet

Describe the bug

This looks strange

1 year2years
https://npmx.dev/package/@sveltejs/kit?modal=chart&start=2025-03-10&end=2026-03-08https://npmx.dev/package/@sveltejs/kit?modal=chart&start=2024-03-10&end=2026-03-08
ImageImage
Default view when we landAdding 1 more year to the view (going to 2024)

Additional context

Looking at it closely, I saw:

  • that weekly grouping is happening from start to the end. When the week is not full, the last week displayed is only 1 or 2 days... so it's really small.
  • Prediction is available only for month & year

Two options to fix this (that I have already locally! ^^)

Option A

Group from End to start, and drop the partial starting week.

That's nice and easy to do. But:

  • Everyday, values are changing in the weekly mode (I love it as it's last rooling week!)
  • it's not that consistant with monthy & yearly view that has a prediction and work with set periods

Option B

Have a prediction for weekly as well!

In addition, this prediction could do a linear estimation based on the last X points (4 by default)

Image

or (To keep the same package)
Image

It's working pretty well with all view!!! 🚀

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontFrontend, Design

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions