Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Graphing

Reply
Thread Tools

Graphing

 
 
IW
Guest
Posts: n/a
 
      11-01-2005
I am looking at developing a small app, which will show financial returns
in a barchart. I have no problem in getting to draw a positive figure (i.e.
a bar chart going up) but am unable to get a bar chart to draw a negative
figure.

Are there pointers, I should be looking at????

TIA


 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      11-01-2005

IW wrote:
> I am looking at developing a small app, which will show financial returns
> in a barchart. I have no problem in getting to draw a positive figure (i.e.
> a bar chart going up) but am unable to get a bar chart to draw a negative
> figure.


Your program possessed by a hard neck business man spirit!

> Are there pointers, I should be looking at????


Yeh... How about:

<http://www.google.com/search?hl=en&q=javascript+barchart>

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      11-01-2005
IW said the following on 11/1/2005 12:14 PM:

> I am looking at developing a small app, which will show financial returns
> in a barchart. I have no problem in getting to draw a positive figure (i.e.
> a bar chart going up) but am unable to get a bar chart to draw a negative
> figure.
>
> Are there pointers, I should be looking at????


Aside from the google search that was provided, you move your 0 line
either down or up in the container, then you go positive or negative
based on the zero line. Usually the best Zero Line is the center of the
container.

But, post a URL (or if the code is short, the code) to your efforts so far.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.mattkruse.com/javascript/bestpractices/
 
Reply With Quote
 
Dr John Stockton
Guest
Posts: n/a
 
      11-02-2005
JRS: In article <4367a346$>, dated Tue, 1 Nov 2005
17:14:02, seen in news:comp.lang.javascript, IW <> posted :
>I am looking at developing a small app, which will show financial returns
>in a barchart. I have no problem in getting to draw a positive figure (i.e.
>a bar chart going up) but am unable to get a bar chart to draw a negative
>figure.


Even on older browsers, you should be able to predefine top and left,
and draw a given depth and width. Fill a box with mountain colour, draw
boxes (position:absolute; width:constant; depth:variable) downwards in
sky colour, then draw (position:absolute) the sea level line.
UNTESTED.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
 
Reply With Quote
 
Dr John Stockton
Guest
Posts: n/a
 
      11-02-2005
JRS: In article <>, dated Wed, 2 Nov
2005 13:27:53, seen in news:comp.lang.javascript, Dr John Stockton
<> posted :
>JRS: In article <4367a346$>, dated Tue, 1 Nov 2005
>17:14:02, seen in news:comp.lang.javascript, IW <> posted :
>>I am looking at developing a small app, which will show financial returns
>>in a barchart. I have no problem in getting to draw a positive figure (i.e.
>>a bar chart going up) but am unable to get a bar chart to draw a negative
>>figure.

>
>Even on older browsers, you should be able to predefine top and left,
>and draw a given depth and width. Fill a box with mountain colour, draw
>boxes (position:absolute; width:constant; depth:variable) downwards in
>sky colour, then draw (position:absolute) the sea level line.
>UNTESTED.


TESTING very crudely in
<URL:http://www.merlyn.demon.co.uk/js-tests.htm#BC>
Array A is bar-charted on pressing "??".

I may improve it tomorrow.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      11-03-2005
Dr John Stockton wrote:
[...]
>
> TESTING very crudely in
> <URL:http://www.merlyn.demon.co.uk/js-tests.htm#BC>
> Array A is bar-charted on pressing "??".
>
> I may improve it tomorrow.
>



Can you add units to the style attributes for height, width, etc.?


...left:' + 20*(J+1) +'px; height:' + (200-20*A[J]) + 'px; width:20px"





--
Rob
 
Reply With Quote
 
Dr John Stockton
Guest
Posts: n/a
 
      11-03-2005
JRS: In article <Rzfaf.1283$>, dated Thu, 3
Nov 2005 03:35:13, seen in news:comp.lang.javascript, RobG
<> posted :
>Dr John Stockton wrote:
>[...]
>>
>> TESTING very crudely in
>> <URL:http://www.merlyn.demon.co.uk/js-tests.htm#BC>
>> Array A is bar-charted on pressing "??".
>>
>> I may improve it tomorrow.

>
>
>Can you add units to the style attributes for height, width, etc.?
>
> ...left:' + 20*(J+1) +'px; height:' + (200-20*A[J]) + 'px; width:20px"



Easily done, though that line has changed and the whole thing is
somewhat better now. It needs more work on scaling; and I can probably
now grow bars up rather than anti-bars down. But the principle is
established.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
Dr John Stockton
Guest
Posts: n/a
 
      11-04-2005
JRS: In article <kPOF$>, dated Thu, 3 Nov
2005 21:15:37, seen in news:comp.lang.javascript, Dr John Stockton
<> posted :
>JRS: In article <Rzfaf.1283$>, dated Thu, 3
>Nov 2005 03:35:13, seen in news:comp.lang.javascript, RobG
><> posted :
>>Dr John Stockton wrote:
>>[...]
>>>
>>> TESTING very crudely in
>>> <URL:http://www.merlyn.demon.co.uk/js-tests.htm#BC>
>>> Array A is bar-charted on pressing "??".
>>>
>>> I may improve it tomorrow.

>>
>>
>>Can you add units to the style attributes for height, width, etc.?
>>
>> ...left:' + 20*(J+1) +'px; height:' + (200-20*A[J]) + 'px; width:20px"

>
>
>Easily done, though that line has changed and the whole thing is
>somewhat better now. It needs more work on scaling; and I can probably
>now grow bars up rather than anti-bars down. But the principle is
>established.


Or established for IE4. I looked at it in IE6 today and was greatly
disappointed. There's a snapshot of the best IE4 output at
<URL:http://www.merlyn.demon.co.uk/barchart.gif> (8.5K), with one
colour wrong (my Paint seems to have its paint-pots muddled). The lines
are zero and mean.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco 15454s and MRTG Graphing Debbie Cisco 1 03-25-2006 07:38 AM
Graphing: Converting Values to Co-ordinates morc Java 3 03-22-2006 09:49 PM
Graphing and Charting Controls??? Jay ASP .Net 5 02-02-2006 08:24 AM
Client side dynamic graphing problem Nevets Steprock ASP .Net 2 04-26-2005 03:33 PM
crystal reports does graphing? Jon Davis ASP .Net 1 01-20-2004 04:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57