한국   대만   중국   일본 
? T173909 Print styles do not display bar graphs or pie graphs
Page Menu Home Phabricator

Print styles do not display bar graphs or pie graphs
Closed, Declined Public

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

Screen Shot 2017-08-23 at 12.26.18 PM.png (351×230 px, 32 KB)

  1. Note the bar graph on page 9

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

Screen Shot 2017-08-23 at 12.27.21 PM.png (184×354 px, 38 KB)

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

ovasileva moved this task from Incoming to Upcoming on the Web-Team-Backlog board.

Also observed with:

Template:Bar_chart
Template:Bar_percent_2

Assuming this affects all graph/chart templates with colors

Jdlrobson subscribed.

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.

Screen Shot 2017-08-23 at 11.52.39 AM.png (163×308 px, 17 KB)

If your printer allows it you can enable them:
Screen Shot 2017-08-23 at 11.52.54 AM.png (345×215 px, 32 KB)

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.

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 MediaWiki-extensions-Graph 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 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:?