No radial grid for pie chart and corona chart
In a pie or corona chart
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?
- It might be possible with CSS
<div style="background-image:...">{{Graph:Chart|...}}</div>
Uwappa (talk) 08:48, 31 July 2022 (UTC)
left and right Y axes?
I want to plot bodies of various sizes against both density and albedo. Can I have diameter as the X axis, density as the left-had Y axis, and albedo as the right-hand Y axis? (It would also be nice if I could include error bars.) — kwami (talk) 03:21, 10 October 2021 (UTC)
- Kwami, just noticed this. I recently posted this comment at Module_talk:Graph, which is a different conception of a right-side y-axis. Not sure there will be any more response there than this got, but you may want to watch it just in case.
- Btw, as long as we're talking about enhancements, are you familiar with Tufte's spark lines? We'd need an enhancement to ModuleGraph that could produce a gridless, axisless, labelless tiny graph about one line-height high, but they are super useful. Cheers, Mathglot (talk) 02:01, 4 April 2022 (UTC)
- Adding @Tenryuu:. Mathglot (talk) 02:02, 4 April 2022 (UTC)
omitting values
How do I suppress a value from displaying?
I have two pie graphs comparing the masses of mid-sized moons. One includes Triton for comparison, the other does not. In order to keep the colors the same, I can't simply omit Triton from the second. But if I put two commas in a row as a place-holder, it still displays with a value of zero and as 'null' in the legend. Can I suppress it without shifting the colors of the other values? — kwami (talk) 21:44, 10 October 2021 (UTC)
- Sort moons by mass in x= parameter, Triton last. Omit Triton in the second graph. Uwappa (talk) 08:32, 31 July 2022 (UTC)
Line styles in line charts
Is doing a dotted, dashed and a combination of those possible? Howard the Duck (talk) 11:40, 19 October 2021 (UTC)
- @Howard the Duck: Not currently with this template, no. It would be possible to add this feature to the module, using the
strokeDash
parameter in the marks, though. - (Bit of a tangent, but I think part of what stops people from adding certain features to this template might be hesitancy to fiddle around with the template parameters, to avoid having a giant mess of piecemeal-added disorganization that's hard to fix. I wonder if we should just hold a big "what are all the somewhat useful things it would be good to have in this template?" discussion (maybe an RfC, even), and then figure out a way to have a reasonable number of easily usable parameters to accommodate them all. Currently, there's no specification to work towards or anything.) --Yair rand (talk) 17:49, 19 October 2021 (UTC)
- Yes, that'd be great. I can also see you can customize plot points too, so you can make multiple series with the same color, but different line style plot points.
- As for adding features, sometimes, people don't know it, and yes, people don't want to screw up the template. You guys can do an RFC, as that gets to be binding in the end. Howard the Duck (talk) 14:31, 21 October 2021 (UTC)
- Some time ago I added few features to module used by this template. Some of them were my ideas based on problems to make graphs look as I wanted. Most of my word was useless because almost nobody use those features. Basic problem is outdated (current versions is 5.3, Mediawiki uses version 2) Vega framework working in background. Many problems with this template is solved and many requested features can be added without much effort in new Vega (and VegaLite). There's not much sense to do fight with outdated code. When hardcore developers of MediaWiki will update extension code large part of underlying module will have to be rewritten for new Vega anyway.
- Please push developers to update the code on Phabricator T165118 or contact main developer directly. Development had stuck since May 2019. If you (anyone) know JS and/or PHP please help. Pietrasagh (talk) 10:33, 28 December 2021 (UTC)
How to get yGrid lines on bar charts of rocket launches
Tried yGrid= (and yGrid= 1) in List_of_Falcon_9_and_Falcon_Heavy_launches#Launch_outcomes but no visible effect The template page shows it working for line graphs, and doesn't say it won't work for bar graphs. Does it need a linewidth or linecolour or something ? or is this Graph:chart not what {{#invoke:Chart | bar chart invokes ? - Rod57 (talk) 10:09, 24 November 2021 (UTC)
- @Rod57 {{#invoke:Chart|bar chart}} uses Module:Chart, not Template:Graph:Chart. You can also use Template:Graph:Stacked to produce bar charts. --Ahecht (TALK
PAGE) 15:04, 24 November 2021 (UTC)
Code
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)
- Hi Wolfmartyn (talk · contribs), just check here https://lt.wikipedia.org/wiki/%C5%A0ablonas:Graph:Chart . --Bouzinac (talk) 22:53, 28 November 2021 (UTC)
- That's perfect - thanks.Wolfmartyn (talk) 23:35, 28 November 2021 (UTC)
Colors
The "default color palette ... is Category10" -- could we link to that, so readers know what the categories are?
How do we edit the "Parameters" section, since there is no edit link for it? I wanted to add the codes for the colors if we don't have a link to the list. — kwami (talk) 22:17, 8 December 2021 (UTC)
- The colours listed in this template come from Template:ChartColors. If you hover your mouse over each colour box, you'll see the hex code appear. Otherwise, you can get the colours directly from Module:ChartColors. -- /Alex/21 22:37, 8 December 2021 (UTC)
- @Alex 21: Thanks! And should let me start with some color other than the first, which was another of my questions. How do I put those values in the 'color' param of a pie graph? All I'm getting is black. (Please ping me.) — kwami (talk) 04:50, 6 January 2022 (UTC)
- @Kwamikagami Just set
|colors=#e01815,#ff00e6,#a1ff00,#9500ff,[...]
with the relevant hex codes separated by commas. -- Alex_21 TALK 07:16, 6 January 2022 (UTC)
- @Kwamikagami Just set
- @Alex 21: Thanks! And should let me start with some color other than the first, which was another of my questions. How do I put those values in the 'color' param of a pie graph? All I'm getting is black. (Please ping me.) — kwami (talk) 04:50, 6 January 2022 (UTC)
Axis intervals
If we take a look at the graph at Template:Graph:Chart#Scatter plot, we can see that the x-axis has an interval of 5 between its values. However, intervals on the x-axis aren't supported when using |type=stackedrect
; instead, it shows every single x-value. Is there a reason for this? -- Alex_21 TALK 03:57, 6 January 2022 (UTC)
- Bar graphs (stacked or not) for x values can only use ordinal scale. Scatter plot is special kind of line chart (no line, only symbols). Mentioned example scatter plot use linear scale which is default scale for "line" chart. For linear scale ticks are "automatically" generated at some values depending on graph size and range of x scale. Pietrasagh (talk) 19:20, 5 February 2022 (UTC)
Help. "Simple" line chart but with %M:%S time axis format
Maybe better IT specialist than me could help?
I would like to plot the chart for 800m running progression so I have results in mm:ss.ms format (1:55.12 or 2:04.50 for example). How to specify this? (if possible). I tried 'time' as yType with different results notation (with 0, 00 hour's value and without) but that does not work (no chart displayed at all).
I can always recalculate marks to numbers but then I will have labels like 115.12 instead of 1:55.12. Maybe the problem is easy to solve by someone? Lorem333Ipsum (talk) 20:52, 12 January 2022 (UTC)
- Time scales are bit messy for this template. You can try to use something like this
- Prefix with date is necessary for y values. You can try different formats of time on y axis acc. to D3 specification. Pietrasagh (talk) 20:19, 5 February 2022 (UTC)
Separate y-axes?
I've been checking the documentation, and there doesn't seem to be a way to add a second y-axis on the right-hand side of line graphs. One of the items being plotted, cumulative deaths in the Cumulative cases, deaths, recoveries, and active cases
graph on COVID-19 pandemic in British Columbia are being overshadowed in scale of everything else. Is there a way to add such a second axis, or is our only solution to separate it? —Tenryuu 🐲 ( 💬 • 📝 ) 02:17, 15 January 2022 (UTC)
- I asked this at #left and right Y axes? above. It would be nice. — kwami (talk) 04:58, 15 January 2022 (UTC)
xAxisMin breaks for larger values of xAxisMax
Check the graphs here. I'd like the x Axis to start at 1, which works well if I set the xAxisMax < 15. For values larger than 15, the x Axis automatically starts at 0 and ignores the value in xAxisMin. Dunno if this is broken or if I'm doing something wrong. Oberyn42 (talk) 13:40, 3 February 2022 (UTC)
- Use xType=string to get x= parameter values at x-axis and you will not need xAxisMin, xAxixMax. Uwappa (talk) 08:08, 31 July 2022 (UTC)
Step function with template chart
Is it possiblie to create a true step function plot with the Template:Graph:Chart? It is possible to mimic it by a line plot with steep increases, but that graph has (almost) vertical lines that look "non-mathematican".
This workaround would be too complicated for large data sets:
--Myosci Myosci (talk) 08:15, 13 August 2022 (UTC)
- Workaround: Use x=1,2,2,3,3,4,4,5,5,6,6 and xType=string.