php dynamic pie chart conception problem

Discussion in 'PHP' started by mcdeere02, Aug 5, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hi guys,

    i'm building a dynamic pic chart generator in php / ajax
    i'm using GD for drawing arcs and printing values.

    Problem is that I believe i'm bound to use GET parameter since the only way to re-draw an image is to change an img src=''

    My image tag looks like this :
    (fear not the %5B%5D, it means []. i'm using an array parameter)


    Line number On/Off | Expand/Contract

    <img src='./pie_draw.php?c%5B%5D=000000&v%5B%5D=25&c%5B%5D=FFFFFF&v%5B%5D=75' alt='bla' />



    in short :
    c[]=000000
    v[]=25
    c[]=FFFFFF
    v[]=75

    c = color hex code
    v = % value

    Now in pie_draw.php
    I parse the parameter and draw 25% of the pie chart in black and 75% in white.

    I'm using AJAX to allow using buttons to increase or decrease one element's value and draw a new pie chart accordingly without reloading the page.

    Thing is I might want to add labels and size parameters later on..
    So a GET parameter won't be enough as i'll get above the 255 allowed chars
    Do you see an other way I could re-draw a picture, using alot of params without reloading the page?
     
    mcdeere02, Aug 5, 2009 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    use POST with AJAX (also possible)

    Use google to search how to use POST with ajax! have fun!
     
    EricBruggema, Aug 5, 2009 IP
  3. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Why do you think you are limited to 255 chars?

     
    premiumscripts, Aug 5, 2009 IP
Thread Status:
Not open for further replies.