Look how I did prepear for data :
How I can upgate it?
For exemple what I mean.
I want add line to diagram as one line/ I will send Colum['a','b','c','d']
and rows as : First rows is ['1','3','4','2'] and its all point for
painting one line. I send as [first line: point one, second line: point one
and ....]
One row = one line. How?
<script type="text/javascript"> google.load("visualization", "1",
{packages:["corechart"]}); //google.setOnLoadCallback();//drawChart
function Clicker() { if ($("#checked_table
input:checked").length == 0) { alert("Рђ
выбирать кто будет?"); }else {
drawChart(); } } function
drawChart() { var data = new google.visualization.DataTable();
data.addColumn('string', 'x'); // for generation
bottom line diagram attributes get_week_days();
// select checked rows var checked_ids = checked();
// auto generation name for array with var c = "row_data";
// create string of values as
103,441,236,397,721,870,818,388,9,321,742,634,186,637,976,730,970,162,990,770
for(var p = 0; p < checked_ids.length; p++ ) {
window[c + p] = selected_arr_val(checked_ids[p].id);
} // Generate the line names of diagram for
(var i = 0; i < checked_ids.length; i++) {
data.addColumn('number', "Line: "+ i); } var
week_day_counter = 0; // long as long table for
(var i = 0; i < 20; i++) { var arr = [];
// first elements is name of point (words under diagram)
arr[0] = week_day[week_day_counter]; //get data
from arrays values <td> for(var t = 1;
t<checked_ids.length+1; t++) { arr[t]
= inserted_data(i)[t-1]; } // add one row
data.addRow(arr);
//[week_day[week_day_counter] , inserted_data(i)[0],inserted_data(i)[1]]
week_day_counter++; // for exept duplicat of
days if(week_day_counter == 7) {
week_day_counter = 0; } }
var options = { title: 'Company Performance',
width: 980 }; var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options); // return all checked input ids
function checked() { //
инициализация в массив отмеченных строк
(РїРѕ input) var input_array = $("#checked_table
input:checked"); return input_array; }
//Selecting data from all <td> in one row function
selected_arr_val(id) { // array of vars (text
of <td>) var val_array = []; // prepear
id for selecting var selected_text; //
selected data from <td> in <th> for(var w = 0; w < 20; w++)
{ selected_text = "#" + id + "-" + w;
val_array[w] = $(selected_text).text();
val_array[w] = parseInt(val_array[w], 10); }
return val_array; } //values of array
values by key, as exemplpe return $array[row_data...checked_ids.length][key]
function inserted_data(key) { var
imaging_data = []; for (var i = 0; i < checked_ids.length;
i++) { imaging_data[i] =
(window["row_data"+i][key]); } return
imaging_data; } function get_week_days()
{ week_day = []; week_day[0] =
"Mon"; week_day[1] = "Tue"; week_day[2] =
"Wen"; week_day[3] = "Thr"; week_day[4] =
"Fri"; week_day[5] = "Sat"; week_day[6] =
"Sun"; return week_day; } }
</script>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.