Template talk:Graph:Chart
This is the talk page for discussing improvements to the Graph:Chart template. |
|
Archives: 1, 2, 3, 4Auto-archiving period: 10 months |
Dealing with two occurrences of the same year
Hi,
I'm trying to make a graph for the article summarizing the Plaid Cymru election results in Great Britain. The problem I'm facing is that there was a year, namely 1974, where there were two elections, one in February, the other in October. Of course, the software isn't prepared to deal with it.
- When both x labels are named 1974, February's result is erased by October's.
- When the months are added to the year label (-F, -O, .2, .10), the labels are moved after 2019.
- When I'm using "date" as the xType, it seems to show a large integer which I suspect are the UNIX seconds of that date at midnight.
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
What should I do? Thanks. Kahlores (talk) 22:48, 21 December 2019 (UTC)
- One thing which would work - but it is a terrible hack - is to put two graphs side by side. The first graph ends in February 1974 and the second one starts with October 1974... KarlFrei (talk) 12:25, 5 February 2020 (UTC)
How about adding the month to all election dates? Example below. --Birger Fricke (talk) 00:24, 13 March 2020 (UTC)
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
- Interesting idea, but that is not an acceptable date format on en.WP. Maybe more like this?
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
- That looks like it works. – Jonesey95 (talk) 00:43, 13 March 2020 (UTC)
Good! It looks like the module treats numbers on the x-axis as numbers and sorts them into bins, everything else is treated as a string and leads to separate bins that are not sorted. The numbered bins are shown first (on the left) and the string bins are shown to their right. The solution is probably to make the module think that all parameters are strings, as we have done (or change the module). --Birger Fricke (talk) 07:27, 13 March 2020 (UTC)
SVG versus PNG
The charts produced by this template look very nice. However, I have read elsewhere that SVG graphics are preferred over PNG on Wikipedia. Would it be possible to output SVG charts as well? Or is it not so relevant which file type is used? KarlFrei (talk) 10:17, 5 February 2020 (UTC)
- User:Ita140188 pointed out to me that previews of pages with charts look much better than the actual pages. Indeed, if you go and look at a preview of this article page, the graphs look crisp and clear and just as they should... until you hit publish. Both the images on the preview page as well as the images in the published page are PNG files, but the published images look significantly more blurry. I would like to understand the reasoning behind the approach used in this template. Can anyone explain why it was programmed in this way? KarlFrei (talk) 17:34, 8 February 2020 (UTC)
- The Graph extension has an "interactive mode" that renders the charts in SVG instead of PNG. This mode is enabled when you are previewing an article, but not when reading an article. It was turned off for performance and security reasons IIRC. There is an open task to turn it back on, but it seems that any development work on graphing/charting has been deprioritized by WMF. Toohool (talk) 18:53, 8 February 2020 (UTC)
- Thank you. I am still confused though, when I right-click on the image and save it, it automatically is saved as PNG, so I assumed it was a PNG file. However, now that I think about it, I suppose PNG files are not interactive. Anyway, I will go and look into this further. I am surprised about the security reasons; I would expect that a graph could not do much harm if it is hacked (and I wonder how you would hack it in the first place). I also wonder how much of an issue performance is in this day and age... KarlFrei (talk) 20:46, 8 February 2020 (UTC)
Bit late to this, but I also hope the WMF see some value in allowing SVG rendering. They look fantastic before you hit publish and it's such a shame the average user doesn't see that. —Formulaonewiki 08:28, 31 March 2020 (UTC)
Labels on the bottom?
Is there a way to move series labels from the right side to underneath the graph? Horizontal space is often at a premium, and doing so would help with page layout on certain articles. pauli133 (talk) 14:31, 11 March 2020 (UTC)
- The template documentation explains and shows how to do this.
Long legend entries can look clumsy. It may be better to omit the legend parameter and use {{Legend}} (or a similar template) instead: ...
– Jonesey95 (talk) 00:46, 13 March 2020 (UTC)- I was hoping for something integrated into the image, but I guess that works for now. Thanks. pauli133 (talk) 12:35, 13 March 2020 (UTC)
How to force purge
If the graph is pulling data from Commons, such as Talk:2020 coronavirus pandemic in Washington (state)/sandbox, how do I force a purge/redraw of the chart when the data changes? ☆ Bri (talk) 19:56, 19 March 2020 (UTC)
- I find that clicking Edit and then Publish Changes a couple of times, i.e. doing two null edits, is sometimes necessary. – Jonesey95 (talk) 21:24, 19 March 2020 (UTC)
- Can't make the CV chart update no matter what I do. Copying it into a new table every day is possible but tedious, grr ☆ Bri (talk) 23:32, 19 March 2020 (UTC)
Line chart with logarithmic vertical scale
It would be nice to be able to plot data with a logarithmic scale in the vertical (and/or horizontal) axis.
Would it be possible to expand the capabilities to cover this possibility?
Masher oz (talk) 07:50, 21 March 2020 (UTC)
We Need This
Without semi-log and log-log plot capability here, one must go to gnuplot or other external utility and a PNG file to provide a semil-log plot. These cannot be edited by someone who comes in to fix or update something without generating a new PNG file. -- motorfingers : Talk 23:28, 24 March 2020 (UTC)
- @Masher oz and Motorfingers: Done
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. - But finding en.Wikipedia geeky people willing and able to work on this is essential. I only did this because my wishlist request went unanswered for a month and for the COVID-19 pandemic, semilogy graphs are critically important, since locally self-sustaining infection at an exponential rate is clear on this sort of figure. Boud (talk) 14:40, 26 March 2020 (UTC)
Done it Twice, Reverted and Deleted During Frantic Editing
I put the semi-log plot in on the first of the three plots at the bottom of 2020 coronavirus pandemic in the United States. The first time it was instantly reverted by someone who thought that the average person would not understand a semi-log plot and would be misled. I tried again, this time with a one-line explanation for the logarithm-challenged and it held -- until someone updated the charts with more data and broke two of the three charts. Someone else fixed the charts and in that process deleted the log axis.
I tried making the second chart, which is a bar chart and not a line chart, a log chart and find that it's not simple because the formatting changes, and formatting that works for simple linear plot charts will break log plots, so I gave it up for the evening.
The article is updated many times a day. Since semi-log plots get broken by people who update them, I'll leave it for a few days, then try again. In the meantime I'll try to figure out something constructive for the second two charts. I'm not sure that semi-log bar charts are a good idea, and changing the last two plots to line plots while making them log plots may or may not be the best solution for making these summary plots easier to absorb. -- motorfingers : Talk 07:00, 27 March 2020 (UTC)
X-Axis label format bug? (xAxisFormat =)
When trying to format the x-axis labels that are of date format for a bar chart the formatting is not applied. Simply switching to a line chart the issue disappears.
Chart with type= rect:
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
Chart with type= line:
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
— Preceding unsigned comment added by Jimz514 (talk • contribs)
- I have the same problem, and it does not depend on the presence of
xAxisFormat
, but on thexType = date
, and I confirm, it happens only for thetype = rect
, not forline
. - On a similar note, I have a problem with setting the
xAxisMin
andxAxisMax
, again in thedate
type. It looks like if I put them the graph breaks. For example, using the same graph as Jimz514 above:
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
- --Ritchie92 (talk) 09:35, 2 April 2020 (UTC)
- This is not a WP:RFC matter. If you need technical help with a chart, you can ask at WP:VPT. When doing so, it's best to simply direct people here, rather than start another discussion there. --Redrose64 🌹 (talk) 15:18, 23 April 2020 (UTC)
- @Redrose64: thanks for the help, I will do as you suggested. --Ritchie92 (talk) 08:48, 24 April 2020 (UTC)
- This is not a WP:RFC matter. If you need technical help with a chart, you can ask at WP:VPT. When doing so, it's best to simply direct people here, rather than start another discussion there. --Redrose64 🌹 (talk) 15:18, 23 April 2020 (UTC)
- The underlying module is designed to not apply xType date to bar charts (in lines 335-344) and it should remain that way, as bar charts are special in Vega (the software used for this template). The issue could be circumvented by adding an fixed display field, e.g. datum.c, which gets displayed instead of the x-axis timestamp. Only a suggestion here, I am not offering to do that myself.
- The xAxisMin issue is really an separate issue. xAxisMin does support using the timestamp, not an formated date. It has been discussed multiple times among Lua coders that modules should not try to re-throw errors each time something unexpected happens, so I recommend on that one, only updating the /doc, but leaving the code alone.--Snaevar (talk) 14:32, 24 April 2020 (UTC)
Symbols and line-widths upgrade
Hi, I made small upgrade for showSymbols, and linewidths. Now new option are available:
- linewidths: linewidths may be defined for for series with csv (may be useful for crowded charts)
- showSymbols: number as size or default 2.5, may be defined for for series with csv
- symbolsShape: circle, x, square, cross, diamond, triangle_up, triangle_down, triangle_right, triangle_left - may be defined for series with csv
- showSymbols: number or default 2.5,
- symbolsNoFill: if true symbol without fill (only stroke),
- symbolsStroke: symbol stroke, default 2.5 if "x" of symbolsNoFill
For debugging I added function "chartDebugger" that return vega JSON and other runtime info. It's work in progress... tell me what more you would like.
|
|
|
-- contribs) 18:36, 11 April 2020 (UTC)
- Debugging took some time, but well... please tests new options. New version of module is in Module:Graph/sandbox and Template:Graph:Chart/sandbox I've upgraded test-cases little bit to show changes but it's hard to know where something would go wrong in real life examples, please see examples above. Target of changes was to make crowded charts readable. It can be achieved by different line-widths applied to specific series or different symbols. Just as reminder: to have scattered graph you can set set "type = line | showSymbol = | linewidth = 0" for some series. Now it can be combined with other line graphs (series).
- Now new option are:
- linewidths: linewidths may be defined for for series with csv eg. "1, 3, 4, 0"
- showSymbols: number or default 2.5, may be defined for for series with csv eg. "1, 3, 4, 0"
- symbolsShape: circle, x, square, cross, diamond, triangle_up, triangle_down, triangle_right, triangle_left or default circle, - may be defined for series with csv eg. "circle, diamond, square"
- symbolsNoFill: if true symbol without fill (only stroke), for now, global for all symbols
- symbolsStroke: symbol stroke, default 2.5 if "x" of symbolsNoFill, for now, global for all symbols
- chartDebugger()
- In near future (maybe):
- - marks:
- - line strokeDash + serialization,
- - symStroke serialization
- - symbolsNoFill serialization
- - arbitrary SVG path symbol shape as symbolsShape argument
- - annotations
- - vertical / horizontal line at specific values
- - rectangle shape for x,y data range
- - marks:
--Pietrasagh (talk) 19:48, 10 May 2020 (UTC)
- Sorry to ping you all @Mps:, @Yurik:, @Toohool:, @Tom.Reding: but I had no feedback so far. It would be great if you could take a look at it. -- Pietrasagh (talk) 20:23, 25 May 2020 (UTC)
Vertical lines in Wikipedia charts
Hi, I am trying to plot a line graph using this Template. Is there a way to draw vertical and horizontal lines(Not the grids) parallel to axes?Timbaaa (talk) 15:56, 18 April 2020 (UTC)
As someone who's currently working on election result graphs for Canadian constituencies, it would be nice if I could use this as a label for when a redistricting happens. Username6892 16:31, 19 April 2020 (UTC)
- It may be possible in near future. Vega engine standing behind Graph:Chart template module allow to put any symbol mark (defined by svg path). As you can see on my example above on the right you can put banana as symbol so vertical or horizontal line should also be possible. Example is generated by sandbox version of module under development. In current version of module to have horizontal line you can add data series with constant value.
{{Graph:Chart | x = 1,2,3,4,5 | y1 = 2,4,0,1,3 | y2 = 2, , , ,2 }}
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. - Thanks for your response, I will be waiting for those vertical lines.Timbaaa (talk) 10:15, 22 April 2020 (UTC)
- Timbaaa, have you seen this? https://www.mediawiki.org/wiki/Extension:Graph/Demo/falkensee . Does not use this template, tho. HLHJ (talk) 03:17, 23 April 2020 (UTC)
- @HLHJ: Thanks, I'll try using it. Looks frightening tho. :( Timbaaa (talk) 03:52, 23 April 2020 (UTC)
- Timbaaa: It isn't the friendliest UI. You could cut-and-paste the whole thing into the sandbox here and change it incrementally. HLHJ (talk) 15:07, 23 April 2020 (UTC)
- @HLHJ: Thanks, I'll try using it. Looks frightening tho. :( Timbaaa (talk) 03:52, 23 April 2020 (UTC)
- Timbaaa, have you seen this? https://www.mediawiki.org/wiki/Extension:Graph/Demo/falkensee . Does not use this template, tho. HLHJ (talk) 03:17, 23 April 2020 (UTC)
- Thanks for your response, I will be waiting for those vertical lines.Timbaaa (talk) 10:15, 22 April 2020 (UTC)
@HLHJ: Yes, thats what in doing in my user sandbox. Timbaaa (talk) 01:48, 24 April 2020 (UTC)
Automating cumulative series
Grabbing Jimz514's example here, this graph, and dozens like it in the mainspace, have a line which is simply a cumulative sum of the other line:
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
The template behind it says:
| y1=0,1,0,0,0,0,0,0,0,0,0,0,0,0,11,17,11,12,17,15,15,13,15 | y2=0,1,1,1,1,1,1,1,1,1,1,1,1,1,12,29,40,52,69,84,99,112,127 ... | y1Title=New Cases | y2Title=Total Confirmed Cases
There is no logical need to input y2 by hand, and it's slow, tedious, and error-prone for long data series. Could we give the template a way to make a simple cumulative line graph, ideally with the cumulation running in either direction (>than or <than)? I'm looking for something where the template says something like this (pseudocode):
| y1=0,1,0,0,0,0,0,0,0,0,0,0,0,0,11,17,11,12,17,15,15,13,15 | y2=cumulative_sum(y1, direction=increasing_x)
I am not sure if this is something fairly simple which can be done quickly, as Boud did for the log-lin plots above, or rather more difficult. I assume that it would require adding to de:Modul:Graph. I had a go at it, but I know nothing about Lua (there must surely be some library that sums arrays elegantly), or about how to test graph templates... and the obvious way to do it is not very efficient. Any more expert suggestions? HLHJ (talk) 03:17, 23 April 2020 (UTC)
- OK, so I've done it in Vega-lite, but while it works in the Vega-lite online editor it does not work in the Mediawiki sandbox; it says "TypeError: (intermediate value).forEach is not a function":. I also cannot use the same method to get differences, important as some jurisdictions give stats of "active cases". I've made up some additions to the dataset to make it clearer what it is doing:
Extended content
|
---|
<graph>
"data":
{
"name": "cases",
"values": [
{"date": "2020/03/01","new cases": 0},
{"date": "2020/03/02","new cases": 1},
{"date": "2020/03/03","new cases": 0},
{"date": "2020/03/04","new cases": 0},
{"date": "2020/03/05","new cases": 0},
{"date": "2020/03/06","new cases": 0},
{"date": "2020/03/07","new cases": 0},
{"date": "2020/03/08","new cases": 0},
{"date": "2020/03/09","new cases": 0},
{"date": "2020/03/10","new cases": 0},
{"date": "2020/03/11","new cases": 0},
{"date": "2020/03/12","new cases": 0},
{"date": "2020/03/13","new cases": 0},
{"date": "2020/03/14","new cases": 0},
{"date": "2020/03/15","new cases": 11},
{"date": "2020/03/16","new cases": 17},
{"date": "2020/03/17","new cases": 11},
{"date": "2020/03/18","new cases": 12},
{"date": "2020/03/19","new cases": 17},
{"date": "2020/03/20","new cases": 15},
{"date": "2020/03/21","new cases": 15, "recoveries": 1, "deaths":1},
{"date": "2020/03/22","new cases": 13, "recoveries": 3},
{"date": "2020/03/23","new cases": 15, "recoveries": 4},
{"date": "2020/03/24","new cases": 0, "recoveries": 5, "deaths":1}
]
},
"transform": [{
"window": [{"op": "sum", "field": "new cases", "as": "cumulative cases"}],
"frame": [null, 0]
}],
"repeat": {
"layer": ["cumulative cases", "new cases", "recoveries"]
},
"spec": {
"mark": {"type": "line", "point": true},
"encoding": {
"x": {
"field": "date",
"timeUnit": "date",
"title": "Date",
"type": "ordinal"
},
"y": {
"field": {"repeat": "layer"},
"title": "",
"type": "quantitative"
},
"color": {
"datum": {"repeat": "layer"},
"type": "nominal"
}
}
}
|
Somewhat astonishingly, parallel syntax will give cumulative deaths, but only one cumulative-sum variable can be plotted at once. Suggestions welcome. HLHJ (talk) 01:30, 24 April 2020 (UTC)
- "TypeError: (intermediate value).forEach is not a function" seems to be caused by wrong syntax in "data" section. Graph (and Vega) need to have syntax like:
{ "data": [{"name": "...", "values": [{"x": "...","y": "..."},{"x": "...","y": "..."}]}]}
- "TypeError: (intermediate value).forEach is not a function" seems to be caused by wrong syntax in "data" section. Graph (and Vega) need to have syntax like:
- Vega-lite allow data definition without "[ ... ]". This is what cause error. It seems that Graph extension is not compatible at all with Vega-lite syntax, and mostly with current Vega syntax. Examples from Vega website don't work. And valid working Graphs from wiki don't work on Vega editor (errors like "[Error] TypeError: o is undefined"). I think that graph extension need a lot of update because vega current version is 5 and wiki developers are working to switch from "vega 1" to "vega 2". Unfortunatelly debugging with graph sandbox is very hard. Error messages are not helpful and if there's problem with syntax it doesn't show anything. -- Pietrasagh (talk) 11:00, 26 April 2020 (UTC)
- Indeed, adding the square brackets gets me an "invalidtext:[object Object]" error instead :
Extended content
|
---|
<graph>
{ "data":
[
{
"name": "cases",
"values":
[
{"date": "2020/03/01","new cases": 0},
{"date": "2020/03/02","new cases": 1},
{"date": "2020/03/03","new cases": 0},
{"date": "2020/03/04","new cases": 0},
{"date": "2020/03/05","new cases": 0},
{"date": "2020/03/06","new cases": 0},
{"date": "2020/03/07","new cases": 0},
{"date": "2020/03/08","new cases": 0},
{"date": "2020/03/09","new cases": 0},
{"date": "2020/03/10","new cases": 0},
{"date": "2020/03/11","new cases": 0},
{"date": "2020/03/12","new cases": 0},
{"date": "2020/03/13","new cases": 0},
{"date": "2020/03/14","new cases": 0},
{"date": "2020/03/15","new cases": 11},
{"date": "2020/03/16","new cases": 17},
{"date": "2020/03/17","new cases": 11},
{"date": "2020/03/18","new cases": 12},
{"date": "2020/03/19","new cases": 17},
{"date": "2020/03/20","new cases": 15},
{"date": "2020/03/21","new cases": 15, "recoveries": 1, "deaths":1},
{"date": "2020/03/22","new cases": 13, "recoveries": 3},
{"date": "2020/03/23","new cases": 15, "recoveries": 4},
{"date": "2020/03/24","new cases": 0, "recoveries": 5, "deaths":1}
]
}
]
},
"transform": [{
"window": [{"op": "sum", "field": "new cases", "as": "cumulative cases"}],
"frame": [null, 0]
}],
"repeat": {
"layer": ["cumulative cases", "new cases", "recoveries"]
},
"spec": {
"mark": {"type": "line", "point": true},
"encoding": {
"x": {
"field": "date",
"timeUnit": "date",
"title": "Date",
"type": "ordinal"
},
"y": {
"field": {"repeat": "layer"},
"title": "",
"type": "quantitative"
},
"color": {
"datum": {"repeat": "layer"},
"type": "nominal"
}
}
}
|
- If the documentation I was reading is several steps behind the software, that would explain why I was struggling. Thank you, Pietrasagh. I was hoping to add this to the template, and maybe add violin plots, too, but possibly I'd best steer clear for now. I imagine the Wikidata connectivity is a higher priority; it would be very good to have all this COVID-19 info live from Wikidata. HLHJ (talk) 04:51, 6 May 2020 (UTC)
Formatting questions
Hi, I'm working on a graph at User:Eddie891/GAGraph, and there are several things I wan't to do, but don't have the technological know-how to do. Anyone who can advise on what to do/or tell me it's impossible on-wiki, would be greatly appreciated. 1) I want to gray out the background for sections when backlog drives are in progress, like how this graph is done. 2) I want to highlight specific points on the graph (i.e. all time lowest numbers, highest, etc.). Again, any suggestions would appreciated! Eddie891 Talk Work 23:13, 27 April 2020 (UTC)
- The template doesn't currently support either of those things. I think it would be worthwhile to add both as features, though. For the former, maybe something like
|timespan1=2008-01-01/2009-01-01,2010-01-01/2011-01-01|timespan1color=#999999
. Seems like it should be fairly simple to add to the module, but it would be best to make sure the syntax works well for a variety of cases before setting it up. --Yair rand (talk) 00:41, 28 April 2020 (UTC)- now it's only possible to do with <graph></graph> extension. But, as described 2 sections above, JSON syntax is tricky. Good example of similar graph is | "falkensee" graph on MediaWiki. I will try to work on it in next upgrades to Graph module. --Pietrasagh (talk) 18:41, 3 May 2020 (UTC)
- Thanks again, Pietrasagh! As a comment, Yair rand, since not all x-axes are time, I'd suggest something more like
|vertical1=2008-01-01/2009-01-01,2010-01-01/2011-01-01|vertical1color=#999999|vertical1label="strange years"
. if only one x-value is given, it should make a visible vertical line. HLHJ (talk) 04:56, 6 May 2020 (UTC)- @HLHJ: Good points. Perhaps it would also be worthwhile to have similar options for horizontal areas/lines. Regarding the naming, it might be better to use the "xAxis[Foo][#]/yAxis[Foo][#]" naming convention for consistency with certain other properties. Not sure what to end it with; maybe "region", "highlight", "markers"? --Yair rand (talk) 20:58, 7 May 2020 (UTC)
- Thanks again, Pietrasagh! As a comment, Yair rand, since not all x-axes are time, I'd suggest something more like
- now it's only possible to do with <graph></graph> extension. But, as described 2 sections above, JSON syntax is tricky. Good example of similar graph is | "falkensee" graph on MediaWiki. I will try to work on it in next upgrades to Graph module. --Pietrasagh (talk) 18:41, 3 May 2020 (UTC)
That strange "empty,blank" space on timeline.
Hey!
Maybe someone knows how to remove thats odd "empty, blank" space from the start and end of graph timeline? Here I explain what I meant and here too.
You can clearly see that some graph from COVID-19_pandemic_in_Poland have that odd empty space, and some don't, any solutions? thx, Natanieluz (talk) 09:24, 4 May 2020 (UTC)
Crowding of x-axis labels
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
Is there a solution for easing the crowding of x-axis labels on the bottoms of charts with many entries? I don't want the chart to be overly wide or else some users may have to use horizontal scrolling to see it all. Is there a way to skip every [X_number] of labels? -- Veggies (talk) 13:27, 7 May 2020 (UTC)
- It can be done "automatically" but unfortunately doesn't work for bar chart. There's bug in Graph:Chart module or deeper in Extension:Graph. It was already mentioned in this talk. To make it work you need to change "type" to "line" or "area" and add option "xType = date".
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. - --Pietrasagh (talk) 19:51, 9 May 2020 (UTC)
xType = date makes the values disappear
I am trying to do what is suggested above with this graph:
Daily cases for the most infected African countries:
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
However, adding "|xType = date", as suggested above, makes everything disappear. What am I doing wrong?
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
- Interesting, no matter how many times I previewed the page, the graph was blank. Having actually submitted it, it works as expected. Leaving this here in case someone else has the same issue. Greenman (talk) 21:48, 20 May 2020 (UTC)
- That is still true on 22 may 2020
Dates in native language
What is the way to have the dates in native language, for instance Spanish on Spanish wikipedia, French on French wikipedia, German on German wikipedia and so on...
Could you document it on the documentation page? Else, just document dates type are not supported. — Preceding unsigned comment added by 88.136.214.91 (talk) 08:44, 22 May 2020 (UTC)
- It's not (yet) supported by Chart:Graph. Native time format seems to be technically possible. There are advanced time format options few software layers below (Graph:Chart -> Extension:Graph -> Vega framework -> D3 framework). I will try to test it and put in next updates. Pietrasagh (talk) 06:52, 24 May 2020 (UTC)
Graphs moving to client-side rendering
As part of the architecture and overhead cleanup of MediaWiki, graph rendering will be deprecated from server-side and moved to client-side rendering. This change will largely only affect users with Javascript disabled; users will have to change their browser setting (if possible) to allow Javascript in order to properly render the graph.
There is no further action required by the community as this change does not affect the code to write graphs. This change should be deployed within the next few weeks, I'll keep the community updated when we get closer to the change-over date. Keegan (WMF) (talk) 20:37, 11 May 2020 (UTC)
- @Keegan (WMF): Are the individuals responsible for this decision aware that circumstances on the English Wikipedia have recently-ish changed somewhat, such that many of the most-viewed articles on the site now use graphs? (Eg the Covid-19-by-country articles, many of which have 6 or 7 graphs and have been getting many millions of views.) The impact of the delayed rendering would likely be quite considerable. --Yair rand (talk) 21:26, 11 May 2020 (UTC)
- @Yair rand: Everyone is aware of the importance of the Covid-19 graphs; there's separate work going on to shore up part of the graphs infrastructure to support this wide-scale use. As it relates to this change, the results to the end user should be an improvement from the current graph experience. Keegan (WMF) (talk) 16:54, 12 May 2020 (UTC)
- If my theory is true (see below), clientside rendering will greatly improve the reading experience, and that might very well be why this change is happening. I doubt clientside rendering will be very slow. An easy way to test it is to preview any section containing a graph. What you see is a canvas element, not an image. Depending on how big the graph is, it might actually be faster to display clientside. — MusikAnimal talk 21:36, 11 May 2020 (UTC)
- @Keegan (WMF): Does this mean we get nice, crisp graphs rather than the blurry dithering that we see now? Also what about fetching data from a .tab file on Commons -- will it re-fetch the data more quickly? I ask because when we preview an edit, the graph is rendered clientside and it doesn't have the aforementioned problems. It's only post-save that it looks blurry, and Commons updates take up to 24 hours to show up (!!). Thanks for the update, — MusikAnimal talk 21:29, 11 May 2020 (UTC)
- For the first question, that's one end goal - clean, crisp, quickly rendered graphs. As to the question about .tab files, I don't know right now. I'll see what I can find out. Keegan (WMF) (talk) 16:54, 12 May 2020 (UTC)
@Keegan (WMF): will this help fix the issue discussed on the section above ? --Hagnat (talk) 18:50, 13 May 2020 (UTC)
- I do not think so, as those look like problems coming from the Graph extension itself. This only regards where the graph renders. Keegan (WMF) (talk) 17:10, 15 May 2020 (UTC)
No radial grid for pie chart and corona chart
In a pie or corona chart
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
Graphs are unavailable due to technical issues. Updates on reimplementing the Graph extension, which will be known as the Chart extension, can be found on Phabricator and on MediaWiki.org. |
One might like to have some kind of radial grid which might look like a clock graduation, for instance
|
|
How can the graph be displayed over the radial grad?
Standard way to add a title and a source
Some writers might be interested to have an easy and regular way to provide some title or some source for their graphs, such as:
| ||
Source(s): WHO[1], WHO_2[2] |
Not sure if any source or reference is useful in wikipedia, but in case it is, what is the standard way to to it for a graph?
- Documentation recommends to use Image frame or Side box templates -- Pietrasagh (talk) 09:15, 24 May 2020 (UTC)
- For the French Wikipedia, template: fr:Modèle:Vignette multiple documentation does not document such a thing.
- Moreover some page layout makes the picture needs to be full width rather than boxed on the right. — Preceding unsigned comment added by 88.136.209.92 (talk) 06:42, 1 June 2020 (UTC)
Space as thousand separator on the French wikipedia
The option showValues=format allows to configure the way the number is displayed.
It provides a "," thousand separator for the English language wikipedia.
But how do you mark the " " (space) thousand separator for the French language wikipdia?