By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,133 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,133 IT Pros & Developers. It's quick & easy.

Rising Falling Arrow

P: n/a
How can I implement a rising/falling trend arrow based on a number
that may rise or fall. For example, if the number (variable) is 100
and changes to 101, the "arrow" changes to "up", if the number goes
back to 100, the arrow changes to "down". I'm not a statistical guru
but I am sure there is a definition for this.

I am getting my number variable from a sql server via a query.

Mar 28 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Techhead" <jo*********@gmail.comwrote in message
news:11**********************@r56g2000hsd.googlegr oups.com...
How can I implement a rising/falling trend arrow based on a number
that may rise or fall. For example, if the number (variable) is 100
and changes to 101, the "arrow" changes to "up", if the number goes
back to 100, the arrow changes to "down". I'm not a statistical guru
but I am sure there is a definition for this.

I am getting my number variable from a sql server via a query.
Do you mean an image of an up and down arrow?

Will you be getting two numbers so you cant compare them?

Tell us more...
Mar 28 '07 #2

P: n/a
VK
On Mar 28, 6:57 pm, "Techhead" <jorgenso...@gmail.comwrote:
How can I implement a rising/falling trend arrow based on a number
that may rise or fall. For example, if the number (variable) is 100
and changes to 101, the "arrow" changes to "up", if the number goes
back to 100, the arrow changes to "down". I'm not a statistical guru
but I am sure there is a definition for this.

I am getting my number variable from a sql server via a query.
If you want to make it client-side then te simpliest way IMHO is to
make three small - say 16x16 - gif images:
1) transparent
2) arrow up
3) arrow down

Then all stock labels are served with transparent gif first and client-
side you do something like:

if (oldVal >= newVal) {
imgObject.src = 'arrowUp.gif';
}
else {
imgObject.src = 'arrowDown.gif';
}

Actually such kind of things is more reliable and natural to prepare
server-side rather than using client-side scripting - IMHO

Mar 28 '07 #3

P: n/a
Techhead wrote on 28 mrt 2007 in comp.lang.javascript:
How can I implement a rising/falling trend arrow
The arrow part:

<http://devrijehuisarts.org/test/jsarrow.asp>
<http://devrijehuisarts.org/test/jsarrow2.asp>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 28 '07 #4

P: n/a
VK said the following on 3/28/2007 12:07 PM:
On Mar 28, 6:57 pm, "Techhead" <jorgenso...@gmail.comwrote:
>How can I implement a rising/falling trend arrow based on a number
that may rise or fall. For example, if the number (variable) is 100
and changes to 101, the "arrow" changes to "up", if the number goes
back to 100, the arrow changes to "down". I'm not a statistical guru
but I am sure there is a definition for this.

I am getting my number variable from a sql server via a query.

If you want to make it client-side then te simpliest way IMHO is to
make three small - say 16x16 - gif images:
1) transparent
2) arrow up
3) arrow down

Then all stock labels are served with transparent gif first and client-
side you do something like:

if (oldVal >= newVal) {
imgObject.src = 'arrowUp.gif';
}
else {
imgObject.src = 'arrowDown.gif';
}

Actually such kind of things is more reliable and natural to prepare
server-side rather than using client-side scripting - IMHO
That would actually not work when oldVal == newVal as the arrow should
stay precisely whatever it was to start with.

if (oldVal newVal){}
if (oldVal < newVal){}

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 28 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.