diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-with-three-layers-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-with-three-layers-visually-looks-correct-1-snap.png index fb8ffb424f..9c804c39ac 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-with-three-layers-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-with-three-layers-visually-looks-correct-1-snap.png differ diff --git a/src/components/legend/label.tsx b/src/components/legend/label.tsx index 6298e02252..e51303a42e 100644 --- a/src/components/legend/label.tsx +++ b/src/components/legend/label.tsx @@ -23,17 +23,19 @@ import React, { MouseEventHandler } from 'react'; interface LabelProps { label: string; isSeriesHidden?: boolean; + isToggleable?: boolean; onClick?: MouseEventHandler; } /** * Label component used to display text in legend item * @internal */ -export function Label({ label, onClick, isSeriesHidden }: LabelProps) { +export function Label({ label, isToggleable, onClick, isSeriesHidden }: LabelProps) { const labelClassNames = classNames('echLegendItem__label', { 'echLegendItem__label--clickable': Boolean(onClick), }); - return ( + + return isToggleable ? ( + ) : ( +
+ {label} +
); } diff --git a/src/components/legend/legend_item.tsx b/src/components/legend/legend_item.tsx index 6da2ef66e0..6b3532101b 100644 --- a/src/components/legend/legend_item.tsx +++ b/src/components/legend/legend_item.tsx @@ -236,7 +236,12 @@ export class LegendListItem extends Component hasColorPicker={hasColorPicker} onClick={this.handleColorClick(hasColorPicker)} /> - + {showExtra && extra && renderExtra(extra, isSeriesHidden)} {Action && (