Skip to content

Added dynamic data example in line chart-v9 stories - #36791

Open
v-baambati wants to merge 16 commits into
microsoft:masterfrom
v-baambati:LineChartChangeDataFunctionality
Open

v-baambati wants to merge 16 commits into
microsoft:masterfrom
v-baambati:LineChartChangeDataFunctionality

Conversation

@v-baambati

Copy link
Copy Markdown
Contributor

No description provided.

@v-baambati
v-baambati requested a review from a team as a code owner September 24, 2026 07:38
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-charts
AreaChart
406.902 kB
127.183 kB
408.443 kB
127.7 kB
1.541 kB
517 B
react-charts
DeclarativeChart
758.446 kB
222.689 kB
761.468 kB
223.483 kB
3.022 kB
794 B
react-charts
DonutChart
317.733 kB
97.977 kB
318.748 kB
98.387 kB
1.015 kB
410 B
react-charts
FunnelChart
309.133 kB
94.775 kB
310.163 kB
95.176 kB
1.03 kB
401 B
react-charts
GanttChart
390.032 kB
121.663 kB
391.357 kB
122.124 kB
1.325 kB
461 B
react-charts
GaugeChart
317.083 kB
97.402 kB
318.763 kB
97.982 kB
1.68 kB
580 B
react-charts
GroupedVerticalBarChart
398.115 kB
124.454 kB
399.461 kB
124.907 kB
1.346 kB
453 B
react-charts
HeatMapChart
392.172 kB
122.702 kB
393.551 kB
123.179 kB
1.379 kB
477 B
react-charts
HorizontalBarChart
297.409 kB
90.473 kB
298.426 kB
90.863 kB
1.017 kB
390 B
react-charts
Legends
236.596 kB
71.053 kB
237.539 kB
71.405 kB
943 B
352 B
react-charts
LineChart
418.251 kB
130.314 kB
419.878 kB
130.837 kB
1.627 kB
523 B
react-charts
PolarChart
345.588 kB
108.005 kB
346.6 kB
108.371 kB
1.012 kB
366 B
react-charts
SankeyChart
213.797 kB
68.722 kB
214.426 kB
68.971 kB
629 B
249 B
react-charts
ScatterChart
397.575 kB
124.369 kB
398.908 kB
124.799 kB
1.333 kB
430 B
react-charts
Sparkline
80.888 kB
26.864 kB
81.156 kB
26.99 kB
268 B
126 B
react-charts
VerticalBarChart
434.566 kB
129.339 kB
435.882 kB
129.784 kB
1.316 kB
445 B
react-charts
VerticalStackedBarChart
404.13 kB
125.845 kB
405.46 kB
126.273 kB
1.33 kB
428 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-charts
HorizontalBarChartWithAxis
63 B
83 B
🤖 This report was generated against 775d999919dff6e02287ce6a1c07e233af2bf777
@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@@ -0,0 +1,6 @@
{
"type": "patch",
"comment": "Added dynamic data example in line chart-v9 stories",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the comment and PR title. This is not a example update anymore

ref={el => {
_rootElem.current = el;
}}
onBlur={_handleChartBlur}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ReviewAgent] Bug: a segment keeps its focus ring and its callout while focus sits on a legend: _renderLegends() is inside this root at :740, so relatedTarget never leaves and _hideCallout(true) never runs. scope the blur to the arc group, or clear focusedElement when the new target isnt a segment.

Technical detail & examples

Blur handling moved off each arc and the needle, where it was onBlur={_handleBlur} calling _hideCallout(true), onto the component root. _handleChartBlur at GaugeChart.tsx:382 only hides when isFocusLeavingChart(event) is true, that is when relatedTarget is outside event.currentTarget.

_renderLegends() is rendered inside that same root at GaugeChart.tsx:740, and Legends.tsx:339 renders each legend as a focusable Button. useArrowNavigationGroup is applied to the inner chartWrapper, so Tab out of the arc group lands on the first legend button, which is still inside the root. relatedTarget is therefore inside currentTarget, _hideCallout(true) is skipped, and two pieces of state stay stale.

focusedElement keeps the arc's legend, so GaugeChart.tsx:675 keeps strokeWidth={ARC_PADDING} on an arc that no longer has focus. The only writer that clears it is _hideCallout(true); _hideCallout(false), reached from _handleMouseOut and _handleCalloutDismiss, leaves it set. isPopoverOpen also stays true with refSelected still pointing at the arc, so the callout hangs off an unfocused element.

The legend Button additionally fires hoverAction, which calls setHoveredLegend, so _legendHighlighted flips underneath the still-open callout and the other arcs lose their tabIndex.

Sibling charts still dismiss on element blur: LineChart.tsx:642, :907, :985, :1073, :1150 and :1203, ScatterChart.tsx:471, AreaChart.tsx:786 and VerticalStackedBarChart.tsx:659. GaugeChart is now the only one that holds a focus indicator on an element that does not have focus.

Fix: put the blur handler on the chartWrapper or on the arc listbox group instead of the root, or keep the root handler and clear focusedElement whenever relatedTarget is not one of the arc or needle elements.

This branch has not been deployed

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

Labels

None yet

2 participants