Skip to content

Commit 1202501

Browse files
Add "Missing and NULL values" option to scatter chart (#7523)
1 parent ac81f0b commit 1202501

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

viz-lib/src/visualizations/chart/Editor/GeneralSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export default function GeneralSettings({ options, data, onOptionsChange }: any)
336336
</Section>
337337
)}
338338

339-
{!includes(["custom", "heatmap", "bubble", "scatter"], options.globalSeriesType) && (
339+
{!includes(["custom", "heatmap", "bubble"], options.globalSeriesType) && (
340340
// @ts-expect-error ts-migrate(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message
341341
<Section>
342342
<Select

viz-lib/src/visualizations/chart/plotly/prepareDefaultData.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ function prepareSeries(series: any, options: any, numSeries: any, additionalOpti
9696
// For bubble/scatter charts `y` may be any (similar to `x`) - numeric is only bubble size;
9797
// for other types `y` is always number
9898
const cleanYValue = includes(["bubble", "scatter"], seriesOptions.type)
99-
? normalizeValue
99+
? (v: any, axixType: any) => {
100+
v = normalizeValue(v, axixType);
101+
return includes(["scatter"], seriesOptions.type) && options.missingValuesAsZero && isNil(v) ? 0.0 : v;
102+
}
100103
: (v: any) => {
101104
v = cleanNumber(v);
102105
return options.missingValuesAsZero && isNil(v) ? 0.0 : v;

0 commit comments

Comments
 (0)