Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>Pilkada 2018 - HTML</title>
- <script type="text/javascript" src="js/jquery-1.9.1.min.js" ></script>
- <script type="text/javascript" src="js/highcharts.js" ></script>
- <script type="text/javascript" src="js/themes/gray.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- var options = {
- chart: {
- renderTo: 'container',
- defaultSeriesType: 'line',
- marginRight: 130,
- marginBottom: 25
- },
- title: {
- text: 'Project Requests',
- x: -20 //center
- },
- subtitle: {
- text: '',
- x: -20
- },
- xAxis: {
- categories: []
- },
- yAxis: {
- title: {
- text: 'Hasil suara'
- },
- plotLines: [{
- value: 0,
- width: 1,
- color: '#808080'
- }]
- },
- tooltip: {
- formatter: function() {
- return '<b>'+ this.series.name +'</b><br/>'+
- this.x +': '+ this.y;
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'top',
- x: -10,
- y: 100,
- borderWidth: 0
- },
- series: []
- }
- setInterval(function() { getData(); }, 3000);
- function getData(){
- $.getJSON("data.php", function(json) {
- options.xAxis.categories = json[0]['kecamatan'];
- options.series = json[1]['hasil'];
- chart = new Highcharts.Chart(options);
- });
- }
- });
- </script>
- </head>
- <body>
- <div id="container" style="width: 100%; height: 400px; margin: 0 auto"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement