Skip to content

feat: add xAxisMaxItems (max lines) to line charts - #263

Open
jean-code-bot[bot] wants to merge 1 commit into
mainfrom
feat/line-chart-max-items
Open

feat: add xAxisMaxItems (max lines) to line charts#263
jean-code-bot[bot] wants to merge 1 commit into
mainfrom
feat/line-chart-max-items

Conversation

@jean-code-bot

@jean-code-bot jean-code-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports the "max bars" pattern from BarChartDefaultPro to the line charts, giving users a Max x-axis items input to cap how many data points are rendered.

What changed

LineChartDefaultPro

  • Added inputs.xAxisMaxItems to the component inputs list (appears under Axes Settings)
  • Added xAxisMaxItems?: number to LineChartProProps
  • Passes maxItems: xAxisMaxItems into getLineChartProData
  • getLineChartProData now calls groupTailAsOther with maxItems — identical to how getBarChartProData works — so excess items are rolled into an Other bucket

LineChartWithKpiTabsPro

  • Inherits the new input automatically (its meta spreads lineChartDefaultPro.meta)
  • Threads xAxisMaxItems through to getLineChartProData

Tests

  • Two new unit tests added to LineChartDefaultPro.utils.test.ts covering maxItems forwarding to groupTailAsOther
  • All existing line chart tests continue to pass

Note: 12 pre-existing test failures in FilterBuilderWithGroupingPro were on main before this branch was cut — not caused by these changes.

…bsPro

Port the max-bars pattern from BarChartDefaultPro to the line charts.

- Add `xAxisMaxItems` input to LineChartDefaultPro definition
- Thread `xAxisMaxItems` prop through LineChartDefaultPro and LineChartWithKpiTabsPro components
- Use `groupTailAsOther` in `getLineChartProData` to limit displayed points and roll the remainder into an 'Other' bucket
- LineChartWithKpiTabsPro inherits the new input automatically via lineChartDefaultPro.meta spread
- Add unit tests for maxItems behaviour in LineChartDefaultPro.utils
@sonarqubecloud

Copy link
Copy Markdown

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

Successfully merging this pull request may close these issues.

0 participants