Template talk:Chart
Latest comment: 13 days ago by BD2412 in topic How can I put a numerical upper bound on a chart, so it doesn't go over 100%?
Parameter case
edit@GalStar I'm going to go ahead and change all the parameters to lowercase, since that is the standard in the vast majority of template (including {{Graph:Chart}}). I'll also update the handful of pages that transclude the template. --Ahecht (TALK
PAGE) 21:22, 4 June 2025 (UTC)
- I would also recommend moving this template to something like {{Chart display}} per WP:TPN, which says
template names are easiest to remember if they follow standard English spelling, spacing, and capitalization
. You might even want to look unto usurping {{Chart}} (which is currently an alias for {{Tree chart}}), but that would require updating 900 articles. --Ahecht (TALK
PAGE) 21:32, 4 June 2025 (UTC)- Yeah my original intent was to create a template called chart. I'll ask for a bot to usurp it. GalStar (talk) 23:58, 4 June 2025 (UTC)
- GalStar, Ahecht, I started an RfD at Wikipedia:Redirects for discussion/Log/2025 June 7#Template:Chart. — Qwerfjkltalk 10:22, 8 June 2025 (UTC)
- Yeah my original intent was to create a template called chart. I'll ask for a bot to usurp it. GalStar (talk) 23:58, 4 June 2025 (UTC)
Sandbox version
edit@GalStar I made a sandbox version at Template:ChartDisplay/sandbox that copies a lot of code from {{Graph:Lines}} and enables a thumbnail version. You can see it in action (and the syntax) at Template:ChartDisplay/testcases. I could probably pretty up the code a little, but it works for now. Only tricky bit was getting the thumbnail version to be well-behaved if a width wasn't specified. --Ahecht (TALK
PAGE) 01:32, 5 June 2025 (UTC)
- Thanks so much, I'm not really experienced in templates myself. I'll just copy it over. GalStar (talk) 02:54, 5 June 2025 (UTC)
Height parameter?
editHi! I was wondering if there was a way to change the height of the chart? Thanks! Sportsfan77777 (talk) 11:13, 25 June 2025 (UTC)
- I second this. Not being able to set the dimensions in a way that is scalable is definitely an issue. Master of Time (talk) 09:55, 17 August 2025 (UTC)
- This is actually such a basic feature that I can't understand how this module was considered ready for article namespace without this. Right now, there is an ongoing drive to replace broken charts that used the previous extension with this new module, which is creating huge charts that completely break the flow of the page and make articles unreadable in smaller screens. Ita140188 (talk) 14:45, 24 November 2025 (UTC)
Renaming the .chart and .tab links
editTwo suggestions:
1. The label "Chart definition" (or "Definition", as in the German template) is misleading for regular readers, who aren’t interested in the JSON code. I suggest "Full view", "Full-resolution view" or "Details" to highlight the main user-facing function. Just like clicking a .PNG thumbnail opens a larger image, this link should be understood as a way to explore the chart more fully, and is of interest especially when the width is limited by a container. While it also exposes image info (usage metadata) and the editable .chart code, that’s not what most users care about and shouldn’t be highlighted. It supports interactive curve selection, and in the future, this view could link to the underlying .tab data and support features like zoom, which is not at all about "definition".
2. The term "Data source" is often used specifically to refer to the original external dataset—especially in the caption of a self-produced .png plot to make it clear that the image is based on the dataset, but not a copyrighted graphic. For the link to the Commons .tab page, the label "Source data" or "See or edit source data" can be improved imho. A more accurate label would be something like "Data", "Raw data", "Table", or "Tabular data". The latter is more focused on the user, since many readers are interested in viewing the table, seldom editing it, while Data is valid in many languages and does not have to be translated. The .tab page itself typically includes a citation of the original dataset or data source under a section titled "Sources", and usage metadata. Tomastvivlaren (talk) 18:16, 25 June 2025 (UTC)
The curve selection transform
editI suppose this template somehow should handle wiki side chart transforms, such as column/curve selection in the wikicode instead of in the chart page. Maybe also row selection (x axis data interval), and in the future, features such as choosing temperature scale, etc.
Example: {{#chart:Sweden - yearly population and population changes.chart|arg:cols=year,population_total}} to only show the pupulation_total curve vs the year. Tomastvivlaren (talk) 17:22, 3 July 2025 (UTC)
- @Tomastvivlaren I think I've enabled that in {{Chart/sandbox}}. Please try it out! --Ahecht (TALK
PAGE) 18:10, 16 July 2025 (UTC)
"Template:ChartDisplay" listed at Redirects for discussion
edit
The redirect Template:ChartDisplay has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at Wikipedia:Redirects for discussion/Log/2025 July 7 § Template:ChartDisplay until a consensus is reached. GalStar (talk) (contribs) 21:47, 7 July 2025 (UTC)
manual data?
editIt seems that Template:Graph:Chart isn't going to be updated with the fixed code. Is this the replacement template? If so, how does one implement it entirely on a single page—without needing to code multiple separate files on other projects, as the former template could? — Fourthords | =Λ= | 14:36, 2 September 2025 (UTC)
- I'm also wondering this. BappleBusiness[talk] 19:51, 24 November 2025 (UTC)
Providing raw data vs. Commons data
editI am in the process of updating {{Television Rotten Tomatoes scores}}, which used the legacy Graph extension, and needs to be converted to the new Chart extension. This template requires dynamic data, provided in the article, to display a graph, rather than being fed content from Commons. Is this template compatible with such a format? Can I provide the data direct to the template in a JSON-like format? -- Alex_21 TALK 03:54, 29 December 2025 (UTC)
Formatting parameters for Chart position seem broken
editIs it just me, but text can not float (flow) around a chart, the thumb parameter can produce artefactual borders, the width parameter is not respected, especially with align=center so mixing images and charts does not do what would be expected if the chart was an image. ChaseKiwi (talk) 16:06, 11 January 2026 (UTC)
- Not just you! Thumb doesn't seem to work at all for me, same issues with text not flowing around align right or left. Mvolz (talk) 11:50, 12 February 2026 (UTC)
Problem if width is not defined
editHello, we figured in the german wikipedia that there can be a problem displaying the chart correctly, if the width is not set in the template. If you look at the example with a mobile phone browser you will like not see it plotted as the width is litterally reduced to something close to 0px. The same applies on Desktops if you change the window size. The only way to see it display correctly again is reloading the page. In the german wiki we haven't found a solution for this. The problem doesn't occur with all charts, it seems to be limited to the ones with "less" data.
Example:
View source data.
Question about adding data to charts
edit
You are invited to join the discussion at WIkipedia:Village pump/Miscellaneous § Why can't transclusions of the Chart extension have data typed into them on-wiki?. – MrPersonHumanGuy (talk) 12:51, 10 April 2026 (UTC)
- @MrPersonHumanGuy:,@Ahecht:: fyi, i created a Template:ChartDirect that is using the commons module and eases to plot directly from wikipedia, but also allows plotting from Wikidata via Template:WikidataChart.--McBayne (talk) 22:05, 30 April 2026 (UTC)
Inverting the y-axis
editDoes anyone know how to invert the y axis on this template? ThanksBosniantennis (talk) 22:14, 1 May 2026 (UTC)
- @Bosniantennis:: not sure I understand your question. Do you mean a chart for a ranking where number 1 is on top and counting down? So e.g. number 10 on bottom? If that is the case, then I fear that is not possible at the moment due to limitations of the extension. Phab:Task T385344 might enable what you are looking for, but currently I don't think anybody is working on it.--McBayne (talk) 22:48, 5 May 2026 (UTC)
- correct, I am trying to invert it so that 1 is at the top (this is for a FIFA ranking chart, so I'd like for it to look like it's "climbing" as the numbers get lower). I appreciate the reply, that's unfortunate then. Bosniantennis (talk) 04:46, 6 May 2026 (UTC)
Graphics compressed?
editHi there, in the last few days I've realised that the Chart extentions have been compressed and pushed to the left, no longer occupying the full page horizontally. Is anyone seeing this also? Plus, not sure where to add this, but timeline tags now say "Timeline error. Could not store output files". Is this a wiki bug or something? I'll await a response. Cheers Tuesp1985 (talk) 16:26, 4 June 2026 (UTC)
- Never mind. Realised it was an issue with widths. Tuesp1985 (talk) 01:33, 5 June 2026 (UTC)
Width parameter
edit@Frietjes just added a category for tracking undocumented but commonly used |Width= parameter
, but I'm a bit confused because the width parameter is used 5 times in the documentation plus is listed in the TemplateData. --Ahecht (TALK
PAGE) 19:33, 4 June 2026 (UTC)
- Ahecht,
|width=has been there for a long time, but many pages are using|Width=instead (parameters were lowercased here but many pages are using the uppercase versions). Frietjes (talk) 19:36, 4 June 2026 (UTC)- @Frietjes Ahh, got it. Thanks! --Ahecht (TALK
PAGE) 19:42, 4 June 2026 (UTC)
- @Frietjes Ahh, got it. Thanks! --Ahecht (TALK
How can I put a numerical upper bound on a chart, so it doesn't go over 100%?
editSpecifically, at United States presidential elections in South Carolina, there is a chart showing the percentage of the vote by party, and since that sometimes got into the 90s, the chart goes up to 120%. What to I add to make it only go up to 100%? BD2412 T 17:32, 5 June 2026 (UTC)
- @BD2412 There's no way that I'm aware of to define the axes in mw:Extension:Chart, but this is being tracked at phab:T385344 --Ahecht (TALK
PAGE) 18:44, 5 June 2026 (UTC)- Hopefully, then, someone will find a way to add a parameter telling the chart that it is generating percentages, rather than raw numbers. Cheers! BD2412 T 21:14, 5 June 2026 (UTC)