php generated graphics

I need to build a scrolling graph. I have a static background image and each refresh plots a dot in the appropriate place. I have no idea how to copy the current image, shift it one pixel, erase the remaining stale data image and plot the new dot. In other words, I’ve got everything but the animation part of this.

Also, would this be better handled using javascript and is it possible to do in js?

I realize I really didn’t ask a question… Can someone point me to how to do this animation in PHP. I’ve never had to tackle any graphics in PHP before and I’m clueless. I haven’t found anything on the internet on this either.

Sorry for the double post.

I would suggest not doing something like this in PHP, Maybe it’s time to learn something new “JavaScript”. 8)

Normally, I would agree. I’m not aware of a way to do the image manipulation in JS, but doesn’t mean there isn’t. I would much prefer to use client CPU than server CPU, but the server has to get involved each time anyway to grab the data to be plotted. Plotting three points on an image, and saving is not too intensive of a task considering the data would have to be sent to the client, which I’m guessing is close to a wash in memory and processor usage. This process only happens once every 30 seconds, so I’m not slamming the server hard at all. And lastly this whole process only happens on a dashboard page, which is not a common or well used page, but intended for a webmaster to glance at a chart and go.

In all my years of programming, I’ve never needed the GD library for anything. I came here looking for help in using GD. We all have a fear of turning a corner and proceeding down the dark hall of the unknown. We generate a fear of possible ghosts and goblins that might be there, only to find there is nothing more in the hall than there was in the light, and there was nothing to fear at all.

So, I broke out the GD manual, not a whole lot to it, I’m happy to say. After about a half hour I completed that segment of my project and it is working just fine. Learned something too!

Sponsor our Newsletter | Privacy Policy | Terms of Service