Page MenuHomePhabricator

Print styles do not display bar graphs or pie graphs
Closed, DeclinedPublic

Description

Originally reported by @ABorbaWMF in https://phabricator.wikimedia.org/T172184#3516698

Steps to reproduce

  1. Go to http://reading-web-staging.wmflabs.org/wiki/Berlin
  2. Print/save article as PDF
  3. Note the pie chart on page 8

Observed behavior: chart legend does not contain proper colors
Expected behavior: chart legend should display colors

  1. Note the bar graph on page 9

Observed behavior: graph appears blank
Expected behavior: graph should display information

Notes

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

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 23 2017, 10:32 AM
ovasileva triaged this task as High priority.Aug 23 2017, 10:32 AM
ovasileva moved this task from To Triage to Upcoming on the Readers-Web-Backlog board.

Also observed with:

Template:Bar_chart
Template:Bar_percent_2

Assuming this affects all graph/chart templates with colors

Jdlrobson added a subscriber: Jdlrobson.

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.


If your printer allows it you can enable them:

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 Graphs extension for this template.

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.

Ideally this would be fixed by getting editors to use the Graphs extension for this template.

@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.

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.

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.

ovasileva renamed this task from New print styles do not display bar graphs or pie graphs to Print styles do not display bar graphs or pie graphs.Aug 24 2017, 5:18 PM
ovasileva lowered the priority of this task from High to Low.

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

Nirzar closed this task as Declined.Aug 24 2017, 5:26 PM
Nirzar added a subscriber: Ckoerner.

Next suggested steps:

  1. Update documentation of bars and graphs for editors. Put a note in template documentation that if you use background colors, they might not get printed based on user print settings. Do not rely on color to convey critical information.
  1. Add this in our FAQ for new print styles

can we have @Ckoerner put this on the talk page for the Template:?