I really need your help for saving a simple image generate with google charts on my server for using it on a PDF export.
My PDF export already works but I cant put my image in it.
For the creation of my image I use it :
function drawChart() {
var dataAge = google.visualization.arrayToDataTable([ //Table data
['Tranche âge', 'Population'], //Column name
['Moins de 15 ans', <fmt:formatNumber value="${p_0015}" maxFractionDigits="0" groupingUsed="false" />],
['De 15 à 19 ans', <fmt:formatNumber value="${p_1519}" maxFractionDigits="0" groupingUsed="false" />],
]);
var optionsAge = { //Table options
title: 'Répartition de la population selon son âge',
width:600,
height:300,
};
google.visualization.events.addListener(chart, 'ready', function () {
chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
console.log(chart_div.innerHTML);
});
chart.draw(dataAge, optionsAge);
}
And for show it, I just have to use this :
<div id='chart_div'></div>
I just want to save the image who's created by that div on my server (in a temporary folder who is deleted ) for using it. I can use javascript, java, or html.
Thanks for your help :)