Hi I have a highchart want to save it as server image path
<div id="container" class="container"></div>
var options = {
chart: {},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
]
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: 'column'
}]
}
var chart = Highcharts.chart('container', options)
var data = {
type: 'POST',
options: JSON.stringify(options),
filename: 'test.png',
type: 'image/png',
async: true
};
var exportUrl = 'https://export.highcharts.com/'
$.post(exportUrl, data, function (data) {
var imageUrl = exportUrl + data
var urlCreator = window.URL || window.webkitURL
document.querySelector("#image1").src = imageUrl
})
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>
<h2>
Exported image below
</h2>
<img id="image1"/>
I am able to export the image to html,but how can i save this image in a server path the exported image is displaying in an html (Image1) image control