FAQ
-
How to feed the data from server?
There are several ways to meet your need:
-
If you already have HTML table on the page and want user to create chart
using the table data, here is an example.
You just need to create a JavaScript
function and attach it to some event. Here we created the function "doTableChart()" and
attached it to "onclick" of table.
In the JavaScript function, we create a new instance of config and set chart
type, size, data table id, output chart image id, etc. See
Developer section for detail.
To see the above code in action, click any where on the following table:
Animals In Circus Over Years
|
2006 |
2007 |
2008 |
| Bear |
20 |
31 |
40 |
| Lion |
95 |
83 |
76 |
| Tiger |
55 |
65 |
50 |
You can do it without the the JavaScript function and put everything in "onclick" event.
This will end of one line of code change.
However, the code will be hard to read.
|