Graphing

I

IW

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
 
R

Randy Webb

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.
 
D

Dr John Stockton

dated Tue said:
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.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Wed, 2 Nov
2005 13:27:53, seen in Dr John Stockton
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.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Thu, 3
Nov 2005 03:35:13, seen in RobG
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.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Thu, 3 Nov
2005 21:15:37, seen in Dr John Stockton
JRS: In article <[email protected]>, dated Thu, 3
Nov 2005 03:35:13, seen in RobG
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top