Graphing

Discussion in 'Javascript' started by IW, Nov 1, 2005.

  1. IW

    IW Guest

    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
     
    IW, Nov 1, 2005
    #1
    1. Advertising

  2. IW

    VK Guest

    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>
     
    VK, Nov 1, 2005
    #2
    1. Advertising

  3. IW

    Randy Webb Guest

    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/
     
    Randy Webb, Nov 1, 2005
    #3
  4. 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.
     
    Dr John Stockton, Nov 2, 2005
    #4
  5. 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.
     
    Dr John Stockton, Nov 2, 2005
    #5
  6. IW

    RobG Guest

    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
     
    RobG, Nov 3, 2005
    #6
  7. 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.
     
    Dr John Stockton, Nov 3, 2005
    #7
  8. 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.
     
    Dr John Stockton, Nov 4, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Davis

    crystal reports does graphing?

    Jon Davis, Jan 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    351
    S. Justin Gengo
    Jan 20, 2004
  2. Nevets Steprock

    Client side dynamic graphing problem

    Nevets Steprock, Apr 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    334
    Nevets Steprock
    Apr 26, 2005
  3. Jay
    Replies:
    5
    Views:
    422
  4. morc
    Replies:
    3
    Views:
    379
    Dave Mandelin
    Mar 22, 2006
  5. UJ

    Easy graphing.

    UJ, May 8, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    403
    Laurent Bugnion
    May 17, 2006
Loading...

Share This Page