My application creates a loan amortization table using javascript.
This table is built dynamically each time the user changes their loan
amount, interest rate or term. The table is generated with the
following javascript code:
for (term_counter = v_loan_term; term_counter >= 1; term_counter =
term_counter - 1)
{
var
x=document.getElementById('amortization_table').insertRow(row_insert_rule);
var t_month=x.insertCell(0);
var t_sbalance=x.insertCell(1);
var t_interest=x.insertCell(2);
var t_payment=x.insertCell(3);
var t_ebalance=x.insertCell(4);
t_month.innerHTML=payment_month;
t_sbalance.innerHTML = starting_balance.toFixed(2);
t_interest.innerHTML = (starting_balance * v_interest_rate/
12).toFixed(2);
t_payment.innerHTML = v_monthly_payment.toFixed(2);
ending_balance = starting_balance - v_monthly_payment +
(starting_balance * v_interest_rate/12);
t_ebalance.innerHTML = ending_balance.toFixed(2);
starting_balance = ending_balance;
row_insert_rule = row_insert_rule + 1;
payment_month = payment_month + 1;
}
The table generates fine and is displayed to the user. What I'm
wondering is how I can use the data generated in the table for Google
Visualizations. It seems like every example shown in the API
documentation is for a static table. Is there a method I should be
looking at whereby I can pass the entire table I generate to the
Google Visualization API?
Is there a specific method that anybody can recommend? I did try the
gvChart jquery plug-in, but it seemed like it only would pass the
table header (which is defined in the HTML) and not the dynamically
created table data.
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.