Help in Drawing Graphs on Webpage

Results 1 to 4 of 4

Thread: Help in Drawing Graphs on Webpage

  1. #1
    Celia Guest

    Default Help in Drawing Graphs on Webpage

    I would like to draw some graphs using values from a table as the x and y axis values. Please give me an idea on how to get it done or has anyone a code or applet or example or anything that can help me? I&#039m new at all this and I need help desperately. Thanxs in advance. Please mail me the code at <BR>celialim@pi-eta.com.

  2. #2
    Sathiya Guest

    Default RE: Help in Drawing Graphs on Webpage

    Hi,<BR> If you are allowed to use third party component i think their is a component called ASPChart which gives you so many options like pie , bar etc.( i forgot the address )<BR><BR>sathiya

  3. #3
    Zack Jones Guest

    Default RE: Help in Drawing Graphs on Webpage

    www.serverobjects.com is the address you were thinking about. I&#039ve used ASPImage and ASPChart in the past and have had good luck with both products.<BR><BR>Take Care, Zack Jones<BR>zjones@arinc.com<BR>

  4. #4
    asdf098@axtek.com Guest

    Default RE: Help in Drawing Graphs on Webpage

    # Perl_5. http://www.activestate.com<BR>use strict;<BR>use Math::MatrixReal; # Graphing points [ x y ]<BR>use GD; # Simple graphics module.<BR><BR>use vars qw(<BR>&nbsp;&nbsp;* $image <BR>&nbsp;&nbsp;* $black $red $green <BR>&nbsp;&nbsp;* $row $col <BR>&nbsp;&nbsp;* $elem $elem1 $matrix<BR> );<BR><BR># Prepare image for drawing.<BR>$image = new GD::Image(50, 50); # ( width, height )<BR>$image-&#062;colorAllocate(255,255,255) ;<BR># Load palette with colors.<BR>$black = $image-&#062;colorAllocate(0,0,0);<BR>$red = $image-&#062;colorAllocate(255,0,0);<BR>$green = $image-&#062;colorAllocate(0,255,0);<BR><BR># Perl will accept data from just about any <BR># imaginable source in just about any configuration <BR># we can dream up. To keep it simple let&#039s store the <BR># data with the code for this graphics example.<BR># See __DATA__ area at EOF.<BR>while(&#060;DATA&#062;) {<BR>&nbsp;&nbsp;* $matrix = Math::MatrixReal-&#062;new_from_string($_);<BR><BR>&nbsp;&nbsp; * # The dim function not necessary here, yet, <BR>&nbsp;&nbsp;* # it is nice to know about.<BR>&nbsp;&nbsp;* ($row, $col) = dim $matrix; <BR>&nbsp;&nbsp; $elem = element $matrix ( $row, $col-1 ) ;<BR>&nbsp;&nbsp; print("$elem"); # Console output.<BR>&nbsp;&nbsp; $elem1 = element $matrix ( $row, $col ) ;<BR>&nbsp;&nbsp; print(" $elem1
    "); # Console output.<BR><BR>&nbsp;&nbsp; # Subject graph points to coloring logic ;-)<BR>&nbsp;&nbsp; if ( ( $elem &#062;= 15 ) and ( $elem1 &#062;= 12 ) ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;$image-&#062;setPixel($elem,$elem1,$red);<BR>&nbsp;&nb sp; } else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;# Reset brush to black ink.<BR>&nbsp;&nbsp;&nbsp;&nbsp;$image-&#062;setPixel($elem,$elem1,$black); <BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; if ( ( $elem == 11 ) and ( $elem1 == 12 ) ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;$image-&#062;setPixel($elem,$elem1,$green);<BR>&nbsp;&nbs p; } <BR>}<BR><BR># Save the image to disk after converting <BR># to binary format for Win32 machines.<BR># Use open source graphic format.<BR>my $pngfilename = "Stendhal.png" ; <BR>open(BFH, "&#062;$pngfilename");<BR>binmode BFH;<BR>print BFH $image-&#062;png;<BR>close(BFH);<BR><BR># Create an IE5 container for viewing. <BR># (Image Composer 1.5+ works also.)<BR>open(HTM, "&#062;my_testlook.html");<BR>print HTM "&#060;html&#062;
    ";<BR>print HTM "&#060;head&#062;
    ";<BR>print HTM " &#060;title&#062;$0&#060;/title&#062;
    ";<BR>print HTM "&#060;/head&#062;
    ";<BR>print HTM "&#060;body&#062;
    ";<BR>print HTM "&#060;body bgcolor=999999&#062;
    ";<BR>print HTM " &#060;p&#062;$pngfilename&#060;/p&#062;
    ";<BR>opendir DIR, "." ;<BR>my @dir = readdir DIR ;<BR>close DIR ;<BR>foreach (@dir) {<BR>&nbsp;&nbsp; # Load every png file in dir for viewing.<BR>&nbsp;&nbsp; #if ( /.png$/ ) { <BR>&nbsp;&nbsp; # Load only current png file for viewing.<BR>&nbsp;&nbsp; if ( /^($pngfilename)$/ ) { <BR>&nbsp;&nbsp;&nbsp;&nbsp;print HTM " &#060;img src=$_&#062;$_&#060;/img&#062;
    ";<BR>&nbsp;&nbsp;&nbsp;&nbsp;print HTM " &#060;br /&#062;
    ";<BR>&nbsp;&nbsp; }<BR>}<BR><BR>print HTM "&#060;/body&#062;
    ";<BR>print HTM "&#060;/html&#062;
    ";<BR>close(HTM);<BR><BR># Make system call to open html file (IE5 works with png)<BR># and view point plot for a few seconds.<BR>`start my_testlook.html`;<BR>sleep(4);<BR># Clean up.<BR>unlink &#039my_testlook.html&#039;<BR><BR>__DATA__<BR>[ 5 3 ]<BR>[ 2 7 ]<BR>[ 8 10 ]<BR>[ 12 7 ]<BR>[ 11 12 ]<BR>[ 13 14 ]<BR>[ 15 9 ]<BR>[ 17 13 ]<BR>[ 15 10 ]<BR>[ 18 13 ]<BR>[ 20 17 ]<BR>[ 16 11 ]<BR>[ 15 13 ]<BR>[ 21 17 ]<BR>[ 18 19 ]<BR>[ 22 17 ]<BR>[ 21 22 ]<BR>[ 23 44 ]<BR>[ 25 29 ]<BR>[ 27 23 ]<BR>[ 25 28 ]<BR>[ 28 33 ]<BR>[ 29 37 ]<BR>[ 36 41 ]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •