Originally reported by @ABorbaWMF in https://phabricator.wikimedia.org/T172184#3516698
Observed behavior: chart legend does not contain proper colors Expected behavior: chart legend should display colors
Observed behavior: graph appears blank Expected behavior: graph should display information
For bar chart, the following template is used: https://en.wikipedia.org/wiki/Template:Bar_box For pie chart, https://en.wikipedia.org/wiki/Template:Pie_chart
We might want to test through some of these: https://en.wikipedia.org/wiki/Category:Chart,_diagram_and_graph_templates to see if other things break as well
Also observed with:
Template:Bar_chart Template:Bar_percent_2
Assuming this affects all graph/chart templates with colors
Moved to needs analysis as I reminder to look into this. We'll need to work out why this is happening before we can confidently estimate the work here.
This is because print styles by default remove background colours from elements. The chart is an image and the key is HTML using background graphics.
There's not much we can do here to fix this.
Could we treat them as images perhaps?
No. The only way to fix this would be editors changing how they do keys everywhere, but that doesn't really make sense as an image increases the file size and the printer settings provide a workaround. Including the key in the image prevents translation.
Ideally this would be fixed by getting editors to use the MediaWiki-extensions-Graph extension for this template.
In T173909#3546626 , @Jdlrobson wrote: No. The only way to fix this would be editors changing how they do keys everywhere, but that doesn't really make sense as an image increases the file size and the printer settings provide a workaround. Including the key in the image prevents translation.
Not sure I'm following here - what type of translation? My worry about the printer settings is that most users would not be able to associate "background graphics" with legends not displaying.
@CKoerner_WMF - do you know of any conversations around using the graphs templates?
As a last resort, we could perhaps add a message on the page that informs users of the issue.
So generally the way most websites deal with this is the image which contains the graph also contains the key, for example consider the image for "Unemployment rate under last three presidents" on http://www.bbc.com/news/world-europe-39038685
The problem our editors have is if they did that, the image they used would need to be edited and changed for all 200+ projects, as images cannot be translated easily, - it would only be reusable on English Wikipedias. So what they do, quite rightly, is write the key separate to the image. https://www.mediawiki.org/wiki/Extension:Graph#Charts_examples does not have this problem.
There is absolutely nothing we can do technically to address this, except recommend to editors to use the Graph extension highlighting this as a problem. It's a problem in the existing print styles and will continue to be a problem in the new print styles.
Per standup we should decline this / mark as invalid and make sure this is captured in a FAQ. There is nothing technical we can do here per https://phabricator.wikimedia.org/T173909#3548401
Next suggested steps:
can we have @Ckoerner put this on the talk page for the Template:?
Clarifying not added to the print style documentation: https://www.mediawiki.org/wiki/Reading/Web/Projects/Print_Styles#Limitations