What language and framework should I use for data visualization in web and desktop application with the following requirement?.The user will specify the range of values for an axis and the corresponding data should be shown with automatic scaling based on highest and lowest values of axis.The data is stored in mysql.
The tutorial is written in PHP, the logic is simple, every 1 second, it will ask new data, the tutorial use random data.
Make sure you have
integer column. For integer column you can name it like,
created_at, and use
unix timestamp as value.
I prefer with column name
integer data type. Here is an example query if you want to use
integer column :
SELECT COUNT(value), from_unixtime(`created_at`, '%Y-%m-%d %H:%i') FROM `table` WHERE `created_at` = (UNIX_TIMESTAMP (CURRENT_TIMESTAMP) - 1)
For PHP, I usually use
time() to generate unix timestamp. And when no data returned, you need to handle the output to give 0 instead null.
I find AngualrJS best for this.
Poll your server regularly, storing the result in a
$scope variable, which is bound to a chart in your HTML.
Every time the data changes, your chart is automagically updated, with no extra code for you to write to update it.
You will find a very basic, hence easy to understand, example here.