Ola a todos,
Utilizo PHP, Apache para rodar minha aplicação e estou colocando um grafico, e utilizei highcharts.
Eu carrego o grafico dentro de um div atraves do metodo Load do Jquery dentro de um evento de botão sem problema
$('#grafico').click(function(){
$("#barras").load("dashboard/barras.php");
});
Só que quando vou chamar uma segunda vez, não carrega mais. alguém podeira me dá uma ajuda?
Abaixo segue o codigo:
<script src="js/highcharts/js/highcharts.js"></script>
<script src="js/highcharts/js/modules/exporting.js"></script>
<script type="text/javascript">
$(function () {
$(document).ready(function() {
var options = {
chart: {
renderTo: 'barra',
type: 'column',
width: 500
},
title: {
text: 'Metas'
},
subtitle: {
text: ''
},
xAxis: {
max: 0,
categories: ['<?=$m?>'],
title: {
text: null
}
},
yAxis: {
min: 0,
max: <?=$num_scala?>,
allowDecimals: true,
tickInterval: 100,
title: {
text: 'Quantidade',
align: 'low'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' '
},
plotOptions: {
series: {
pointWidth: 10//width of the column bars irrespective of the chart size
},
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
width: 20,
height: 20,
x: -100,
y: 70,
floating: false,
borderWidth: 1,
itemStyle: {
fontSize:'10px',
font: '8pt Trebuchet MS, Verdana, sans-serif'
},
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
shadow: true
},
credits: {
enabled: false
},
series: <?= $json_str?>
};
var chart = new Highcharts.Chart(options);
});
});
</script>
<div class="grafico" id="barra"></div>