How to display database data on a dynamic graph/chart
In my database I have a simple table that contains values showing the basic physical activity of a user. There are just 4 columns in this table - username, timestamp, active and sedentary. It should be updated for a user every hour, with the amount of minutes they are active in the hour stored under active,开发者_运维百科 and non-active under sedentary.
My question is how can I display this data for a user on a webpage? As the database is always being updated with new values each hour, how would I go about creating a dynamic chart, graph or some other format that reads from the database and display the activity of the user effectively? Any code examples would be much appreciated too, thanks in advance.
Also I don't have admin access to the web server I am using so I can't install any components or software on it
You did not really express any technical preference about language, framework or database.
Regardless of the server technology, you could use a mix of
For appealing chart presentation: Google visualisation Or your own SVG drawing skill.
For periodic refresh:
2.a
<meta http-equiv="refresh" content="600">
To rely on the browser to refresh periodically.
Or
2.b Ajax periodic calls to the server in XML/JSON
These are just a few ideas for simple/affordable development techniques
But there are many other techniques. Have a look at this list for charts for instance.
精彩评论