Jump to content

Template talk:UK swine flu bargraph

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Pol098 (talk | contribs) at 13:55, 8 July 2009 (Terminated: new section). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

I may not know what I'm talking about, in which case ignore this. I don't really know the Wiki timeline template, but I do know about producing graphs of mathematical functions in general.

There seems to me to be a problem with the timeline template. Taking a particular example of this template:
PlotArea is 200 pixels wide
Period = from:0 till:1500 units
This establishes a scale of 7.5 units per pixel (I call this "Scale")
A particular bar (the last one) is from:2 till:1461
This should end at 1461/Scale = 194.8 pixels
If we want to display the caption "1/1461" a short distance from the end of the bar, we would expect to need an absolute shift of a few pixels more than 194.8

However, the shift which actually positions the caption about the same distance from the end of the bar as at the beginning of the table is about 193, which should theoretically start the text a couple of pixels before the end of the red bar.

Either I've misunderstood the system, or there is a problem with the timeline template itself. I suppose it could be something that varies with different display resolutions.

I noticed this because the whitespace between the end of the red bar and the start of the "<deaths>/<confirmed>" caption has gradually been increasing. On adding the 1461 entry I simply put in the shift which looks about right by trial and error.

I don't know the best thing to do; if values which look right are entered and the timeline template is later corrected, the timeline will then display incorrectly, with the caption starting before the end of the bar.

If I've simply got it wrong, please put in the correct values and accept my apologies. I'm tempted simply to revert my change, but the whitespace does gradually widen (at least on my display), so there is something not quite right that needs attention drawing to it.

Best wishes, Pol098 (talk) 16:27, 16 June 2009 (UTC)[reply]

I expanded the period of the graph from 1500 to 4000 so the offsets all mucked up. I was a bit confused by how the label offset were calculated. I worked out:
offset = cases / ( period / width )
Width is constant 200 and the period is now 4000, giving a scale of 20. So offset = cases / 20. When the period needs to be expanded again, all the offsets need to be changed, is there a better way to automate this? Mmm0tive (talk) 22:05, 20 June 2009 (UTC)[reply]
expanded the period from 4000 -> 8000. The scale is now 40. Mmm0tive (talk) 15:47, 26 June 2009 (UTC)[reply]

Shorten chart

[edit]

The graph is getting kind of long. Is it considered important to show on the chart the slow increase between 27/04 and 17/05? Mmm0tive (talk) 15:47, 26 June 2009 (UTC)[reply]

Terminated

[edit]

I've terminated the graph at 2 July. Even if new figures are provided, they definitely won't be lab-confirmed, so not comparable with figures plotted - maybe we need a new plot, or to continue this one with a clear indication that the figures are not comparable. I would suggest that for an encyclopaedic article the existing graph should be kept to illustrate the early stages (perhaps with a discussion of its exponential nature if this is published elsewhere rather than OR), rather than become a vanishingly thin start of a a curve with cases in the millions. Pol098 (talk) 13:55, 8 July 2009 (UTC)[reply]