HEX
Server: Apache
System: Linux b:u:newjapaneti:1 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64
User: newjapaneti (381717)
PHP: 5.6.30
Disabled: apache_get_modules, apache_get_version, apache_reset_timeout, apache_getenv, apache_note, apache_setenv
Upload Files
File: /var/www/html/newjapanetiquetas.com.br/web/docs/vendor/rickshaw/examples/refresh.html
<!doctype html>
<head>

	<link type="text/css" rel="stylesheet" href="../rickshaw.css">

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

	<script src="../vendor/d3.v3.js"></script>
	<script src="../rickshaw.js"></script>
</head>
<body>

<div id="chart_container">
	<div id="chart"></div>
	<button id="refresh">refresh</button>
</div>

<script>

var dataURLs = ['data/data.json', 'data/data2.json'];

var ajaxGraph = new Rickshaw.Graph.Ajax( {

	element: document.getElementById("chart"),
	width: 400,
	height: 200,
	renderer: 'line',
	dataURL: 'data/data.json',
	series: [
		{
			name: 'New York',
			color: '#c05020',
		}, {
			name: 'London',
			color: '#30c020',
		}, {
			name: 'Tokyo',
			color: '#6060c0'
		}
	]
} );

document.querySelector('#refresh').addEventListener('click', function() {
	ajaxGraph.dataURL = ajaxGraph.dataURL === dataURLs[0] ? dataURLs[1] : dataURLs[0];
	ajaxGraph.request();
});

</script>

</body>