The Time plot, a very nice viz to quickly identify increases of a metric in time. And it’s pretty 🙂
Of course a community visualization exists but what better way than create a time plot through the native viz of Data Studio
Expected result
To be able to create this kind of trail of colored dots that take a size according to the value of a metric and that spreads over the selected period.
Here I use a personal data source on BigQuery but this method is valid for any data source that has a Date field
We will also see the following concepts:
- EXTRACT() function
- Scatterplot visualization
There is nothing to prepare!
It’s simple, no blending data, no computed fields too far!
We start by adding a Scatterplot visualization on our board
You then get a default configuration of your Scatterplot
The idea now is:
- to get all the points aligned by giving a unique value to the Y axis
- that the X axis corresponds to each day of the selected period
Let’s line up our points
In order for the points to be aligned, the Y axis must take only one value. I choose the value 1 (which is here a Number so it must be aggregated in average otherwise GDS will sum all the 1’s)
1
Get on the X axis the days of the selected period
In order for the X axis to correspond to the days of my selected period, I will have to extract each day in numerical form. We use the EXTRACT() function by extracting the DAY OF THE YEAR from the DATE.
EXTRACT(DAYOFYEAR FROM DATE)
Why should I choose DAYOFYEAR and not just DAY?
DAY can take a value between 1 and 31 (depending on the month) if my selected period overlaps 2 consecutive months, for example October and November, the metric will apply to both Oct. 2 and Nov. 2 and I will have no continuity while DAYOFYEAR will take a value between 1 and 365 and will allow me to bypass the overlapping data.
NB: The X axis must not start with 0 unless you want to display all DAYOFYEAR values (i.e. an axis from 0 to 365)
In “Style”, remember to set the “Min. value of X axis” to “automatic” if you want to reduce the scale of the axis.
Configure the graphic
Add the fields that go well on the Y axis, the X axis and your metric on the size of the bubbles
Tadaaa.
Now you can change the colors, remove the X and Y axis, change the background, add a grid,…
One last tip…
If you want to increase the difference in the size of the round, then switch your metric to the power of 2 or 3 😉
Documentation EXTRACT : https://support.google.com/?visit_id=637515687668660679-2720491554&hl=fr