Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ddm): Remove connected nulls #65221

Merged
merged 1 commit into from
Feb 15, 2024
Merged
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
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
Loading