This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 | Archive 4 |
Hi, I made small upgrade for showSymbols, and linewidths. Now new option are available:
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)
--Pietrasagh (talk) 19:48, 10 May 2020 (UTC)
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?
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)
xType = date
) --Pietrasagh (talk) 14:56, 8 August 2020 (UTC)Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
How can i make all graphs look the same except different values on the x axis? xType = string only stops "interpolating", values continue to be ordered like integers. Error/bug of the template?
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Second: How can i increase font-size of the x-axis? Thanks, 92.116.88.169 (talk) 23:36, 15 June 2020 (UTC)
|
|
<graph></graph>
tag. Documentation for extension is heremw:Extension:Graph and for Vega is here. You can test your code in Special:GraphSandbox --Pietrasagh (talk) 17:37, 12 August 2020 (UTC)Active cases vs recovered&deaths
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Original xAxis lable positions is next: Active cases in hospital per day
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
185.66.253.38 (talk) 16:59, 7 August 2020 (UTC)
a) 20 apr both y1 and y2 is empty, so "20 apr" kick off from xAxis. (2 and 4 may too)
b) 31 jul only y1 is empty, so "31 jul" kick out to the end of xAxis. But all OK when empty only y2 (3 aug).
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
185.66.252.235 (talk) 12:32, 13 August 2020 (UTC)
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Multiple series should be should be made into single series as `field` to use in vega(on which the graph extension is built). While using `fold` property to do that(which reads series one after another and stores as single field with multiple values and corresponding labeld), series are read in order and stored in order of reading. In this case, y1 had `null` value on 31Jul, it is omitted while reading y1 and included when reading y2(which is read after going through all y1 values). That's why it is stored at last.This can be overcome by using |xType=date
. Or, it will be considered as `ordinal` and plot as is stored.
Does this explanation good enough?
About What I realy want with chart features is additional parameters "dontShow0" (in showValues) and "blankAs0" or "dontMissBlank" on axis.
can you elaborate? Are you suggesting to replace `null`s(black) to `0`?
- Timbaaa -> ping me 03:12, 20 August 2020 (UTC)
Graph with showSymbols= and type=rect parameters shift symbols right (examples [2], [3], [4], [5]).
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
185.66.252.235 (talk) 06:53, 19 August 2020 (UTC)
Graph with showSymbols= and type=stackedrect parameters shift symbols down (examples [6], [7], [8]).
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
185.66.252.235 (talk) 06:53, 19 August 2020 (UTC)
showValues with type=rect always swow values up, but even value is negative (examples [9], [10])
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
185.66.252.235 (talk) 07:24, 19 August 2020 (UTC)
A recent updated has caused y-values to be repeated when the y-values only encompass a small range. An example can be seen at List of The Flash episodes#Ratings. A similar post was made at Template talk:Graph:Chart/Archive 1#y axis numbers go wrong for low integers without a fix, as well as at Template talk:Graph:Chart/Archive 1#X axis labeling bug with fewer than 8 items?, where the issue was with the |xType=
parameter, and the solution was to use |xType=string
. This doesn't work for |yType=
. Can we either revert recent updates or get a fix for this, please? -- /Alex/21 05:50, 24 August 2020 (UTC)
@Pietrasagh: Take note of this discussion, update including this in next patch.- Timbaaa -> ping me 11:38, 24 August 2020 (UTC)
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
I designed the graph at right for World War II to replace the static image below it. It worked fine in preview, but when I saved, it displayed a "file not found" icon with the rest blank (I'll see if it does the same thing here). I see in the preview here Note: In the editor preview the graph extension creates a canvas element with vector graphics. However, when saving the page a PNG raster graphics is generated instead.
So I assume that there's some error happening behind the scenes. Help? ((u|Sdkb)) talk 20:45, 30 August 2020 (UTC)
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)
((Graph:Chart
| x = 1,2,3,4,5
| y1 = 2,4,0,1,3
| y2 = 2, , , ,2
))
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
@HLHJ: Yes, thats what in doing in my user sandbox. Timbaaa (talk) 01:48, 24 April 2020 (UTC)
hAnnotatonsLine=4, 5, 6
hAnnotationLabel = label1, label2, label3
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
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): will this help fix the issue discussed on the section above ? --Hagnat (talk) 18:50, 13 May 2020 (UTC)
@Keegan (WMF): if you don't mind, could I have an update on this? Also looking forward to crisp graphs; currently legibility is poor. ɱ (talk) 02:16, 25 October 2020 (UTC)
See Special:Permalink/1000499955#Data. The errors persist even when I turn on safemode. The full stack trace, with debug turned on:
Extended content
|
---|
Uncaught TypeError: func is undefined
itemBounds jQuery
load.php:630:859
jQuery 2
forEach self-hosted:206
jQuery 5
recurse self-hosted:1161
jQuery 30
runScript https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:13
execute https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:14
doPropagation https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:7
(Async: requestIdleCallback handler)
requestIdleCallback self-hosted:1161
requestPropagation https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:7
setAndPropagate https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:8
implement https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:20
<anonymous> jQuery
|
I'm doing something wrong with the template, right? Enterprisey (talk!) 10:08, 15 January 2021 (UTC)
type=bar
is not correct, please use type=rect
instead. Pietrasagh (talk) 11:40, 24 January 2021 (UTC)
How should one use this graph, where data is provided by the commons .tab file?- Timbaaa -> ping me 02:26, 14 July 2020 (UTC)
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Extended content
|
---|
{
"version": 2,
"width": 900,
"height": 400,
"padding": "strict",
"signals": [{"name": "rightwidth", "expr": "width + padding.right"}],
"data": [{
"name": "chart",
"url": "tabular:///COVID-19 cases in Tamil Nadu.tab",
"format": {"type": "json"
, "property": "data"
, "parse": {"date": "date"}
},
"transform": [
{"type": "formula", "field": "_xfield", "expr":
"datum.date"
}
, {"type": "sort", "by": ["_xfield"]}
, {"type": "fold", "fields": ["activeCases"]}
, {"type": "formula", "field": "_yfield", "expr": "datum.value" }
]
},
{
"name": "labels",
"url": "tabular:///COVID-19 cases in Tamil Nadu.tab",
"format": {"type": "json", "property": "fields"}
}
],
"scales": [
{
"name": "x",
"type": "time",
"domain": {"data": "chart", "field": "_xfield"},
"range": "width",
},
{
"name": "y",
"type": "linear",
"range": "height",
"domain": {"data": "chart", "field": "_yfield"},
},
{
"name": "color",
"type": "ordinal",
"domain": {"data": "chart", "field": "key"},
"range": "category10"
},
{
"name": "labels",
"type": "ordinal",
"domain": {"data": "labels", "field": "name"},
"range": {"data": "labels", "field": "title"},
}
],
"legends": [{
"fill": "color",
"stroke": "color",
"title": "Legend",
"properties": { "labels": { "text": {"scale": "labels", "field": "data"} } }
}],
"axes": [
{"scale": "x", "type": "x", "tickSizeEnd": 0
, "ticks": 7
, "title": "Date"
, "grid": true
},
{"scale": "y", "type": "y", "tickSizeEnd": 0
, "title": "Count"
, "grid": true
}
],
"marks": [
{
"type": "group",
"from": {
"data": "chart",
"transform": [{"type": "facet", "groupby": ["key"]}]
},
"marks": [
{
"type": "line",
"properties": {
"enter": {
"y": {"scale": "y", "field": "_yfield"},
"x": {"scale": "x", "field": "_xfield"},
"stroke": {"scale": "color", "field": "key"},
"interpolate": {"value": "monotone"},
"strokeWidth": {"value": 2.5}
}
}
}
],
}
]
}
|
→ Timbaaatalk 14:48, 1 September 2020 (UTC)
Could some guidance be provided in the template documentation on how xAxisMax is calculated for dates in line graphs? I have just fixed the graph at 2016 Peruvian general election#Presidential election by trial and error as I have no idea how the figure input (1460000000000) corresponds to what the end date of the graph is (something around 7 April 2016). Cheers, Number 57 12:52, 19 February 2021 (UTC)
xAxisMax
. Pietrasagh (talk) 15:11, 21 February 2021 (UTC)Hi,
@Snaevar: mentioned (at the very bottom) that "xAxisMin does support using the timestamp, not an formated date". I tried different types of timestamps but couldn't find one that worked, what is the actual format?
Example with xAxisMin = 1586037600
:
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
The RedBurn (ϕ) 22:46, 28 February 2021 (UTC)
At Template:COVID-19 pandemic data/United Kingdom new cases by day reported chart, I'm struggling to get the x-axis to cover more than 1 whole year- tried expanding size, removing 'direction: rtl;', inserting extra commas after x & y data sets, but no fix because problem seems related to it only wanting to show one year's worth and the first date was 28 Feb last year... if I introduce |xaxismin/ max it just wraps around- there's probably a trivial fix but I can't find it... TIA, Yadsalohcin (talk) 02:34, 1 March 2021 (UTC)
The Graphs don t appear in the PDF Version. Is this a known problem and is there any solution? Yomomo (talk) 21:20, 27 May 2021 (UTC)
I am working on graphs for opinion polling. The problem is I have two options: either I use Graph:Chart but I have to store all the data within the graph (as in here), or I use Graph:Lines but I can't have individual dots for individual polls (as in here, and I'm not sure the basis interpolation works well either). Can it please be possible to use Commons tabular data for this template (at least for scatter plots)? Julio974◆ (Talk-Contribs) 17:24, 12 March 2021 (UTC)
| interpolate = bundle | symbols = 1
. For just scatter plot without lines you can use linewidth = 0
. If you like it I will push changes form sandbox. Pietrasagh (talk) 12:29, 22 May 2021 (UTC)
The configuration options for showValues (format, fontcolor, fontsize, offset, angle) do not appear to be working for pie charts. Or maybe just the documentation is so terrible I'm not doing it right. Either way, something needs to be fixed. ((u|Sdkb)) talk 02:52, 21 July 2021 (UTC)
Is there any way to force a line break in a graph legend? The normal br html and ((br)) both don't work. ((u|Sdkb)) talk 03:54, 28 July 2021 (UTC)
Is there a standard (MOS) way to specify graph chart width? specifically defining the pixel width doesn't seem like the best approach, is there a way to do it that aligns to WP:IMAGESIZE? Aeonx (talk) 03:56, 5 August 2021 (UTC)
Has anyone succeeded in, when hover, showing a tooltip with the value? Bouzinac (talk) 21:56, 23 May 2021 (UTC)
Template:Graph:Lines does have support for getting the data from Wikidata, using the tabletype and table parameter. It would be great if Template:Graph:Chart would support this, so we use direct querying instead of just providing x and y values. Direct proposal: replace images like the one on the left with a datadriven alternative. I realise that a higher density of values in recent years might result in an unbalanced presentation, but other usage can be better of. Thanks, RonnieV (talk) 15:22, 4 June 2021 (UTC)
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
In the above, most of the values only changed once during the year, however in 2013 and 2014, the values changed multiple times. Is there any way to elongate just those sections of the x-axis to make those data points more readable? --TorsodogTalk 03:36, 6 August 2021 (UTC)
xType
have to be string
. To avoid "natural" sorting of x values I added "." to dates without month and day. This is ugly hack but outdated Vega 2.0 framework used by this template doesn't allow arbitrary sorting of axis values. --Pietrasagh (talk) 06:29, 25 September 2021 (UTC)Graphs are unavailable due to technical issues. There is more info on Phabricator and on MediaWiki.org. |
I think the ability to show values (as percentages) on the pie chart is very handy, but the default setting for showValues=format:% is for 6 significant figures, which is rather excessive. I've been fiddling around for the last half hour and I can't find a solution. Could anyone help? --Project Osprey (talk) 12:40, 5 October 2021 (UTC)
format:.0%
would show zero figures after the decimal point, format:.1%
for 1 figure after the decimal point, etc. --Yair rand (talk) 17:50, 5 October 2021 (UTC)
Would it be possible to add a | Title =
option so that the graphs can be labeled? --Project Osprey (talk) 15:46, 8 October 2021 (UTC)
Can anyone here explain why the graph in the South Carolina article's Demographics section, displays ":32" for the last three values along the X axis? I'd like to correct this if possible. Thanks —ADavidB 16:30, 23 October 2021 (UTC)
Is there a way to set tick density on a Graph:Chart line graph? Or is the best bet to use Template:Graph:Lines? For context, I'm looking to have fewer ticks on Template:WikiProject Anarchism cleanup issue graph, e.g., one for the start of each year or even quarters and if I set |xAxisFormat=
to just "%y", I get a bunch of ticks that repeat the year. (not watching, please ((ping))
) czar 00:18, 25 October 2021 (UTC)
Hi, I'd just like to copy the template and its subpages code to lt wiki, how can I access the code (read only mode)? Also, could someone give me some tips in regards to localization - setting thousand and decimal separator characters, etc. Wolfmartyn (talk) 22:03, 28 November 2021 (UTC)
Is doing a dotted, dashed and a combination of those possible? Howard the Duck (talk) 11:40, 19 October 2021 (UTC)
strokeDash
parameter in the marks, though.Greeting. There seems to be typing mistakes over parameters of "vAnnotatonsLabel" and "vAnnotatonsLine", which should be "Annotations" instead. May this be therefore amended? Thanks. ~~ J. Dann 12:29, 1 September 2022 (UTC)