Module talk:Chart
![]() | Text and/or other creative content from this version of Module:Chart was copied or moved into Module:Sandbox/isaacl/MLB_standings with this edit. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
![]() | Text and/or other creative content from this version of Module:Chart was copied or moved into Module:Sandbox/isaacl/MLB_standings with this edit. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
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)
- 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)
- 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)
- 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)- 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)
- 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
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)
- 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)
- 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)
- 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)
- 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)
'Y' axis maximum on stacked bar chart
Can the 'Y' axis maximum be controlled in a stacked bar?
For instance, see User:Begoon/sandbox/casualties, where the 3rd chart (Total fatalities) has a large amount of "dead space" where it extends 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. Begoon talk 04:00, 27 June 2013 (UTC)
- it's always tricky to select a "round" number to serve as top y. i think anywhere between 1 and 1.5 (or 10 and 15, or 100 and 150 etc.) will use 1.5. the problem here is not just finding the appropriate top value, but also selecting the other y legends: for instance, if we would have selected 13 (or 13 million, for that matter), marking all the values of 1,2,3...12,13 would create too many marks, but nothing else seems very appropriate.
- i guess i could teach the module to accept the y-legend values manually, so the editor will be able to force values when the current logic of the module does not produce good results, but this won't happen before the end of the week. peace - קיפודנחש (aka kipod) (talk) 12:52, 27 June 2013 (UTC)
- Yeah, I know - I've done a fair few PHP routines to generate charts from SQL databases dynamically on websites I maintain (using things like flashchart). It's a pig to code for when the ranges can be anything from 1 to a zillion without getting odd division markers. No big thing, it's ok as it is really, and that's a prototype with imaginary data - so the final thing might use luckier numbers when I plug them in.
- I'm also interested in the question above about thumbnailing. The charts are too big to include in full on the article page, so there'll be a separate chart page. At the moment I'm even thinking I might need to use an image screenshot in the article to link to the page with the full chart, which is OK here, because the data isn't likely to change - but not an ideal way of doing it if the data is regularly updated, because you'd need to update a new thumbnail image each time too. Thanks for the quick reply. Begoon talk 13:27, 27 June 2013 (UTC)