Using a simple google chart, I am trying to use jQuery .load to push/pull that chart into another web page which will have the containing DIV:
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"],callback:drawChart});
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance',
hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
<div id="test_div">this div loads fine</div>
</body>
</html>
and here is a sample page that will have the containing DIV:
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1query.min.js">
</script>
</head>
<body>
<script>
$(document).ready(function(){
$('#my_div').load('chart.html #chart_div', function() { drawChart(); });
});
</script>
<div id="my_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
I have tried various loading techniques by removing google.setOnLoadCallback(drawChart);
and replacing it with the $document.ready but nothing seems to work.
I have gone through each one of the similar questions posted here but cannot seem to get this working.
any insight appreciated, Thanks!
edit: I noticed that by adding this line to the "container.html" file:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
and changing:
$('#my_div').load('chart.html #chart_div', function() { drawChart(); });
to
$('#my_div').load('chart.html', function() { drawChart(); });
or even:
$('#my_div').load('chart.html');
It will indeed load the whole page into "#mydiv" but what I want is to just load the specific "#chart_div" into "#mydiv"
i have similar problem. My google chart not load with jquery version 1.11.1
if you remove jquery-1.11.1 or similar and add
<script type="text/javascript">
google.load("search", "1");
google.load("jquery", "1.4.2");
google.load("jqueryui", "1.7.2");
</script>`
its working
Related
I would like to use google chart with flask.If i move the js code to html file it works fine.
However, Separating js code from html file does not work. The chart is not displayed.
[main.html]
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="{{ url_for('static',filename='js/g_chart.js')}}"></script>
...
<div id="curve_chart2" style="position:absolute; top:100px;width: 400px; height: 400px"></div>
<div id="curve_chart" style="position:absolute; top:300px;width: 800px; height: 100px"></div>
[g_chart.js]
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'A', 'B'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance',
curveType: 'function',
legend: { position: 'bottom' },
backgroundColor: { fill: "#000000"},
fontSize:12,
fontColor:"#FFFFFF",
titlePosition: 'in',
hAxis: {
color: '#FFFFFF',
}
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
var chart2 = new google.visualization.ScatterChart(document.getElementById('curve_chart2'));
chart.draw(data, options);
chart2.draw(data, options);
}
Is there any solution?
Separated code into js, good. But it still needs to be triggered.
make code to build chart a function
in html script add an event listener to call function in 1
gchart.js
function buildchart() {
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
}
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'A', 'B'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance',
curveType: 'function',
legend: { position: 'bottom' },
backgroundColor: { fill: "#000000" },
fontSize: 12,
fontColor: "#FFFFFF",
titlePosition: 'in',
hAxis: {
color: '#FFFFFF',
}
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
var chart2 = new google.visualization.ScatterChart(document.getElementById('curve_chart2'));
chart.draw(data, options);
chart2.draw(data, options);
}
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GChart</title>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="/static/js/gchart.js"></script>
</head>
<body>
<main>
<section>
<h1>Hello</h1>
<div id="curve_chart2" style="position:absolute; top:100px;width: 400px; height: 400px"></div>
<div id="curve_chart" style="position:absolute; top:300px;width: 800px; height: 100px"></div>
</section>
</main>
<script>
document.addEventListener("load", buildchart());
</script>
</body>
</html>
I managed to add this working code in indesign :
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable
([['X', '1'],
['Bien', 900000],
['Honoraires notariƩs', 67500],
['Travaux', 300000],
['Mobilier', 67500],
['Honoraires Hikin\'Vest', 100500]
]);
var options = {
is3D: true,
colors: ['#4c96d7', '#cf1717', '#168200', '#f7e031', '#c49a6c'],
chartArea: {width: '86%', height: '86%', left:'40', bottom:'04'},
legend: {position: 'in'},
slices: { 4: {offset: 0.2},
1: {offset: 0.2},
2: {offset: 0.2},
3: {offset: 0.2},
theme: 'maximized',
},
};
var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="piechart_3d" style="width: 350px; height: 350px;"></div>
</body>
</html>
But this one doesn't work, can you help me ?
This code was generated on https://www.publicalbum.org/blog/embedding-google-photos-albums.
If it's not possible can you tell me how embed a slideshow with google Drive or Google photos in InDesign.
I use "Publish Online" in InDesign.
Thank you very much.
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/publicalbum#latest/embed-ui.min.js" async></script>
</head>
<body>
<div class="pa-gallery-player-widget" style="width:100%; height:480px; display:none;"
data-link="https://photos.google.com/share/AF1QipM8qglM9SYDwhbTlTsBwzMFNnUy3ae_MhZ6G0MrT2R3M208j2EeB6EOiSj7Q6BUgg?key=aGZmTThnOHZIS0NzSlZaaWwtZEtJZkRnUjlXVjBn"
data-title="Bondy"
data-description="8 new photos added to shared album"
data-background-color="#ffffff">
<object data="https://lh3.googleusercontent.com/lpIrmwAAeI-p6U3aI4dsEfGTBAGIFueRj5B-s-5MiDT85gHXGYYgEh-JDDs2Ctdor2wj-JHJYmTbhBT9sqDlcfOwOseTPFrVsZWqdWqMss7ddUhAzFfeytr0M12MUX9GPGK9bekgiA=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/6kQS6AXg7Lu0u1GgfcZU7WwAhVcjkctwjChyJ4QgpVRp9pssLWMGcOoXfu7iaEr32P6GhS1ePayrHJeJEPcZTKCf_FeQMkx5j2bcBL-rT79fR1HOff8RmuV1vF-e-3mkdWyDu8mnpQ=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/OVm-Eja_ulFg2RW-JjDmhmOZH7qx343wTfqP4WAHyLSvgJsGhtSBW1Og8VG7pFa-WPDqvW1xKKb4PHK_WoPpXq9MhNTtzT2ITH7oe0mkRMO3C6zHjRbedZNY2w8VpAZUVeuEG47qqA=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/HO9K0UCj1VUhDe9bJEomkVt6So2rKnwT_V6Il9Nx734bONRRi1QU34aCxPM-SJPXi3Lfp_K5zQcu5CcHFws4bwq6yQKvROEO7KISdewHfYBvud-GY22tm4kC3yGmxbC21l0nIr4O_g=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/nayFhxGXP6pCAstQlKYGbd662JjpBoeA15xyF5rVoXhefkeuYeAQrB-Pq0AkPBbiFOgdeGcbCOSdeV2RCe-tQrA5ufJ1muw5oHUr01CtCRNx-9B5tI_h1lzUkC0z3tWOrfMQvp4SqA=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/dmQ4e_p0Z5kDRNw5R2RuH1XMQDPuEaUThXGp3rPiroV6nYwhIktZe5Zlc1olbZywP0YLJBDZJSoyL76zNTbGJIvpXyUE4GFhanvAP_MCrL_ZLv9ayNX47yYba4iPlK_glqkui_KGVw=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/LVHXYLdL3kcDIT8TBIC7jfwsKCZKVYpdAaa49PhTG8wgziuC36N1OoFaQEC_R4GHZp-YJ-VO8fLU5P6zarsatwbikOVrqlqxDMKh6y-_2-rlIzGpb6bxbm4LFUDS3pUJKPKG-TVVWw=w1920-h1080"></object>
<object data="https://lh3.googleusercontent.com/2Um38iEfoYKBoe6l4_YDiYNNsnnz_4sBm4FF-ogxveFxNJOkMIA-7kcHk8c5WA3-9yUc3670lh_v2ZoFBkh84r4_nitdyg9kJ3tuUUJ1hdFk8D5cvLBBdHcX2jIa-ia_rAjLr-Y3ug=w1920-h1080"></object>
</div>
</body>
</html>
I may be wrong, but it looks for me as the task that can not be accomplished this way at all. I think you have to download all these photos on your HDD first. Then you can place them in your InDesign document (manually of via some script). This online generated HTML code has nothing to do with InDesign and its ExtedScript.
InDesing has a tool to publish documents online, but all these documents (and all linked images) should be stored locally first. As far as I know.
I'm trying to create an HTML based dashboard from which we can monitor the temperature of different server cabinets around work. My problem is that I can't get the gauges to display at all. Included below is the code I have so far.
Thanks
<!DOCTYPE html?>
<html>
<head>
<title>BCS Temperature Monitor</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"/>
<script type="text/javascript">
google.charts.load('current', {'packages':['gauge']]);
google.charts.setOnLoadCallback(drawChart);
function drawChart (){
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Memory', 80],
['CPU', 55],
['Network', 68]
]);
var options = {
width: 400, height: 120,
redFrom: 90, redTo: 100,
yellowFrom: 75, yellowTo: 90,
minorTicks: 5
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
setInterval(function() {
data.setValue(0, 1, 40 + Math.round(60 * Math.random)));
chart.draw(data, options);
}, 13000);
setInterval(function() {
data.setValue(1, 1, 40 + Math.round(60 * Math.random)));
chart.draw(data, options);
}, 5000);
setInterval(function() {
data.setValue(2, 1, 60 + Math.round(20 * Math.random)));
chart.draw(data, options);
}, 26000);
}
</script>
</head>
<body>
<div class="page">
<div class="wrapper" id="header">
<div id="chart_div" style="width: 400px; height: 120px;">Hello</div>
</div>
<div class="wrapper" id="content">
</div>
<div class="wrapper" id="footer">
</div>
</div>
</body>
There are a number of small mistakes, see working demo here:
http://codepen.io/anon/pen/wzBArA
Script tags cannot be closed with <script />, you must use <script></script>
Your line calling google.charts.load used a second ] instead of a }
Your setInterval method had an extra ) after the Math.random call
How can I make the second DIV into an on click event? I have both of them displaying right now. I want to display one then when you click it displays the second one and back and forth.
I have never used HTML or JavaScript before so bear with me.
<html>
<head>
<DIV class="container"><HGROUP>
<H1>University of Illinois Hospital and Health Sciences</H1>
<H2>Storage Availability Charts and Graphs</H2></HGROUP><NAV
class="navbar"></div>
<DIV class="container">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Storage', 'Terabytes'],
['Raw', 95],
['Usable', 34],
]);
var options = {
legend: 'none',
pieSliceText: 'label',
title: 'EEI VNX5700',
pieStartAngle: 100,
is3D: true,
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</div>
<DIV class="container">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Unallocated', 'Used', 'Free'],
['Cerner fast pool', 1000, 400],
['General fast pool', 1170, 460],
['Raid', 970, 644]
]);
var options = {
title: 'Unallocated',
vAxis: {title: 'Pools', titleTextStyle: {color: 'red'}}
};
var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</div>
<body>
<div id="piechart" style="width: 700px; height: 400px;"></div>
</body>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</head>
</html>
If you want them to switch visibilities you should give them each a seperate id.
Then you will need to use javascript (jquery is an easy way to work with javascript)
The jquery code would look something like this
$('#div1').click(function(){
$('#div2').show();
$('#div1').hide();
});
$('#div2').click(function(){
$('#div1').show();
$('#div2').hide();
});
To use jquery get the library here: http://jquery.com/
If you don't want to use jquery here are simple show/hide functions:
<script>
function show(id) {
if(document.getElementById(id).style.display=='none') {
document.getElementById(id).style.display='block';
}
return false;
}
function hide(id) {
if(document.getElementById(id).style.display=='block') {
document.getElementById(id).style.display='none';
}
return false;
}
</script>
then just add those to your div onclick: <div id='div1' onclick='show("div2");hide("div1")'></div>
Ok if you want a div to be hidden when the page loads you can do (in jquery) $('#idOfDiv').hide() then to get the div to toggle you can do a $('#idOfDiv').toggle() Now if you want something to be an onClick even all you have to do is put it all in a
$("#secondDiv").hide();
$( "#firstDiv" ).click(function() {
$('#secondDiv').toggle();
});
$( "#secondDiv" ).click(function() {
$('#firstDiv').toggle();
});
example: http://jsfiddle.net/AFPT2/1/
I am trying to Display a google chart on a Modal Popup. It works just fine on a normal page, But it does not appear on the Modal.
This is the code I am using. I am not sure what is going wrong.
this is the HTML and JS code that lives on a url, /polls/
<!--Div that will hold the pie chart-->
<h3 style="text-align:center;">Test</h3>
<hr>
<div id="chart_div" style="height: 500px;">
</div>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Options', 'Votes'],
['1', 11],
['2', 2],
['3', 2],
['4', 2],
['5', 7],
['6', 21],
]);
// Set chart options
var options = {
'backgroundColor': 'transparent',
'is3D': 'True',
'legend':'bottom',
'width':'100%',
'height':'100%',
chartArea:{left:0,top:0,width:"100%",height:"80%"}
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
This is the html button that lives on page /home/
<a class="open-newmodal" href="/poll/">show poll</a>
So the idea is, that using a modal and jquery's .load() function, I should be able to load the chart that lives on /poll/ page to my /home/ page in the modal that I made.
This is the modal I am using
Modal Css
.newmodal-container {
display: none;
overflow-y: scroll;
position: fixed;
top: 0; right: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.3);
}
.newmodal {
min-height: 100%;
height: auto;
width: 60%;
margin: 0px auto;
background-color: white;
padding: 20px;
border:1px solid #D3D3D3;
box-shadow: 0px 0px 5px #D3D3D3;
}
.dp-none {
display: none !important;
}
.dp-block {
display: block !important;
}
Modal JS
// New Modal
var body = $('body'),
main = $('.main'),
open_modal = $('.open-newmodal'),
close_modal = $('.close-newmodal'),
modal_container = $('.newmodal-container');
open_modal.live('click', function(event){
event.preventDefault();
body.addClass('body-locked');
modal_container.addClass('dp-block');
var href = $(this).attr('href');
modal = $('.data-load');
modal.load(href);
modal.attr("title",href);
});
close_modal.live('click', function(event){
event.preventDefault();
body.removeClass('body-locked');
modal_container.removeClass('dp-block');
modal.empty();
});
$(document).keyup(function(e) {
if (e.keyCode == 27){
event.preventDefault();
body.removeClass('body-locked');
modal_container.removeClass('dp-block');
modal.empty();
}
});
Okay, seeing as how you want to load another page as a modal graph, I have the following solution.
Initialize your google lib on the parent page as in http://jsbin.com/abucet/3, then make sure your child page doesn't re-initialize or re-include the libs that are loaded in the parent page, see child # http://jsbin.com/ajerol/5/edit
So basically the child page # http://jsbin.com/ajerol/5
Parent Page accessing child # http://jsbin.com/abucet/3
Parent Page
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div id='headerDiv' style='background-color:#FF0000'>
Test Load
</div>
<div id='modalDiv' style='background-color:#FFAA00'>
Close this and click the button to load
Graph will be in a modal JQuery Dialog. Some of the google visualization initialization will be done in this page, not the page we're loading.
</div>
<button id='getIt'>Get the Graph</button>
</body>
</html>
Javascript
$('#getIt').click( function() {
$.get( "http://jsbin.com/ajerol/4",
function(data) {
var newGraph= "<div id='graphModal'>"+data+"</div>";
//clean up html
newGraph.replace('<body>','');
newGraph.replace('</body>','');
// we have the libs on this page, no need for that other cruft
newGraph.replace('<head.*head>','');
// debug:
//alert(newGraph);
// append to the current modal
$('body').append(newGraph);
// the graph page in modal
$('#graphModal').dialog({modal:true,width:300});
$('#getIt').parent().append('<button onclick="$(\'#graphModal\'\).dialog(\);">showGraph</button>');
}
);
});
// initial note
$('#modalDiv').dialog({modal:true});
// load this on the parent page, not the one we're calling
google.load("visualization", "1", {packages:["corechart"]});
Child Page
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
<div id="modal_chart" class="modal">
<!--Div that will hold the pie chart-->
<div id="chart_div" style="height: 300px; width: 300px;">
</div>
</div>
Child Javascript (on load)
drawChart();
Here's some code that might explain a little of what I meant from my comments.
Basically when the button is clicked to show the chart, that's when you'll do the loading for the pie chart.
Hope this puts you on the right track.
<button onclick="displayModal">Show Chart <\button>
<div id="modal_chart" class="modal">
<!--Div that will hold the pie chart-->
<h3 style="text-align:center;">Test</h3>
<hr>
<div id="chart_div" style="height: 500px;">
</div>
</div>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
function displayModal() {
$("#modal_chart").fadeIn(fast, function() {
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
});
}
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Options', 'Votes'],
['1', 11],
['2', 2],
['3', 2],
['4', 2],
['5', 7],
['6', 21],
]);
// Set chart options
var options = {
'backgroundColor': 'transparent',
'is3D': 'True',
'legend':'bottom',
'width':'100%',
'height':'100%',
chartArea:{left:0,top:0,width:"100%",height:"80%"}
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
I don't think there should be any explicit issues with loading the chart and then applying the modal code. Here's an example using some of the CSS you mentioned and JQueryUI alternatives http://jsbin.com/ajerol/3 (you can also actively edit the code here http://jsbin.com/ajerol/3/edit ).
<!DOCTYPE html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function displayModal() {
$("#modal_chart").show();
}
function hideModal() {
$("#modal_chart").hide();
}
function makeModal() {
$("#modal_chart").addClass('newmodal-container');
modal_container = $('.newmodal-container');
$("#modal_chart").show();
}
function jqueryModal() {
$("#modal_chart").dialog({ modal: true });
}
</script>
</head>
<body>
<button onclick="displayModal()">Show Chart </button>
<button onclick="hideModal()">Hide Chart </button>
<button onclick="makeModal()">Attach modal CSS </button>
<button onclick="jqueryModal()">jQuery modal </button>
<div id="modal_chart" class="modal">
<!--Div that will hold the pie chart-->
<h3 style="text-align:center;">Test</h3>
<hr>
<div id="chart_div" style="height: 300px; width: 300px;">
</div>
</div>
</body>
One question about your code, are you calling the following code prior to the html loading?
open_modal = $('.open-newmodal'),
close_modal = $('.close-newmodal'),
modal_container = $('.newmodal-container');
You can use google charts from remote url with modal like this:
On remote url you need to load google link in this way :
enter code here
$.getScript(
"https://www.google.com/jsapi",
function() {
google.load('visualization', '1', {'packages':['corechart'],"callback": drawChart});
});
Worked for me.