Skip to content

Commit

Permalink
🐛 Fix non-interactive legend issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Oct 20, 2021
1 parent 453d4bc commit 2df15b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export function PieComponent(
legendPosition={legendPosition || Position.Right}
legendMaxDepth={nestedLegend ? undefined : 1 /* Color is based only on first layer */}
onElementClick={props.interactive ?? true ? onElementClickHandler : undefined}
legendAction={getLegendAction(firstTable, onClickValue)}
legendAction={props.interactive ? getLegendAction(firstTable, onClickValue) : undefined}
theme={{
...chartTheme,
background: {
Expand Down
18 changes: 11 additions & 7 deletions x-pack/plugins/lens/public/xy_visualization/expression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -599,13 +599,17 @@ export function XYChart({
xDomain={xDomain}
onBrushEnd={interactive ? (brushHandler as BrushEndListener) : undefined}
onElementClick={interactive ? clickHandler : undefined}
legendAction={getLegendAction(
filteredLayers,
data.tables,
onClickValue,
formatFactory,
layersAlreadyFormatted
)}
legendAction={
interactive
? getLegendAction(
filteredLayers,
data.tables,
onClickValue,
formatFactory,
layersAlreadyFormatted
)
: undefined
}
showLegendExtra={isHistogramViz && valuesInLegend}
/>

Expand Down

0 comments on commit 2df15b4

Please sign in to comment.