Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funnel Chart Panel - Sorting does not work #118

Open
the-other-dev opened this issue Jan 13, 2025 · 1 comment
Open

Funnel Chart Panel - Sorting does not work #118

the-other-dev opened this issue Jan 13, 2025 · 1 comment

Comments

@the-other-dev
Copy link

Extension

Something else

Describe the Bug

The Funnel Chart Panel offers the option to set the sort direction. However, it appears that it is not sorting anything.

What I noticed and it might be the issue that the response for the call /items/traffic?limit=-1&filter[_and][1][platform][_nempty]=true&aggregate[sum]=visits&groupBy[]=platform contains the following data:

{
    "data": [
        {
            "platform": "App",
            "sum": {
                "visits": "125"
            }
        },
        {
            "platform": "Email",
            "sum": {
                "visits": "244"
            }
        },
        {
            "platform": "Social",
            "sum": {
                "visits": "78"
            }
        },
        {
            "platform": "Website",
            "sum": {
                "visits": "272"
            }
        }
    ]
}

The visits are a string in this case. Even though the data model says it is an integer.
The code for sorting tries to use arithmetic operations: https://github.com/directus-labs/extensions/blob/main/packages/funnel-chart-panel/src/panel.vue#L142-L144

To Reproduce

  1. Create collection with the fields: platform (string), visits (integer), date (date)
  2. Fill the collection with data, similar to what the example data shows
  3. Create a panel and set the sort direction to ascending or descending.
  4. The funnel and its items does not change

Directus Version

v11.3.5

Hosting Strategy

Self-Hosted (Docker Image)

Copy link

linear bot commented Jan 13, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant