Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I generate Excel files with native Excel charts on Linux?

Is there a way to generate Excel spreadsheets with Perl on Linux so that I can open the spreadsheet on Windows and it creates native Excel graphics? I know that there are libs to draw graphics but all libs I know simply insert a picture to the Excel which looks weird when I open the spreadsheet on Windows. So I wondering is there a way to do it better? Possibly I could embed a VB script or something so that it creates a graphics automatically when I open the spreadsheet on Windows? The original spreadsheet must be generated on Linux so there are no ways to use OLE or some other Windows-only technology.


Thanks guys! Spreadsheet::WriteExcel seems to be a good solution. Did not understand at the first glance if it allows to change dimensions of data or it is hardcoded in a template file (10 points for example, no more, no less). Does anyone know?

If anyone knows another way of doing my task, please post it here. I'm interested in comparing of different solutions and select the best.

like image 450
Andrew Senin Avatar asked Nov 02 '09 11:11

Andrew Senin


People also ask

Can we create Excel file in Linux?

API to Create Excel Files on Linux - Free Download Cells for Java. It is a powerful spreadsheet manipulation API to create, update or convert Excel files. You can either download the API's JAR or install it within your Maven-based applications using the following configurations.

Can Excel generate graphical reports from data?

Select the data for which you want to create a chart. Click INSERT > Recommended Charts. On the Recommended Charts tab, scroll through the list of charts that Excel recommends for your data, and click any chart to see how your data will look.

How do I create a chart from Excel in Python?

For plotting the charts on an excel sheet, firstly, create chart object of specific chart class( i.e BarChart, LineChart etc.). After creating chart objects, insert data in it and lastly, add that chart object in the sheet object.


3 Answers

Yes, Spreadsheet::WriteExcel has a embed_chart($row, $col, $filename, $x, $y, $scale_x, $scale_y) function which lets you do this.

like image 78
Benj Avatar answered Sep 30 '22 04:09

Benj


Spreadsheet::WriteExcel allows you to insert charts from existing files (with some caveats).

See, the following sub-document on Spreadsheet::WriteExcel Charts and the examples files in the distro, such as this one.

P.S. I am the author of that module.

like image 41
jmcnamara Avatar answered Sep 30 '22 03:09

jmcnamara


Try Spreadsheet::WriteExcel.

like image 33
heferav Avatar answered Sep 30 '22 04:09

heferav