google.charts.load('current', {'packages': ['table']});google.charts.load('current', {'packages': ['corechart']}); google.charts.load('current', {'packages': ['table']});
google.charts.load('current', {'packages': ['corechart']});google.charts.load('current', {'packages': ['corechart']}, {'packages': ['table']});$(document).ready(function () {
$('#option-2').change(function () {
if ($(this).is(':checked')) {
alert("Table");
google.charts.load('current', {'packages': ['table']});
google.charts.setOnLoadCallback(TableTemps);
google.charts.setOnLoadCallback(TableWatts);
google.charts.setOnLoadCallback(TableAmps);
}
});
$('#option-1').change(function () {
if ($(this).is(':checked')) {
alert("line");
google.charts.load('current', {'packages': ['corechart']}, {'packages': ['table']});
google.charts.setOnLoadCallback(Temps);
google.charts.setOnLoadCallback(Watts);
google.charts.setOnLoadCallback(Amps);
}
});
});There are three minor but important limitations with loading Google Charts that we expect to resolve in the near future:
- You can only call
google.charts.load()once. But you can list all the packages that you'll need in one call, so there's no need to make separate calls.
- You can't
autoloadthe library.
- If you're using a ChartWrapper, you must explicitly load all the packages you'll need, rather than relying on the ChartWrapper to automatically load them for you.
--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/9BfnY-emyA0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/6cd48650-c174-40e0-9ab5-873cfbc5441b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAFEEN0bhe6LAqNE6zM4nLdfnSYcDDmeckaGW78ao%3DESerNR4KQ%40mail.gmail.com.
Hi Daniel,
Just tryied like that and it is not working neither.
But thanks for your response:)
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMtOLDSf8R18OsvO0tT9DhXmdvPWuws_VVBcXzHJMj9Vw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAFEEN0Zhd2Rqs63uWDjcx8pgKE3pa0BkSPrVw0gJsdTr5-8LKA%40mail.gmail.com.
google.charts.load('current', {'packages': ['corechart']}, {'packages': ['table','line']});
function Watts() {
var jsonData = $.ajax({
url: "GetWattsData.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {title: 'Average Watts SC1 Datacenter',
width: 500,
height: 400,
vAxis: {
title: 'Power in Watts'
},
hAxis: {
title: 'Day of month'
}
}
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function Amps() {
var jsonData = $.ajax({
url: "GetAmpsData.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {title: 'Average Ampers SC1 Datacenter',
width: 500,
height: 400,
vAxis: {
title: 'Current in Ampers'
},
hAxis: {
title: 'Day of month'
}
}
var chart = new google.visualization.LineChart(document.getElementById('Amps'));
chart.draw(data, options);
}
function Temps() {
var jsonData = $.ajax({
url: "GetTempData.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {title: 'Average Temperatures SC1 Datacenter',
width: 500,
height: 400,
vAxis: {
title: 'Temperatures Celsius'
},
hAxis: {
title: 'Day of month'
}
}
var chart = new google.visualization.LineChart(document.getElementById('Temps'));
chart.draw(data, options);
}
function TableWatts() {
var jsonData = $.ajax({
url: "GetWattsData.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {title: 'Average Watts SC1 Datacenter',
width: 150,
height: 200,
}
var chart = new google.visualization.Table(document.getElementById('TableWatts'));
chart.draw(data, options);
}
function TableAmps() {
var jsonData = $.ajax({
url: "GetAmpsData.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {title: 'Average Ampers SC1 Datacenter',
width: 150,
height: 200,
}
var chart = new google.visualization.Table(document.getElementById('TableAmps'));
chart.draw(data, options);
}
function TableTemps() {
var jsonData = $.ajax({
url: "GetTempData.php",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(jsonData);
var options = {title: 'Average Temperatures SC1 Datacenter',
width: 150,
height: 200,
}
var chart = new google.visualization.Table(document.getElementById('TableTemps'));
chart.draw(data, options);
}google.charts.load('current', {'packages': ['table', 'corechart']});
google.charts.load('current', {'packages': ['table', 'line']});Hi everybody,
--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/fd2da2a8-5875-481e-9a85-fa110e472242%40googlegroups.com.