@@ -171,6 +171,7 @@ class XYChartComponent extends React.Component<XYChartProps> {
171171
172172 const chartSeriesTypes =
173173 seriesTypes . size > 1 ? `Mixed chart: ${ [ ...seriesTypes ] . join ( ' and ' ) } chart` : `${ [ ...seriesTypes ] } chart` ;
174+ const chartIdDescription = `${ chartId } --description` ;
174175 return (
175176 < figure >
176177 < canvas
@@ -184,11 +185,11 @@ class XYChartComponent extends React.Component<XYChartProps> {
184185 } }
185186 // eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role
186187 role = "presentation"
187- { ...( description ? { 'aria-describedby' : ` ${ chartId } -- ${ chartSeriesTypes . length } ` } : { } ) }
188+ { ...( description ? { 'aria-describedby' : chartIdDescription } : { } ) }
188189 >
189190 { ( description || useDefaultSummary ) && (
190191 < div className = "echScreenReaderOnly" >
191- { description && < p id = { ` ${ chartId } -- ${ chartSeriesTypes . length } ` } > { description } </ p > }
192+ { description && < p id = { chartIdDescription } > { description } </ p > }
192193 { useDefaultSummary && (
193194 < dl >
194195 < dt > Chart type</ dt >
@@ -262,11 +263,12 @@ const mapStateToProps = (state: GlobalChartState): ReactiveChartStateProps => {
262263 }
263264
264265 const { geometries, geometriesIndex } = computeSeriesGeometriesSelector ( state ) ;
266+ const { debug, description, useDefaultSummary } = getSettingsSpecSelector ( state ) ;
265267
266268 return {
267269 initialized : true ,
268270 isChartEmpty : isChartEmptySelector ( state ) ,
269- debug : getSettingsSpecSelector ( state ) . debug ,
271+ debug,
270272 geometries,
271273 geometriesIndex,
272274 theme : getChartThemeSelector ( state ) ,
@@ -283,8 +285,8 @@ const mapStateToProps = (state: GlobalChartState): ReactiveChartStateProps => {
283285 annotationSpecs : getAnnotationSpecsSelector ( state ) ,
284286 panelGeoms : computePanelsSelectors ( state ) ,
285287 seriesTypes : getSeriesTypes ( state ) ,
286- description : getSettingsSpecSelector ( state ) . description ,
287- useDefaultSummary : getSettingsSpecSelector ( state ) . useDefaultSummary ,
288+ description,
289+ useDefaultSummary,
288290 chartId : getChartIdSelector ( state ) ,
289291 } ;
290292} ;
0 commit comments