Skip to content
Discussion options

You must be logged in to vote

Hey ! I had a bit of a deeper look at your code.

Categories in bar charts with sparse data (with missing values for some x,series combinations) are sorted by name. You can fix your chart by adding the month number as a prefix in the label (add strftime('%m', date) || ' - ' || before your case expression).

But the cleanest way to handle this is to ensure your request returns data for every value of month and status, and sort by month number, not month name:

WITH monthly AS (
    SELECT
        CAST(strftime('%m', date) AS INTEGER) AS month_num,
        status,
        SUM(quotient) AS quotient_total
    FROM workflow
    WHERE date BETWEEN strftime('%Y-01-01', 'now') AND strftime('%Y-12-31'

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jhautefeuille
Comment options

Comment options

You must be logged in to vote
1 reply
@jhautefeuille
Comment options

Answer selected by jhautefeuille
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants