Create Chart using PHP-MySQL
I have a mysql table - request_events with three fields; request_eventsid,datetime,type.this table will trac开发者_如何转开发k all the activities of my website day wise and also type wise.thus,type may be 1 or 2.I need to display an open-chart for understanding the progress.So I need to retrieve the ratio of type2/type1 as input day wise.How can I get all these input for last 30 days from this table.Please give me some idea....It already kill my week end.Please help me
You can get 30-day type-wise event counts with a query something like:
SELECT COUNT(type) FROM request_events
WHERE
datetime > DATE_SUB(CURDATE(),INTERVAL 30 DAY)
GROUP BY type;
You can use smart chart maker. it can help you generate any charts that is fed directly from your MySQL database, it does support a data filter option, from which you can specify the exact data you want to display in your chart, and finally it supports aggregation functions such as "count, sum, avg,..etc)
You can use smart chart maker for any types of charts. For more information please watch this video tutorial
精彩评论