How might I create a graph using PHP or AJAX?

Discussion in 'Programming' started by mnymkr, Apr 29, 2007.

  1. #1
    I need to write a small program that will graph numbers from a function and then allow the person to download the graph or convert it to php

    i can be any simple function

    say

    y= 5 x


    Say I want x to start at 2

    the program will auto increment it by 1 to 10 and graph
     
    mnymkr, Apr 29, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Just create table, and use Images as your increasing number, then allow them to download it as a .doc by changing content-type to word doc.
     
    ccoonen, Apr 30, 2007 IP
  3. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #3
    but that won't create a graph in the browser...which is what i need
     
    mnymkr, May 1, 2007 IP
  4. void

    void Peon

    Messages:
    119
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    a) Cheat - For a bar graph use an image for each bar and set its height using the function result. No use for downloading though.

    b) Use GD or JPGraph

    c) Use Flash or SVG.
     
    void, May 1, 2007 IP
  5. Weizheng

    Weizheng Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    As pointer out, use some graphing tools.

    Lots of free ones. If you adventurous, try to make your own - use the php GD functions.
     
    Weizheng, May 2, 2007 IP
  6. 3l3ctr1c

    3l3ctr1c Peon

    Messages:
    380
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This may help you

    
    http://www.amcharts.com/pie/
    http://www.liquidx.net/plotkit/
    http://www.solutoire.com/plotr
    
    Code (markup):
    Source : miniajax

    3l3ctr1c
     
    3l3ctr1c, May 2, 2007 IP
  7. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #7
    I would have someone design a background for the graph with company logo and marking etc, that background can be used as a base image for your graph, you can then have gd built bars out of small gradient images that match the proportions of the data in perspective with the image still, and then paste them ontop of the background to create the graph, that image would be output as a normal image either to the browser or you could force a download of the graph
     
    krakjoe, May 2, 2007 IP