Add a maxSeries option to the GLQL column chart

What does this MR do and why?

  • Adds a maxSeries option to two-dimension GLQL column charts. The largest series keep their own segment and the rest fold into Other (N), the same rule the bar list uses.
  • It's opt-in, so column charts that don't set it are unchanged.
  • Uses it to cap the DAP Impact "Credits over time" legend at five, which was the open next step for that panel in https://gitlab.com/gitlab-org/gitlab/-/work_items/629739.
  • Keeps that panel's second sort key. Segments now follow each flow type's overall total, but the key keeps paging stable when flow types tie on created.
  • Adds a TwoDimensionsWithMaxSeries story to the column chart stories.
  • Moves the rank-and-fold step into a shared foldSeries helper, used by both the bar list and the column chart.

References

Screenshots or screen recordings

From the TwoDimensionsWithMaxSeries story: seven languages, with and without maxSeries: 3.

Before After
before after

How to set up and validate locally

In Storybook:

  1. Run yarn storybook:start and open glql/components/presenters/column_chart → Two Dimensions With Max Series.
  2. Check the legend shows three languages plus Other (4).

In GDK:

  1. Enable the dap_impact_v1 feature flag.
  2. Seed DuoWorkflow credits data across more than six flow types.
  3. Visit /explore/analytics_dashboards/dap_impact?view=3 and check that "Credits over time" shows five flow types plus Other (N) in its legend.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Ezekiel Kigbo

Merge request reports

Loading
Loading