PHP GD Graphs
I'm calculating the success of whether coupons work or not and would also like to show what times the coupon worked.
Like on Amazon.com Coupon Codes - all coupons, discounts and promo codes for amazon.com
If you check out the coupon they have an image like this:
I imagine that is showing at what times since the coupon was added it was working, so at first it was working but then it started to get reported as not working..
Would it be hard to create something like this and how would I go about doing it?
Right now in my database I am storing what couponid the user rates, whether it works (yes/no) and what rating id theres is, I assume I'd have to add the date when it was rated as well
Take a look at Sparkline PHP Graphing Library. I'm almost certain that is what is being used and it's a nice simple library to learn.
Would it be hard to make these graphs? Not at all.
Do you need to store the dates of each rating? Yes!
Ok cool. I downloaded sparkline and looked at some of the examples and samples/deficit.php seems to be what retailmenot are using, or atleast thats what the procuded graph looks like.
In deficit.php they have this:
Anyone have any ideas? I want to put the percentages for the last 30 days into the graph, but I dunno how to select the percentage for each day for the last 30 days, my structure is like so:
success_id, success_couponid, success_yn, success_ip, success_time
1, 21, yes, 127.0.0.1, time();
|All times are GMT. The time now is 01:54 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0