Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -78,7 +78,6 @@ export const EventRateChart: FC<Props> = ({
<OverlayRange
key={i}
overlayKey={i}
eventRateChartData={eventRateChartData}
start={range.start}
end={range.end}
color={range.color}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,18 @@

import React, { FC } from 'react';
import { EuiIcon } from '@elastic/eui';
import { RectAnnotation, LineAnnotation, AnnotationDomainTypes } from '@elastic/charts';
import { LineChartPoint } from '../../../../common/chart_loader';
import { RectAnnotation, LineAnnotation, AnnotationDomainTypes, Position } from '@elastic/charts';
import { timeFormatter } from '../../../../../../../../common/util/date_utils';

interface Props {
overlayKey: number;
eventRateChartData: LineChartPoint[];
start: number;
end: number;
color: string;
showMarker?: boolean;
}

export const OverlayRange: FC<Props> = ({
overlayKey,
eventRateChartData,
start,
end,
color,
showMarker = true,
}) => {
const maxHeight = Math.max(...eventRateChartData.map((e) => e.value));

export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMarker = true }) => {
return (
<>
<RectAnnotation
Expand All @@ -41,8 +30,6 @@ export const OverlayRange: FC<Props> = ({
coordinates: {
x0: start,
x1: end,
y0: 0,
y1: maxHeight,
},
},
]}
Expand All @@ -62,16 +49,16 @@ export const OverlayRange: FC<Props> = ({
opacity: 0,
},
}}
markerPosition={Position.Bottom}
hideTooltips={true}
marker={
showMarker ? (
<>
<div style={{ marginLeft: '20px' }}>
<div style={{ textAlign: 'center' }}>
<EuiIcon type="arrowUp" />
</div>
<div style={{ fontWeight: 'normal', color: '#343741' }}>{timeFormatter(start)}</div>
<div>
<div style={{ textAlign: 'center' }}>
<EuiIcon type="arrowUp" />
</div>
</>
<div style={{ fontWeight: 'normal', color: '#343741' }}>{timeFormatter(start)}</div>
</div>
) : undefined
}
/>
Expand Down