Page MenuHomePhabricator

Hide legend when there is only one series in a chart
Open, MediumPublicFeature

Description

When there is only one series in a chart, there is no need to display the legend. Here are some examples:

In all such cases, no legend should be shown as the type of value being tracked is explained on either the axis label or the chart title.

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Feature Request".Apr 6 2025, 5:39 PM

@Nosferattus: For future reference, please use the feature request form (linked from the top of the task creation page) to create feature requests. Thanks.

CCiufo-WMF renamed this task from Hide key when there is only one key item in a chart to Hide legend when there is only one series in a chart.Apr 29 2025, 9:48 PM
CCiufo-WMF updated the task description. (Show Details)
Bugreporter2 subscribed.

A better option here would be the ability to hide the legend, however many things it contains.

We used to have a showLegend option, but this option has been removed in the course of T376656.

Well, I'm not really picky about whether there is a showLegend option or the legend is just removed by default for single series charts. I support whatever option is the easiest and quickest to implement.

I don't think it's a good idea to hide functionality from users. The developers really have to give users this functionality and trust that they're going to misuse it.

Of course, there will be misuse. This is Wikipedia. Wikipedia users are going to think that all sorts of bizarre charts are good ideas, and add them to articles, then scream "vandalism!" when they are removed for being utter garbage. But anyway, that's the job of the Wikipedia community to fix. You just need to concentrate on giving them the functionality.