Wikipedia Diskussion:Lua/Modul/Graph

message: Ich bruache einen Ersatz für diese Einbindung normalerweise sollte das hier die Grafik 2 sein, der Rest sind nur Tests. Da sollen aber bitteschön Jahreszahlen stehen und keine, was weiß ich, Literangaben? Das wird jedoch nur für die Balkendiagramme ausgegeben. Wie bekommt man das so hin, dass dort auch Jahresangaben stehen? Kann das bitte jemand anpassen, oder kann man nur die Balken für derartige Darstellungen nutzen, dann sollte das in der Doku aber erklärt werden. --Liebe Grüße, Lómelinde Diskussion 19:02, 17. Dez. 2015 (CET)
thread_title:  Fehler in Modul? 

message: User:Mps, there are two minor bugs I found: for pie graphs, you add "axes":[], and you make two identical transformations "from": {"data": "chart", "transform": [{"type": "pie", "field": "y"}]} inside each mark (text and arc), instead of making one common data source and using it for both of the marks.  Regardless, great job on keeping the graphs going! :) --Yurik (Diskussion) 00:29, 3. Feb. 2016 (CET)
replies: text: P.S. I think it would be good to also add a filtering transform for the text mark when doing pie chart, so that if you want to print a label for each slice, and the pie slice is very small, don't print for it:
      "from": {
        "data": "values",
        "transform": [{"type": "filter", "test": "(datum.layout_end - datum.layout_start) > 0.2"}]
      },
--Yurik (Diskussion) 01:26, 3. Feb. 2016 (CET)
thread_title:  Minor cleanup 

message: With this bogus code (missing coma at the end of first y values line):

currently renders as:
Lua-Fehler  in Modul:Graph, Zeile 243: attempt to concatenate global 'name' (a nil value)
There is tow problems:
* The script error is hidden by the graph tag. My suggestion is to add the graph tag directly in the Module rather than in the template.
* There is an error when generating the error message, as it uses an undefined global name (line 243).
Regards, --Zebulon84 (Diskussion) 16:58, 13. Apr. 2016 (CEST)
thread_title:  Error in error 

message: Sorry for writing in English. There is a problem with Graph images on mobile version pages. If you look at the mobile version of this page the graph images are just blank rectangles. This seems to be true for all graphs and maps that use this module. It affects the images that are in subsections of the page, (first paragraphs work fine) because the mobile version has a system ('lazy image loader') to only download an image if the user scrolls down the page. From what I have found by right-clicking 'inspect' over the empty graph, (but I am afraid with very limited technical knowledge) the problem could be in the way the lazy loader creates a 
So the correct image is there and ready to be displayed, but nothing is visible because there is zero width and height. But I have no idea how the lazy loader finds these sizes, or why it is failing.
Comparing this to a wikimedia.commons image, this has (for example)
<img width="400" height="300" class="thumbimage image-lazy-loaded" alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/....jpg" srcset="" style="width: 400px; height: 300px;">
The use of the 'graph' module in maps means it is particularly missed if reading from a mobile phone about a place you are in. If there is someone with the understanding to sort this out, it will be a big benefit. Thanks, RobinLeicester (Diskussion) 21:25, 14. Mär. 2019 (CET)
replies: text: A solution to the problem has been found through a style.css file, enabling the relevant height and width to inherit appropriate values. This has been applied to the en: and mediawiki versions of Graph:Street map with marks, but may need rolling out to other graph modules and other languages. If anyone knows how the structure of the various graph templates works, and can do this in an efficient manner, it will re-instate a lot of graphs on mobile devices. More details of the fix are at phabT216431, and the css is at www.mediawiki.org/wiki/Template:Graph:Street_map_with_marks/styles.css. RobinLeicester (Diskussion) 20:10, 7. Mai 2019 (CEST)
thread_title:  Graphs not displaying on mobile version pages. 

message: Lange Legenden sind schwierig - entweder wird die Grafik unendlich breit, wenn man das nicht will, hilft ein Zeilenumbruch, aber das wird nicht richtig unterstützt:
Kann das möglicherweise leicht repariert werden? Das wäre schön. --dingensfünf 14:36, 19. Jul. 2019 (CEST)
replies: text: Wie man das repariert, weiß ich leider nicht. Doch eine mögliche schnelle Lösung wäre die Benutzung der Vorlage:Farblegende anstelle der eingebauten Legende. --Birger (Diskussion) 08:12, 13. Mär. 2020 (CET)
thread_title:  Zeilenumbruch in Legende 

