Skip to content

Commit

Permalink
fix(ddm): Remove connected nulls (#65221)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurKnaus authored Feb 15, 2024
1 parent 639faec commit 6d75ec1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions static/app/views/ddm/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function isNonZeroValue(value: number | null) {
return value !== null && value !== 0;
}

function addAreaChartSeriesPadding(data: Series['data']) {
function addSeriesPadding(data: Series['data']) {
const hasNonZeroSibling = (index: number) => {
return (
isNonZeroValue(data[index - 1]?.value) || isNonZeroValue(data[index + 1]?.value)
Expand Down Expand Up @@ -124,10 +124,9 @@ export const MetricChart = forwardRef<ReactEchartsRef, ChartProps>(
.filter(s => !s.hidden)
.map(s => ({
...s,
...(displayType === MetricDisplayType.AREA
? addAreaChartSeriesPadding(s.data)
...(displayType !== MetricDisplayType.BAR
? addSeriesPadding(s.data)
: {data: s.data}),
connectNulls: displayType === MetricDisplayType.LINE,
}))
// Split series in two parts, one for the main chart and one for the fog of war
// The order is important as the tooltip will show the first series first (for overlaps)
Expand Down

0 comments on commit 6d75ec1

Please sign in to comment.