473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Graphing

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
Nov 1 '05 #1
7 1206
VK

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>

Nov 1 '05 #2
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/
Nov 1 '05 #3
JRS: In article <43********@news.star.co.uk>, dated Tue, 1 Nov 2005
17:14:02, seen in news:comp.lang.javascript, IW <iw@nomail.com> 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.
Nov 2 '05 #4
JRS: In article <Mj**************@merlyn.demon.co.uk>, dated Wed, 2 Nov
2005 13:27:53, seen in news:comp.lang.javascript, Dr John Stockton
<jr*@merlyn.demon.co.uk> posted :
JRS: In article <43********@news.star.co.uk>, dated Tue, 1 Nov 2005
17:14:02, seen in news:comp.lang.javascript, IW <iw@nomail.com> 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.
Nov 3 '05 #5
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
Nov 3 '05 #6
JRS: In article <Rz******************@news.optus.net.au>, dated Thu, 3
Nov 2005 03:35:13, seen in news:comp.lang.javascript, RobG
<rg***@iinet.net.au> 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.
Nov 3 '05 #7
JRS: In article <kP**************@merlyn.demon.co.uk>, dated Thu, 3 Nov
2005 21:15:37, seen in news:comp.lang.javascript, Dr John Stockton
<jr*@merlyn.demon.co.uk> posted :
JRS: In article <Rz******************@news.optus.net.au>, dated Thu, 3
Nov 2005 03:35:13, seen in news:comp.lang.javascript, RobG
<rg***@iinet.net.au> 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.
Nov 5 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael T. Peterson | last post by:
Would anyone care to recommend a good graphing package (commercial or otherwise)? I've looked at some of the PEAR Image packages - The only graphing package is still alpha quality. One...
4
by: FGO | last post by:
Hi all, I use jpgraph as a graphing tool and it is very slow. Is there a solution to tune it or will I have to use another graphing solution, and which one? (My graphs are simple line stocks...
2
by: john | last post by:
Are there any charting or graphing modules for python that can write PNG, JPEG, or GIF graphics? I have found a couple of nice looking packages that can make beautiful postscript, PDF, or SVGs...
22
by: Kenneth Miller | last post by:
Hello All, I am new to Python and i was wondering what graphing utlities would be available to me. I have already tried BLT and after weeks of unsuccesful installs i'd like to find something...
6
by: Michael Hill | last post by:
Hello, all. I am considering writing an online graphing utility. I plan it to be of good quality, such that an undergraduate university student can print it out and include it with a lab report....
1
by: Mudcat | last post by:
Hi, I have looked through the previous suggestions on graphing modules and have been able to find some good suggestions. However I was wondering about something more specific. I am going to...
1
by: robby.walker | last post by:
Hi, I've just released a full-featured online graphing calculator at http://www.e-tutor.com/et2/graphing/ It requires no downloads or plugins - just JavaScript. You can track points on the...
0
by: Dexter | last post by:
GraphEasyRect was previously available as an applet. Now we have converted it to a desktop standalone application that runs on multiple platforms Windows, Mac, and Linux This tool allows...
2
by: sydneytroz | last post by:
I am writing a program to simulate a double displacement reaction getting to equilibrium, but I am having some trouble graphing the particles' concentrations. It seems that it's only possible to pan...
1
by: skeates | last post by:
Hey all - I'm attempting to write a program that accesses a database, runs some calculations according to user input, and then creates some graphs from the results. The first two steps were pretty...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.