You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by gi...@git.apache.org on 2017/09/21 19:52:02 UTC

[GitHub] fabianmenges opened a new pull request #3512: Feature: Making data gaps visible in line charts by inserting zeros

fabianmenges opened a new pull request #3512: Feature: Making data gaps visible in line charts by inserting zeros
URL: https://github.com/apache/incubator-superset/pull/3512
 
 
   ## Description
   For many different kinds of metrics you might want to immediately see that you did not record any values in a given time period (e.g. not registering any user impressions for the first minute of every hour). With the current line chart visualization this would be very difficult to spot, you would have to spot a "missing" marker: 1 out of 60 every hour. 
   
   This merge request adds a "insert zeros" control that takes the current selected `Time Grain` into account to insert 0s into the time series data if the time series did not contain any data points for a given period specified by the `Time Grain`.
   
   ## Example: 
   We are visualizing the `birth_name` example datasource. As you can see looking at the markers on the first screenshot we have one data point per year.
   ![markers](https://user-images.githubusercontent.com/3138343/30714546-3746f46a-9ee1-11e7-9ac9-886dc0456668.png)
   
   As you can see we selected the time grain "month". Checking the box "Insert Zeros" will now
   scan the time series if two data points are more than a month apart from one another it will insert a 0 data point into the time series accordingly.
    
   ![zeros](https://user-images.githubusercontent.com/3138343/30714550-38b106a6-9ee1-11e7-9b35-4475e8fc9b33.png)
   
   ## Features:
   - Works with Druid and Sql
   - Works with Grouped and Filtered Data
   - I the time grain is set to "Time Column" or "All" it applies a heuristic for the correct period length.
   - It will only insert a minimal number of 0s to make the missing data visible.
   
   I added unit tests for the granularity/time-grain/period parsing. Happy to add a unit test for the adding 0 logic, I couldn't find a good place to add the spec file.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services