message: Hello. There is a compatibility problem between colour templates that use nowiki tags (such as :en:Template:Liberal Democrats (UK)/meta/color) and this module. Please see :en:Template talk:Graph:Chart#Problem with nowiki and this template. 202.159.169.45 (talk) 22:54, 15 September 2019 (UTC) 
: Die nowiki-Tags können mit dem Code in den nachfolgenden Abschnitten interagieren und wurden daher verschleiert. Mathglot (Diskussion) 23:26, 1. Sep. 2022 (CEST)
thread_title:  Problem with &lt;nowiki> and this module 

message: (sorry for the English) because dewiki and most wikimedia projects use CC-BY-SA-3.0, this module cannot be imported to enwikinews. Would the contributors be willing to release their work into the public domain, so that licensing isn't an issue? The following users have made contributions and would need to agree: Mps, Yurik, Yair rand, Tom.Reding, Leoncastro, Birger Fricke, Toohool (contributions imported from enwiki). Please consider allowing this to be used on wikinews by releasing your contributions into the public domain (just need to confirm that each of you are okay with it by saying so below). Thanks so much, --DannyS712 (Diskussion) 20:42, 7. Apr. 2020 (CEST)
replies: text: Certainly. I agree to release my contributions to this module to the public domain. (Note that licensing under CC-BY or CC-0 would work as well, if I understand correctly.) --Yair rand (Diskussion) 21:02, 7. Apr. 2020 (CEST)
replies: text: I agree too. Toohool (Diskussion) 00:12, 8. Apr. 2020 (CEST)

text: I agree. --Birger (Diskussion) 07:05, 8. Apr. 2020 (CEST)

text: Same here, cc0 is fine )) --Yurik (Diskussion) 06:33, 17. Apr. 2020 (CEST)

text: I agree. Tom.Reding (Diskussion) 13:29, 17. Apr. 2020 (CEST)

text:  I agree. -- Leoncastro (Diskussion) 14:54, 17. Apr. 2020 (CEST)

text:  Fine by me too. But it would be nice that when you copy it over, to at least link to (e.g. on the talk page) where you got it from. As Yair has mentioned CC-BY should also work on Wikinews as the only requirement is attribution. --Mps、かみまみたDisk. 12:44, 19. Apr. 2020 (CEST)

text: Mps, Yurik, Yair rand, Tom.Reding, Leoncastro, Birger Fricke, Toohool sorry for the trouble, but a user on enwikinews believes that your agreement that the contributions be released into the public domain is not enough, and wants you to also explicitly state that you agree to license it under CC0 as well. Do you agree? Thanks, --DannyS712 (Diskussion) 21:23, 19. Apr. 2020 (CEST)
replies: text: I agree to CC0. Toohool (Diskussion) 22:53, 19. Apr. 2020 (CEST)

text:  I am not a licensing expert, but I think that from the moment we allow to release this into the public domain (PD), you can do almost anything you want with this, except redistribute it under a non-derivative license (ND, like CC-BY-ND or CC-BY-NC-ND). PD is fully compatible with CC0 or CC-BY. So, do whatever you want. Regards. -- Leoncastro (Diskussion) 00:11, 20. Apr. 2020 (CEST)
replies: text:  I agree with you, but an admin on enwikinews doesn't, and wanted to be sure --DannyS712 (Diskussion) 00:32, 20. Apr. 2020 (CEST)

text:  Leoncastro just to be clear, you agree to CC0? --DannyS712 (Diskussion) 12:10, 20. Apr. 2020 (CEST)
replies: text:  @DannyS712, I have agreed to release this work into the public domain, so I have agreed to use it with other compatible licenses, including CC0 or CC-BY, as I said. -- Leoncastro (Diskussion) 15:24, 20. Apr. 2020 (CEST)

text: I agree to CC0. Tom.Reding (Diskussion) 11:35, 20. Apr. 2020 (CEST)

text: I agree to CC0. --Yair rand (Diskussion) 05:23, 27. Apr. 2020 (CEST)

text: I agree to CC0. --Mps、かみまみたDisk. 15:48, 3. Mai 2020 (CEST)

text: I agree to CC0. --Birger (Diskussion) 08:44, 9. Jun. 2020 (CEST)
thread_title:  Relicense 

message: To make this work with d:Template:Wikidata list (Listeria) on Wikidata, I added a lowercase variable names on Wikidata . You might want to include that here too. 
d:Template:Wikidata_list#Charts has an explanation on how to use it. Sample chart at d:Wikidata:Lists/COVID-19 deaths/numbers/chart. --Jura1 (Diskussion) 10:03, 26. Apr. 2020 (CEST)
thread_title:  Compatibility with Listeria 

