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
- Importing JSON file into Highcharts for Bar Chart Visualization
- Modifying text in resetZoomButton doesn't work - highcharts
- How to support a legacy style option (like series.color) in Highcharts CSS styled mode
- jsonp callback data in highcharts not working
- HIghcharts - chart width not the size of the parent container
- Highcharts Series - want to show/hide all EXCEPT selected series (reversal of default logic)
- How to draw Highchart points on a JPG image
- What type of date/time format is this?
- Highcharts showing nearest point causes flickering crosshair and strange order
- Why doesn't HighCharts render when I pull it in with Ajax?
- Highchart auto pageup the browser when data is updated
- Do we have undo option in high charts?
- How to dynamically populate Highcharts column chart with two series
- Highcharts navigator mouse over not working
- How to remove margin gap in area spline chart for highcharts?
- How to add font awesome icons on x-axis in highcharts
- "HighCharts not showing in IE, works well with mozilla, chrome"
- Highcharts cloud Scatter plot with data array
- Window Not Defined for Highcharts on Nuxt
- How to edit tooltip in Highcharts C# code
- Create Phantomjs export server to convert highchart to image base64 string
- Getting information from one Rails server to Another
- Highcharts Horizontal stacked bar, reduce space between bar and x-axis
- Funneling a user input back through and model to render again
- Change color of the values in heatmap or remove the values in highcharter R package
- How is the x-axis data determined in this chart
- Highcharts : How to use setData with a string obtained by ajax?
- HighCharts Boxplot side by side Xaxis
- Unknown date format in Api
- width for the Highcharts/Highstock Export