Skip to content

Commit

Permalink
fix(explore): Incomplete series on area chart should not be stacked
Browse files Browse the repository at this point in the history
The incomplete series should not have a stacked config so the area chart is
unstacked which is the same as the rest of the chart.
  • Loading branch information
Zylphrex committed Nov 14, 2024
1 parent 3ae2f67 commit 92e7e36
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions static/app/views/insights/common/components/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,23 @@ function Chart({
if (type === ChartType.LINE || type === ChartType.AREA) {
const metricChartType =
type === ChartType.AREA ? MetricDisplayType.AREA : MetricDisplayType.LINE;
const seriesToShow = series.map(serie =>
createIngestionSeries(serie as MetricSeries, ingestionBuckets, metricChartType)
);
const seriesToShow = series.map(serie => {
const ingestionSeries = createIngestionSeries(
serie as MetricSeries,
ingestionBuckets,
metricChartType
);
// this helper causes all the incomplete series to stack, here we remove the stacking
for (const s of ingestionSeries) {
delete s.stack;
}
return ingestionSeries;
});
[series, incompleteSeries] = seriesToShow.reduce(
(acc, serie, index) => {
const [trimmed, incomplete] = acc;
const {markLine: _, ...incompleteSerie} = serie[1] ?? {};

return [
[...trimmed, {...serie[0], color: colors[index]}],
[
Expand Down

0 comments on commit 92e7e36

Please sign in to comment.