Module talk:Chart: Difference between revisions

Content deleted Content added
'Y' axis maximum on stacked bar chart: no thumbs, but you can play with width and height, and even get smaller text by embedding it in a div with style="font-size:xx%";
Line 42:
::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 [http://teethgrinder.co.uk/open-flash-chart/ 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. <span style="font-family:Arial;font-weight:bold;color:#000;">[[User:Begoon|<span style="color:#0645AD;">Begoon</span>]]&thinsp;[[User talk:Begoon|<span style="color:gray;"><sup>talk</sup></span>]]</span> 13:27, 27 June 2013 (UTC)
:::as the charts generated by this module are not images, proper "thumbnailing" will not work.
:::however, playing with "height" and "width" for the whole chart will produce smaller (or larger) versions. one drawback is that the legends text will still show at normal size, which might cause problems, like overlapping legends and such. maybe it should be possible to embed the whole chart inside a "div" with "style='font-size:50%;' " or somesuch:
 
<div style="font-size:60%">
{{ #invoke:Chart | bar chart
| height = 200
| width = 250
| stack = 1
| group 1 = 40000 : 50000 : 60000 : 20000 : 30000 : 35000
| group 2 = 20000 : 60000 : 12000 : 44000 : 12000 : 20000
| group 3 = 55000 : 14000 : 33000 : 5000 : 20000 : 10000
| colors = green : yellow : orange
| group names = Apple : Banana : Orange
| units suffix = Kg
| x legends = Before : During : After : Post mortem : Blah : Bloh
}}
</div>
 
:::also, note that the module will refuse to draw a chart if either hight or width are less than 200 (i guess this could be changed...). total result is still somewhat larger than what you would normally call a "thumbnail". i also never found a good way to place the group legends - whatever i tried, i never found a trick to make them appear in the "right place" for all charts - if it works well with one chart, it doesn't with another. the compromise was to place them a bit far away - too far for most cases really, but if i place them closer they sometime overlap with the horizontal legends, and i did not find a good way to make it intelligent. (anyone is welcome to improve it).
:::peace - [[User:קיפודנחש|קיפודנחש (aka kipod)]] ([[User talk:קיפודנחש|talk]]) 14:11, 27 June 2013 (UTC)