Checked the api and a few more steps involved. Simplest way to see what is happening: if you have a div on your page with an id of "chart_div" and google charts is loaded up already ( google.load("visualization", "1.0", {"packages":["corechart"]}); ), you can run the following lines of code in the browser console and it will work:
- Code: Select all
var chart = new google.visualization.PieChart(document.getElementById("chart_div"));
var data = new google.visualization.arrayToDataTable([["Label","Value"],["hours",44]]);
chart.draw(data, {"min":0,"max":180,"width":200,"height":200});
See:
https://code.google.com/apis/ajax/playg ... #pie_chart. Note that you can't send json data directly into the draw() function, you have to convert with arrayToDataTable() first.
The rest is just how to organize the client-side code, load up required resources, trigger on what events, and how to wire up with Servoy. A lot of flexibility and variations possible here. If you're doing a lot of google charts, you can get your code to the point where you just pass in data, options, chart type -- and you're done. Can even drive it all from a UI at runtime.
Sorry this isn't a step-by-step answer -- a number of moving parts that you have to hack into Servoy's way of doing things so not just a simple "do this and then do that". A number of us around the forum who are capable of helping you out directly if you need.