Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = R
onClick={pointData.onClick}
Comment thread
v-baambati marked this conversation as resolved.
aria-label={getAriaLabel(pointData, singleSet.xAxisPoint)}
tabIndex={_legendHighlighted(pointData.legend) || _noLegendHighlighted() ? 0 : undefined}
role="img"
role="option"
/>,
);

Expand Down Expand Up @@ -636,8 +636,15 @@ export const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = R
}
}
});
const legendVal = props.chartTitle?.trim() || singleSet.groupSeries?.[0]?.legend || 'Series';
Comment thread
v-baambati marked this conversation as resolved.
Outdated
const chartGroupAriaLabel = `${legendVal}, bar ${singleSet.indexNum + 1} of ${_datasetForBars.length} with ${
singleSet.groupSeries?.length || 0
} data points.`;

return (
<g
role="listbox"
aria-label={chartGroupAriaLabel}
Comment thread
v-baambati marked this conversation as resolved.
Outdated
key={singleSet.indexNum}
transform={`translate(${xScale0(singleSet.xAxisPoint) + (xScale0.bandwidth() - effectiveGroupWidth) / 2}, 0)`}
>
Expand Down Expand Up @@ -871,7 +878,7 @@ export const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = R
tabIndex={shouldHighlight ? 0 : undefined}
onFocus={e => _onLineFocus(e, series, seriesIdx, pointIdx)}
onBlur={_onBarLeave}
role="img"
role="option"
aria-label={getAriaLabel(
{
xAxisCalloutData: point.xAxisCalloutData,
Expand All @@ -891,11 +898,19 @@ export const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = R
dots.push(<g key={`dotGroup-${seriesIdx}`}>{dotGroup}</g>);
Comment thread
v-baambati marked this conversation as resolved.
Outdated
});

const legendVal = props.chartTitle?.trim() || _lineData[0]?.legend || 'Series';
const chartGroupAriaLabel = `${legendVal}, line series with ${_lineData.length} groups and ${_lineData.reduce(
(sum, series) => sum + (series.data?.length || 0),
0,
)} data points.`;

return dots.length > 0 ? (
<g>
{lineBorders.length > 0 ? <g>{lineBorders}</g> : null}
{lines.length > 0 ? <g>{lines}</g> : null}
<g>{dots}</g>
<g role="listbox" aria-label={chartGroupAriaLabel}>
Comment thread
v-baambati marked this conversation as resolved.
Outdated
{dots}
</g>
</g>
) : null;
};
Expand Down
Loading
Loading