Page MenuHomePhabricator

Bars in the translation stats graph are too wide when there are few of them
Closed, ResolvedPublic

Description

The Translation dashboard shows a bar chart to represent the user progress translating. When there are few bars these become too wide, to the point that it makes it hard to identify it as a chart:

A proposal for bars to work better:

  • The bars should be about 6px wide with a 3px wide separation between them.
  • We don't need to show all months. If there is little room we show the bars representing the recent months, and include as much as they fit. It is ok to just show a year (12 bars) or 1.5 years (18 bars) of activity, if having a fixed maximum number of bars makes things simpler.
  • The vertical axis should be slightly higher than the tallest bar for bars to reach the very top of the graph. If there is only one bar representing 1 translation, the vertical axis can go up to 5.
  • The blue number should describe the blue bar. This seems to be a bug in the example screenshot, where the last month activity seems to be zero according to the label but does not look like zero according to the graph.

Event Timeline

Change 377270 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Make bars in the translation stats thinner

https://gerrit.wikimedia.org/r/377270

Change 377270 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Make bars in the translation stats thinner

https://gerrit.wikimedia.org/r/377270

Checked in cx-testing. The specs are in place:

The vertical axis is above the tallest bar and the bar themselves are thinner.

@Pginer-WMF Please take a look if something is amiss. I am not entirely sure whether there is a bug in showing ' 0 This month' and '5 total'. I checked the stats from the above screenshots - seems to be correct. This month - September - I did not publish any translation. And the total amount of published articles by my test user is, indeed, 5.

But there is some slight misrepresenting of how many articles have been published - if the total number is 5, why there is already bar showing the same height? Or the blue bar shows kind of the resulting number of translation? If you have some thoughts on whatever it's a bug (a usability issue) or my misunderstanding, please let me know.

Etonkovidova closed this task as Resolved.Sep 20 2017, 12:11 AM

@Pginer-WMF Please take a look if something is amiss. I am not entirely sure whether there is a bug in showing ' 0 This month' and '5 total'. I checked the stats from the above screenshots - seems to be correct. This month - September - I did not publish any translation. And the total amount of published articles by my test user is, indeed, 5.

The main purpose of the ticket seems solved, so for the stats accuracy it is better to open a separate ticket. The way these should work is the following: each bar represents a month. The most recent month is shown in blue. There are two counters: number of translations for the month in blue, and total number of translations. Thus, the blue counter and the blue bar should be representing the same value. In this particular example, that is not the case since the blue bar seems to correspond to 2 translations and the counter says 0.

The reason behind this weird situation is well known, and pointed out to me by @Nikerabbit.

It is affected by how backend returns results for translations in previous months. Results are NOT returned for each month since first translation by user happened (or limited to last X months), but rather results are returned for months in which user actually has translated any article. Months with zero translations are omitted from data returned from API, so situations like this can happen.

This month - September - I did not publish any translation. And the total amount of published articles by my test user is, indeed, 5.

Given the above explanation, since there were no translations in last month (being September), server does not respond with any data for September, and JS code interprets it like zero translations This month, which is correct, but chart is drawn only for returned months, and since there is no data for September, it does not get drawn in the chart, leaving it incorrect.
Numbers representing This month and Total are probably correct for all cases, but chart isn't when there are no translations in some months.

The main purpose of the ticket seems solved, so for the stats accuracy it is better to open a separate ticket.

I think solving how data gets fetched and how to represent months with no translations definitely needs separate ticket. One thing to consider when we solve this issue is when there are no translations for This month, all bars would be gray, and no blue bars to represent current month, which might be confusing to some users.

@Petar.petkovic Will you file a phab task about how data is represented in stats? You have quite good suggestions. Thanks.

@Petar.petkovic Will you file a phab task about how data is represented in stats? You have quite good suggestions. Thanks.

@Etonkovidova Filed under T176513.