Extension talk:Graph/Demo

From MediaWiki.org
Jump to: navigation, search


Have suggested some improvements here [1]

This is exceedingly useful. I just need to be able to pull the what colors correspond to what ranges of numbers out of the map. An example is here [2]. And than I can start creating bunches to add to Wikipedia. Doc James (talk) 23:53, 23 July 2015 (UTC)

This has been resolved with Vega 2.0. --Yurik (talk) 02:54, 24 January 2016 (UTC)


The "Using API" graphs don't load at all for me in Firefox 42, even after disabling NoScript. Nemo 22:54, 16 December 2015 (UTC)

Nemo_bis, There was an issue with caching, should be working now. Please double check. Thx! --Yurik (talk) 02:54, 24 January 2016 (UTC)

Graphs are not the same in previewing mode and reading mode[edit]

The following graph :

is supposed to have a "mouseover" functionality; actually, this functionality works only when previewing the graph. Automatik (talk) 22:08, 1 February 2016 (UTC)

Automatik, you need to enable it with "mode=interactive" (I fixed it above). You might also be interested in commenting on phab:T124254 - to make all graphs load dynamically on desktop. --Yurik (talk) 11:37, 2 February 2016 (UTC)
Thank you Yurik! I suscribed to the phab task. Automatik (talk) 22:16, 2 February 2016 (UTC)

Use of parser functions in "graph" tags[edit]


It seems that we can not use the parser functions —like {{NUMBEROFARTICLES|R}}— in <graph></graph> (a few weeks ago, it was possible):

Syntax error

Is there a way to use them? If not, could it be the case? Automatik (talk) 15:43, 6 March 2016 (UTC)

Automatik, fixed above - use the {{tag:graph| {...} |mode=interactive}}. In general, I would advise to put graphs into their own templates like here. --Yurik (talk) 15:55, 6 March 2016 (UTC)
Automatik P.S. Note that it seems some of these graphs do not exist on mediawiki, that's why it fails. Check it by changing :graph to :code. --Yurik (talk) 16:13, 6 March 2016 (UTC)
Yurik, I do not understand, it worked a few weeks ago on fr.wiktionary (wikt:fr:Discussion Wiktionnaire:Statistiques#graph), now it doesn't work, neither with {{#tag:graph| {...} |mode=interactive}} or without (like before). Seems strange. Automatik (talk) 16:30, 6 March 2016 (UTC)
Automatik, yes, my apologies, I thought I fixed all the cases before turning off template expansion. I had to disable the expansion of the templates inside the <graph> tags because it made other code much slower and more complicated. The template expansion only works if you use the {{#tag:graph|...}}, just like all other tags like <syntaxhighlight> and other. When you use the #tag:graph, make sure to always add a space between two } }. Also, if you ever need to use a pipe | symbol for the graph itself, use the {{!}} instead. Thanks!--Yurik (talk) 17:10, 6 March 2016 (UTC)
Yurik: thank you. For information, this and this seem inconsistent: where is the main version of the template PageViews_graph? — Automatik (talk) 19:16, 6 March 2016 (UTC)
Automatik, thx, updated. --19:40, 6 March 2016 (UTC)

Graphs broken[edit]

Graphs in Using_RESTBase_API section seems broken.--Eloy (talk) 17:48, 20 April 2016 (UTC)

Eloy, there is a graphs' bug that causes invalid images after some time if the graph uses time-based function. The pageviews api call uses last N days, thus the range changes every day. I will need to fix it once i figure out what is the root cause. --Yurik (talk) 00:30, 21 April 2016 (UTC)


I think it would be better if graph's JSON were uploaded to Commons. Or am I wrong?--Eloy (talk) 17:49, 20 April 2016 (UTC)

Eloy, sure, it would be much better to share graphs and modules rather than copying them to each wiki by hand. There is a number of proposals for that, such as shadow namespaces, etc. It will be a long way to get there though :(. --Yurik (talk) 22:42, 20 April 2016 (UTC)

Lua modules?[edit]

Is there a way to construct grpahs with a module? I think this could be linked to Wikidata, also.--Eloy (talk) 17:51, 20 April 2016 (UTC)

Eloy sure, Template:Graph:Chart does exactly that. You can also use a {{#tag:graph| { ...graph definition... } }} approach.--Yurik (talk) 22:40, 20 April 2016 (UTC)


@Yurik: is it possible to draw bar/pie/line charts using data from SPARQL? It works with the maps so i guess it is possible, but i could not figure how it should be done. --Zache (talk) 10:26, 10 October 2017 (UTC)

@Zache:, sure, sparql can be used as another data source. some examples. Also, Template:Graph:Population_history can pull data from Wikidata. --Yurik (talk) 17:42, 10 October 2017 (UTC)
@Yurik: Thanks! Graph:Population history was something what i was searching! I modified the idea and copied it to the d:Wikidata:Wikidata_in_Wikimedia_projects#Maps_and_graphs --Zache (talk) 14:02, 11 October 2017 (UTC)