GitHub user richardfogaca edited a discussion: Remove nulls option

# Remove Null Values in Timeseries Charts
### Contribution Summary

Added a new control option `removeNullValues` to Timeseries charts that allows 
users to control how null values are handled in their visualizations. When 
enabled, lines will connect across null values instead of breaking at those 
points. The demo has been implemented in the Line chart type but can be 
extended to Bar and Mixed charts as well.

### How It Works

The `removeNullValues` control is implemented as a checkbox in the Chart 
Options section of the control panel. When enabled, it sets `connectNulls: 
true` in the ECharts configuration for line series. This tells ECharts to 
connect data points across null values, creating a continuous line even when 
there are gaps in the data.

The implementation consists of two parts:
1. A new control in the control panel that allows users to toggle the behavior
2. Logic in `transformProps.ts` that applies the `connectNulls` setting to the 
chart configuration

### Screenshot

#### Before
<img width="812" alt="Screenshot 2025-04-08 at 14 15 06" 
src="https://github.com/user-attachments/assets/75efb098-72ca-4477-be4a-f1205a66448c";
 />

#### After
<img width="792" alt="Screenshot 2025-04-08 at 14 15 15" 
src="https://github.com/user-attachments/assets/05b7c833-b27e-4766-8a3b-1c66b9a91bfe";
 />

#### Control
<img width="174" alt="Screenshot 2025-04-08 at 14 15 38" 
src="https://github.com/user-attachments/assets/0c0caf6d-0e0f-4910-836b-9ab23f293374";
 />

### Fork with working prototype
The implementation is available in this 
[fork](https://github.com/richardfogaca/superset/tree/remove-nulls)

### Chart containing null data
[remove 
nulls.zip](https://github.com/user-attachments/files/19654059/remove.nulls.zip)

### Why This Matters

Handling null values effectively is crucial for data visualization, especially 
in time series data where gaps can occur due to various reasons (missing data, 
irregular sampling, etc.). This improvement:

- Gives users more control over how their data is visualized
- Improves readability of charts with missing data points
- Help with cases where showing gaps in data would be misleading
- Is helpful to maintain visual continuity in trend analysis

GitHub link: https://github.com/apache/superset/discussions/33042

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to