Hi, I am trying to create a line chart with a reference line that is an aggregation of a metric. I don't want to show the original metric, only the reference line to it. When I put the metric in optional, it doesn't show the reference. I can set the line weight to 0 of the metric and then show the reference line, and this works well. However, the original metric still shows in the legend. I don't want it showing in the legend.
Is there a way to hide metrics from the legend?
Solved! Go to Solution.
Hiding the legend and making a custom legend (https://how.withlookerstudio.com/data-viz/20200416-looker-studio-chart-legend/) is the best solution I have found
Hi @joshsp
there is no option to show only the reference line but not the original metric.
You mention that you use it as an aggregation of a metric - can you please explain what you mean by that and what you are trying to achieve? I am sure there are other options to help you achieve what you want!
Best
Marc
for example, we have a metric that we're tracking, and we have thresholds that we're trying to make sure it does not exceed. Those thresholds change, which means we can't do a fixed-value reference line, so the threshold is another column in the dataset. I could just plot both columns as lines, but then it looks we're tracking two metrics. Instead, I would like to have a reference line that's the min/max/median/avg of the threshold column.
If you look at a line chart with two data series, the line has whitespace on either side, but the reference line goes completely across and has a nice label on it.
I get that this is a bit nuanced, but most other data viz applications allow you to hide metrics in the legend. Looker (not Studio Pro) for example allows this, as does Tableau and Excel (you would have to hide metrics from the legend in order to create waterfall charts back in the day, for example).
How about putting a box (same color as the report background) over the part of the legend you don’t want to see?
Or, hide the legend altogether and make your own “legend” using a text box or a table.
Hiding the legend and making a custom legend (https://how.withlookerstudio.com/data-viz/20200416-looker-studio-chart-legend/) is the best solution I have found
Awesome!