The Problem
We want to use vertical reference lines in a graph to visualize the start and finish of a product launch on specific dates against the orders received in that period.
The Solution
Using table calculations, we can create vertical bars to reference in graphs. The vertical lines will resemble those in the example below. The blue line shows the orders received, and the pink bars show the launch dates of the product.
Example
-
Create a table calculation that references the dates you want to use:
if(
to_string(${orders.created_date}) = "2019-02-06" OR
to_string(${orders.created_date}) = "2019-02-21"
,
max(${orders.count})+1, null
) -
Then, make sure the following settings are applied in the Visualization Edit menu:
- In the Series menu, set the visualization type for the table calculation to Column.
- In the X menu, change the Scale Type to Ordinal.
- In the Plot menu, make sure Series Positioning is not set to Stacked Percentage.
- In the Plot menu, set the Inner Spacing.