TodayPlus Boards v2

Programming and MOD Forums => Developer's Corner Discussion => Topic started by: uk_skinner on March 11, 2005, 11:47:37 AM

Title: 10-Day Temperature Chart
Post by: uk_skinner on March 11, 2005, 11:47:37 AM
This is a short instruction to get 10-Day Temperature Chart.

If you would like to know “evolution” of this idea, please read the thread (http://www.jhollin1138.com/forums/viewtopic.php?t=1795).

The basic url address is:
Code: [Select]
http://tpfans.com/rss/TpTempchart.php?Citycode=Citycode&Para=x,y,width,height

The following parameters are “required”.

Citycode: Well, it is the citycode you got from weather.com.  For example: USMD0347.

Para:         There are 4 numbers separated by “,”.
           x: horizontal offset of the chart
           y: vertical offset of the chart

           width: the width of the chart
           height: the height of the chart

   If you have the temperature label for the y-axis, you can adjust the “x” to accommodate different font sizes.  To accommodate the label at x-axis, I added “25” pixels of the height to the image.  The same “25” pixels also was added in the width.  So the size of the image should be: (“x+width+25” x “y+height+25”).  

   Example, “Para=20,20,250,150” will give you a chart with (250 x 150) start at (20,20) and the size of output image is (20+270+25) x (20+150+25) = 315 x 195.  Please adjust the size according to your device (QVGA or VGA) and desired display area.

Option parameters
   The follow ones are optional.  You don’t have to specify it if you are happy with the default settings.


U: unit of temperature, F: Fahrenheit, this is default; C: Celsius.

DOW: This one is to specify the format of "Day of Week". Use "DOW=X" to show one-word abbreviation (S,S,M,T,W,T,F) and "DOW=XX" for (Su,Sa,Mo,Tu,We,Th,Fr) and "DOW=XXX" for (Sun,Sat,Mon,Tue,Wed,Thu,Fri). The default is "XXX".

Lang: This one is to specify the language for DOW.  Three other languages (GM,FR and NL) are supported.  The default is EN.

Color:  You can specify the colors using the following parameters.
F_Color: Specify the RGB color of the frame. Default: 15,196,15
T_Color: Specify the RGB color of the Temperature line. Default: 196,15,15
R_Color: Specify the RGB color of the Real(or feel-like) Temperature line. Default: 15,15,196
L_Color: Specify the RGB color of the label. Default: 0,0,0

Font size:  The font size of the labels can be specified.
XFont: The support sizes are 1-5. Default:1
YFont: The support sizes are 1-5. Default:1

Freeze Point line
FP: To not show the freezeing point line, use "FP=N".  The default is "Y".

Y-Axis grid lines
YS: To specify  the numbers of grid lines, use "YS=number".  The default is "5".  If spcify "YS=0" then no grid line will be drawn but the "temperature" will show at each point.

Example: http://tpfans.com/rss/TpTempchart.php?Citycode=USMD0347&Para=16,4,300,200&R_Color=150,190,2004&T_Color=196,15,15&La_Color=0,0,0&F_Color=30,160,0&YFont=2&XFont=2&YS=4&DOW=XXX&FP=N

Download

The output image format is PNG with transparent background.  Add url and file pathway into your radar.txt.  Here is an example:

Code: [Select]
SURL=http://tpfans.com/rss/TpTempchart.php?Citycode=GMXX0039&Para=20,20,200,120&U=C
STOR=\My Documents\Radar\r1.png
FORM=
Title: Re: 10-Day Temperature Chart
Post by: Broesel on March 11, 2005, 12:58:14 PM
Quote from: "uk_skinner"

Freeze Point line
FT: To not show the freezeing point line, use "FT=N".  The default is "Y".


 :D Too much parameters ? FT = FP ?

Regards Broesel
Title: 10-Day Temperature Chart
Post by: uk_skinner on March 11, 2005, 01:03:07 PM
broesel:

             Thanks.  :oops:  :shock:
             Yep, and it is Friday...
Title: 10-Day Temperature Chart
Post by: ZapMe1 on March 11, 2005, 01:45:37 PM
UK,

Very Impressive !!   Great Work.....  (http://smileys.smileycentral.com/cat/36/36_2_68.gif)
Title: 10-Day Temperature Chart
Post by: Geezer on March 11, 2005, 03:48:26 PM
Once again, you guys are stretching the limits of our fine little application.  We just aren't worthy...   :bow:   But Thanks anyway.  I'm sure we'll use it.   :dance: