Unique Visitors metric appear in Graph metric selector for periods for which the metric is disabled, causing confusion amongst users. And also many support requests to our team.
--> When Unique Visitors metric is disabled for the currently selected period, let's hide it from the evolution graph metric picker.
This is what it currently looks like (no data for Unique Visitors):
It is working for the main use case, but there is still a little issue:
-> Even when the metrics are saved as user preferences, the "Unique visitors" metric preference should be ignored when the Unique Visitors feature is disabled for the currently selected period.
@mattab That's are more general problem that needs to be solved. It might always be possible that a metric that is selected for display might become unavailable. E.g. if a plugin metric is chosen and the plugin is disabled.
Also it is not possible to simply remove the metric from the list, as it could then happen that no metric to display remains. In this case a default metric might need to be displayed. But how would such a default metric be determined? The first metric appearing in the report?
Imho we should plan for Matomo 4 to create a metric class for every existing metric. That way we can simply use such classes to check if a metric is available and maybe even use those classes to define alternative metrics to display if one is not available.
Maybe for now we could remove all the metrics that are not defined or
available (but we would still display them when the value is 0), unless it
was the only metric left. This would prevent the issue end maybe you can
follow up with the proper solution in a different issue. It is important
and valuable to hide the unique visitors metrics from graphs in 3.12 👍