message: Hallo, könnte es sein, dass es im Modul eine Änderung gegeben hat, die dazu führt, dass andere Artikel als nicht vollständig gesichtet gelten?
* https://de.wikipedia.org/w/index.php?title=Modul:Graph&diff=cur&oldid=201182147
* Vorlagen- und Dateiänderungen dieser Version sind noch nicht markiert. Die gesichtete Version wurde am 27. Juni 2020 markiert.
* Vorlagen/Dateien wurden aktualisiert (nicht markierte Seiten sind in fett gekennzeichnet): Modul:Graph
* https://de.wikipedia.org/w/index.php?title=Die_Tageszeitung&stable=0&redirect=no
Oder sehe ich das falsch? (Im Artikel sehen ich keine ungesichteten Änderung.)
Viele Grüße --Molgreen (Diskussion) 18:48, 27. Jun. 2020 (CEST)
thread_title:  Offene Sichtung? (Bitte um Sichtung) 

message: Hi,
We're having problems to create a Module:Graph/WorldMap-iso2.json on :fr because the Module namespace is normally for Lua instead of JSON.
Wouldn't it be possible to use a WorldMap-iso2.json on Commons instead of a local one on each wiki? This would also make it easier to keep it up to date. The RedBurn (ϕ) 13:09, 27. Aug. 2020 (CEST)
thread_title:  Common WorldMap-iso2.json for all wikis on Commons 

message: On mobile, the loading spinner appears from behind graphs drawn with this module when horizontally scrolling on them. I've filed a bug report , but maybe this can be solved directly in the module? Somnifuguist (Diskussion) 04:33, 13. Jul. 2021 (CEST)
thread_title:  Loading spinner bug 

message: Hi! I have added an option for the line color (called linecolor, to match  linewidth) of a pie chart to the sandbox: Special:Diff/215633154.
You can see it in action at s:en:Template:Progress_pie_chart, where some pie charts may have a "missing" section. Hopefully it can be added upstream here to keep it in sync. Inductiveload (Diskussion) 15:50, 16. Sep. 2021 (CEST)
thread_title:  Line color for pie charts 

message: so, it seems that when marking missing data points for y1 by commas, the templates (module) "trims" them, and shift the non-empty values leftward: this graph shows y1 values on the wrong stacks. (|y1 = 100,,,, 100,140,70) this does not happen in a similar fashion with y2:
same graph, transposing y1 and y2:
a quick workaround can be filling those with zeroes, however, zeroes are not good friends with showValues, as the zeroes are written with no corresponding "rect". i think it's worth fixing.
(addition): see cols "two" and "four" below, when filling the gaps with zeroes:
peace - קיפודנחש (Diskussion) 02:44, 20. Mär. 2022 (CET)
thread_title:  y1 mishandles missing values 

