score:4
here is link on highcharts documentation. thats will help u to export image and store it.
a) documentation #1
b) documentation #2
that will help u with phpexcel classs api.and finally exapmle of image paste to a sheet, using phpexcel class: one or two;
have more questions? see that links: one, two.
and official phpexcel examples: here.
good luck!
score:0
first you have to send the svgtext and the csv text ti the server via ajax. then do the following:
public jsonresult exporttoimage(string base64, string graphdata) { try {
var base64string = base64.remove(0, 1);
var rows = graphdata.split('\n');
byte[] bytes = convert.frombase64string(base64);
var path = path.combine(appdomain.currentdomain.basedirectory , "content\\images\\");
directoryinfo di = new directoryinfo(path);
fileinfo[] files = di.getfiles("*.xls")
.where(p => p.extension == ".xls").toarray();
foreach (fileinfo file in files)
try
{
file.attributes = fileattributes.normal;
system.io.file.delete(file.fullname);
}
catch { }
using (image image = image.fromstream(new memorystream(bytes)))
{
image.save(path+"output.png", imageformat.jpeg); // or png
}
var xlapp = new microsoft.office.interop.excel.application();
microsoft.office.interop.excel.workbook xlworkbook = xlapp.workbooks.add();
microsoft.office.interop.excel.worksheet xlworksheet = xlworkbook.sheets[1];
for(var y=0; y<rows.count();y++)
{
var row = rows[y];
var columvalues = row.split(',');
for (var x = 0; x < columvalues.count(); x++)
{
xlworksheet.cells[y+20, x+1] = columvalues[x];
}
}
xlworksheet.shapes.addpicture(path + "output.png", msotristate.msofalse, msotristate.msoctrue, 0, 0, -1, -1);
var filename = string.format("graphdataexport{0}.xls", datetime.now.tostring("yyyy-dd-m--hh-mm-ss"));
xlworkbook.saveas(path + filename, microsoft.office.interop.excel.xlfileformat.xlworkbooknormal);
xlworkbook.close(true);
xlapp.quit();
marshal.releasecomobject(xlapp);
return json(filename);
}
catch (exception e)
{
return json(e.message + environment.newline + e.innerexception + environment.newline + e.data + environment.newline);
}
}
now you can do a window.location to that file
Source: stackoverflow.com
Related Query
- Export HighChart as an image in excel file together with the other page contents
- How to export the whole page or html content with Highcharts not just the chart?
- How do I export the content of a page as either jpg or pdf with Highcharts and scrollable data?
- How can i export row data from highchart to excel file and not csv?
- Highchart - Export data as Excel file
- How to save export highchart image with out dialog box?
- How to automatically download png file from highchart when the page load
- Highchart datetime-XAxis export is different from the page
- Legend name and color need to be displayed in the export of highchart as image
- How to change value of highchart graph with the other value with refresh
- use highchart and highstock on the same page
- JavaScript - Export Div with SVG chart + HTML as and Image
- How to save an image of the chart on the server with highcharts?
- How can I read an Excel File with JavaScript (without ActiveXObject)
- How to export a Highchart chart to PDF thanks to a button outside the chart?
- Highchart Area Range chart with gradient that follows the line
- Highcharts export chart exportSettings with svg file
- How to Export JavaScript Chart to Excel file (HighCharts)
- Highcharts export charts as image on serverside with php
- Several Series with the same xAxis data in HighChart
- Export chart image data locally in HIghchart
- Waterfall Highchart to start some of the columns in between the series with 0 y-axis
- Highcharts: Can I export to the user an Excel or CSV of the raw data driving the chart?
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Export multiple Highchart as Zip file to my project directory
- How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page?
- HighChart Sparkline Chart with dynamic data for the table
- Highchart not displaying the pie chart with Ajax data
- Is there a way to get the mouse coordinates with respect to page on mouseOver of a point in Highcharts?
- How to put two charts on the same page with different modules?
More Query from same tag
- Highcharts value relative to itself instead of all lines
- Mean Markers in Boxplot with multiple series
- Inner area color for pie-donut highchart
- Need to remove the empty space to the left of the graph, after I moved the stocktools to the top of the graph in highstocks
- using dynamic data from highcharts in a html table
- Highcharts title alignment
- Highcharts: with multiple axes
- (how) can we create semi circle donut chart, with range labels?
- Highcharts :Cannot read property 'parentGroup' of undefined with AngularJS
- change dataLabels on highcharts based on color of bar
- Highcharts 4.0.3 stacked bar chart bug adds รข-
- Highcharts Column-chart with php and Ajax
- how to set the interval of points on Y - Axis highcharts
- Can we Extend Highstocks features to Highcharts?
- Calling javascript function from highcharts plotOptions
- x-axis tickInterval not working correctly in highstock chart
- How can I update the data in highcharts for both x axis & y axis?
- Is there a method to calculate quartiles and outliers of a boxplot(highchart) directly in JavaScript
- Align y axis tick "outside" on highstock, so they are the same as on highcharts
- using JS event function twice in shiny R to create a dropdown
- How to show the numbers on the y-axis by 1 on HighCharts?
- Spikes are not showing correctly in Highstock
- How to remove additional number appear in x-axis Highchart
- Highcharts behaviour in mobile browser (scrolling the whole graph not the specific point)
- Nested/multi-level/drill-down Pie Chart in Javascript?
- How can i call a Rest API from a Vue component?
- Highcharts how to create dot hover at end of line chart
- Highcharts don't connect points between years
- Multiple pie-charts in the same chart with HighCharts
- why foreach doesn't work inside my highchart and when i splet the array it works?