Sometimes when you're making a visualization, you don't have complete data for every year of something you're trying to show.
In the Bar chart race template, there are four ways to handle empty or invalid values. You can find them in the Number formatting settings, under "Invalid cells".
The options and when to use them
- Use this option if you'd like to "bridge the gap" between the last valid and the next valid value in your dataset. The visualization will run smoothest with this option, as it calculates the proportionate steps between the different values and the numbers will keep ticking.
- Use last valid
- Use this option if you'd like to use the last valid option instead of filling the gap with the interpolation. You might want to choose this if you only want to work with values that are strictly in your dataset, or if you want to highlight a period of stagnation. If you choose this option, the ticking of the numbers will stop for the steps where there is no data.
- Treat as zero
- Use this option if you'd like to treat invalid cells as zero. Keep in mind that your bar will likely disappear if it has a value of zero. You should use this option if you want to "kick out" values that are invalid during the race.
- Remove bar
- Use this option if you'd like to remove any bar that contains an invalid cell. Use this option if you only want to show bars with complete data for all the steps. This choice will have a similar effect to treating the cell as zero, as it will float to the bottom of the bar chart race, out of sight.
What option do we have here? (Keep an eye on China.)
Why, number two – "Use last valid" – obviously! You can see that the numbers stop ticking and the bar isn't interpolating between two values.