message: :Click [Ausklappen] for English text. Kopie des ursprünglichen Vorschlags: :en:Module talk:Graph#Right-side y-axis.
(toggle English)
I'd like to propose an enhancement to allow a second y-Axis. It's frequently the case that one might want to plot line graphs (or scatterplots) of two sets of numerical data that follow roughly similar patterns but where the data values of one set are roughly twice the other (or 3x, or 10x or whatever; e.g., slowly increasing backlogs of articles in two areas, where one set of numbers is triple the other).  Here's an example of a time-series graph with two curves where y-axis is article count: curve 1 (blue) is a count of articles with 0 in-links (i.e. :en:WP:Orphans; y-vals around 1200-1600) belonging to a particular WikiProject, and curve 2 (gold) is articles with 1 in-link (values around 4800-5200): I've hacked this below, by scaling down the 1-link values by 0.3, as follows (all data prior to April are fake; the last two datapoints are real, see quarry:63580):
----
Ich möchte eine Verbesserung vorschlagen, um eine zweite y-Achse zu ermöglichen. Es kommt häufig vor, dass man Liniendiagramme (oder Streudiagramme) von zwei numerischen Datensätzen erstellen möchte, die ungefähr ähnlichen Mustern folgen, aber bei denen die Datenwerte des einen Satzes ungefähr doppelt so hoch sind wie die des anderen (oder 3x, oder 10x oder was auch immer; z.B. langsam ansteigende Rückstände von Artikeln in zwei Bereichen, bei denen ein Satz von Zahlen das Dreifache des anderen beträgt).  Hier ist ein Beispiel für ein Zeitseriendiagramm mit zwei Kurven, wobei die y-Achse die Anzahl der Artikel ist: Kurve 1 (blau) ist die Anzahl der Artikel mit 0 In-Links (d.h. "Waisen"; y-Werte um 1200-1600), die zu einem bestimmten WikiProjekt gehören, und Kurve 2 (gold) sind Artikel mit 1 In-Link (Werte um 4800-5200): Ich habe dies unten gehackt, indem ich die 1-Link-Werte um 0,3 herunterskaliert habe, wie folgt (alle Daten vor April sind gefälscht; die letzten beiden Datenpunkte sind echt, siehe quarry:63580):
:::
Was ich gerne sehen würde, wäre eine zweite y-Achse auf der rechten Seite, skaliert von etwa 4400-5800, möglicherweise mit dem Zusatz dieser Parameter:
What I'd like to see would be a second y-axis on the right, scaled from roughly 4400-5800, possibly with the addition of these parameters:
* |yAxis2Max=5800
* |yAxis2Min=4200
* |yAxis2Title=Anzahl der Artikel – count of articles
* |yAxis2Format
* |yAxis2Angle
* |yGrid2
(toggle English)
The important ones are the first two, which ought to be optional and default to a calculation based on min y2 value and max y2 value, and but overridable for fine tuning. A scale factor should be derived for biasing y2 values up or down the y-axis according to the right-side y-axis; sort of what I did with my hacky use of  on the gold curve above. The other params are cosmetic. Naturally, this only makes sense for numerical yType like integer, not date or string, etc. The last param is about deciding how to align the grid lines; default to lined up with major 'tick marks' on the left y-axis, but if |yGrid2=1, then align with right-side tick marks. Maybe |yGrid2=2 means, 'every 2nd major tick mark', to make the grid sparser. (Or maybe lines both left and right, in separate styles such as dashed or dotted?)
----
Die wichtigsten sind die ersten beiden, die optional sein sollten und standardmäßig auf einer Berechnung basierend auf dem minimalen y2-Wert und dem maximalen y2-Wert basieren sollten, aber für eine Feinabstimmung überschrieben werden können. Ein Skalierungsfaktor sollte abgeleitet werden, um die y2-Werte auf der y-Achse entsprechend der rechten y-Achse nach oben oder unten zu verzerren; in etwa so, wie ich es mit meiner hackende Verwendung von auf der goldenen Kurve oben gemacht habe. Die anderen Parameter sind kosmetisch. Natürlich ist dies nur für numerische yType wie integer sinnvoll, nicht für date oder string, etc. Der letzte Parameter legt fest, wie die Rasterlinien ausgerichtet werden sollen; standardmäßig werden sie an den großen Teilstriche auf der linken y-Achse ausgerichtet, aber wenn |yGrid2=1 ist, dann werden sie an den Teilstriche auf der rechten Seite ausgerichtet. Vielleicht bedeutet |yGrid2=2 "jede 2. Haupt-Teilstriche, um das Gitter spärlicher zu machen. (Oder vielleicht Linien links und rechts in separaten Stilen wie gestrichelt oder gepunktet?)
Vielen Dank im Voraus. Mathglot (Diskussion) 23:29, 1. Sep. 2022 (CEST)
thread_title:  Y-Achse rechts — Right-side y-axis 

message: Would it be possible to add a title setup? Similar to Template:Graph:Lines perhaps. Thank you for consideration - and apologies for posting in English. --Varnent (Diskussion) 18:22, 4. Nov. 2022 (CET)
thread_title:  Add a 'title' setting? 

message: I have noticed that when using bar type of a chart, the formatting of the date doesn't work. It is possible to be seen down below where is the chart three times with same data however it's a different type of a chart every time. At an x axis, the formatting of the years using %Y etc. (but it also affects regular dates like 2022-02-02). Instead, an Unix number is displayed. Is there anybody able to fix it, please?
Example mentioned above:
 --Bilykralik16 (Diskussion) 23:38, 27. Dez. 2022 (CET)
thread_title:  Date formatting 

message: Hi! I thought you may find this interesting: https://www.mediawiki.org/w/index.php?title=Multilingual_Templates_and_Modules&withJS=MediaWiki:Synchronizer.js#synchronizer-Modul:Graph
Perhaps the relatively large number of Forked wikis is because many copied from enwiki? Just guessing. Cheers! --Sophivorus (Diskussion) 01:52, 30. Jan. 2023 (CET)
thread_title:  Synchronizer 

message: Does anyone else is working on update of modules for graphs to Vega 5? I'm doing my best here https://en.wikipedia.beta.wmflabs.org/wiki/Module:Graph/sandbox but progress is very slow (see here https://en.wikipedia.beta.wmflabs.org/wiki/Template:Graph:Chart/sandbox).
For details please see here mw:Extension_talk:Graph#Assistance_in_migrating_Module:Graph_on_Beta_Labs --Pietrasagh (Diskussion) 16:36, 2. Sep. 2023 (CEST)
thread_title:  Vega 5