Skip to content

Commit 5b9ffac

Browse files
authored
fix(legend): custom legend covered by background (#2366)
1 parent 7bebd6b commit 5b9ffac

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/charts/src/components/_global.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
bottom: 0;
1414
left: 0;
1515
right: 0;
16+
z-index: 0;
1617
}

packages/charts/src/components/legend/_legend.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.echLegend {
2+
z-index: 1;
3+
24
.echLegendList {
35
display: grid;
46
grid-template-columns: minmax(0, 1fr);

storybook/stories/legend/16_custom_legend.story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const allMetrics = [...data3, ...data2, ...data1];
4242

4343
export const Example: ChartsStory = (_, { title, description }) => {
4444
const customLegend: CustomLegend = ({ items, pointerValue }) => (
45-
<div style={{ width: '100%', position: 'relative' }}>
45+
<div style={{ width: '100%' }}>
4646
<p style={{ height: '1.5em' }}>{pointerValue ? moment(pointerValue?.value).format('HH:mm') : 'System Load'}</p>
4747
{items.map((i) => (
4848
<button

0 commit comments

Comments
 (0)