Module talk:Chart

This is an old revision of this page, as edited by Begoon (talk | contribs) at 04:02, 27 June 2013 ('Y' scale: fix link). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 12 years ago by Begoon in topic 'Y' scale

Population graph

I've developed a more automated template for population growth charts (intended for census data on geographical articles) at the Vietnamese Wikipedia. If anyone's interested, I'd be happy to port vi:Mô đun:Thời biểu dân số over to this wiki; just contact me. – Minh Nguyễn (talk, contribs) 16:53, 31 March 2013 (UTC)Reply

i gave it a cursory look. first of all - very nice! second - the Vietnamese version currently is limited to a single dataset, so i am not sure it's The Answer (although it maybe can be used to develop "The Answer"). However, one thing that the Vietnamese module linked above did right (and i went wrong), is actually using mw:Extension:Timeline (i used divs with position:absolute - quite a disaster). for me personally, timeline has one huge deficiency that tramps (almost) anything else: its RTL support sucks (thogh, maybe Lua can help even here? i'll have to ponder it a bit). i am not all that familiar with the "Timeline" syntax, but it may actually be better.
So next mission is to develop a line-graph using the timeline syntax.
peace - קיפודנחש (aka kipod) (talk) 19:55, 31 March 2013 (UTC)Reply
Hmmm. I was actually hoping that your next project would be developing a set of Lua modules to make the EasyTimeline extension obsolete. I've always found its output to be pretty awful (ugly rasterized image). --MZMcBride (talk) 02:05, 1 April 2013 (UTC)Reply
Actually, Thời biểu dân số supports any arbitrary years (even BC), as seen at vi:Bản mẫu:Thời biểu dân số#Thành phố New York. I brought it up because it allows you to enter each data point as | yyyy = nnnn, so editors don't have to learn a special syntax. But obviously you're thinking about broader charting needs, and I would welcome any effort to obsolete EasyTimeline, because its un-antialiased fonts are hideous. – Minh Nguyễn (talk, contribs) 06:31, 2 April 2013 (UTC)Reply
it's understood that it can support any year range,but it's still asingle data set. It can't show, for instance, life expectancy vs. Average weight, or crop size vs. Agriculture area, let alone three or four different variables. קיפודנחש (aka kipod) (talk) 12:39, 2 April 2013 (UTC)Reply

Right align, caption

It would be helpful to have a right align thumbnail option as well as a caption parameter. --JFH (talk) 20:06, 27 April 2013 (UTC)Reply

if you mean containing the whole thing in a right-aligned thumb, i think it's better to do it in a template that uses the module, no? i think that in enwiki the consensus is not to use modules directly in articles and always pipe it through templates, so it makes more sense to me to leave all the enveloping of the actual chart to the template.
if you think it's useful, we can maybe add two new optional parameters for "class" and "style" for the outermost div containing the whole shebang. i'm not so sure about "caption", mainly because it's not clear to me where and how this optional caption should be displayed.
either way, if you can be more specific, neither of these is out of the question. peace - קיפודנחש (aka kipod) (talk) 23:06, 27 April 2013 (UTC)Reply
I don't really know how these things work. I suppose I would like a template that uses this module to create something like template:pie chart. The problem with that template is that everything has to add up to 100. --JFH (talk) 13:16, 28 April 2013 (UTC)Reply
you are correct. {{pie chart}} has several additional limitations which this module overcomes: there is a hard-coded limit to the number of slices (currently 10. it would be easy enough to raise it, e.g. to 15, but limitation of template syntax basically forces a hard coded limit). there is no "hint" (or "tooltip") on the slices, and there is no convenient way to introduce units to the legends.
it should be pretty easy to wrap all this in a template, and if nobody else does it, maybe i will, one of these days...
peace - קיפודנחש (aka kipod) (talk) 17:08, 28 April 2013 (UTC)Reply

'Y' scale

Can the 'Y' scale be controlled in a stacked bar?

For instance, see this example, where the 3rd chart (Total fatalities) has a large amount of "dead space" where it scales to 15,000,000 when 12,500,000 would be ample? I don't really understand why it does that, or if I can prevent it. Thanks. Begoontalk 04:00, 27 June 2013 (UTC)Reply