Quarta-feira, 11 de Março de 2009
Due to the concept of the
SAPO Campus platform, there's a strong widget presence. Based on this, I made a few integration tests of
Google's Visualization API with widgets built using the
UWA. This combination is used on the assessment's results visualization, allowing the users to have visual information about several aspects of their participation.
In these tests I decided to create an example that loads dynamic data from a database. The approach taken is based on two files, a HTML file where I have all the Javascript code that generates the widget and a PHP file that makes the database query and the data conversion to JSON.
And you ask, how do we load the data into the HTML file? Simple, using the UWA's API method
UWA.Data.getJson. This method simply calls the PHP file and then converts the data received in JSON format into a Javascript object. Then, all I have to do is build my visualization based on Google's Visualization API methods, which results in this:

Now it's time to keep on working, because there's still a lot to do!
É bom ver que já há coisas a mexer no lado das widgets. E é óptimo ver que escolheste tratar os dados em JSON. Ouvi dizer qualquer coisa sobre umas miúdas que ouviram falar em JSON e que se meteram em trabalhos :).
Comentar: