2013-04-10 88 views
1

我需要從Excel數據表生成Excel圖表到圖表。我在linux環境中使用python。我經歷了下面的問題,但沒有找到任何答案。我在Linux環境中使用python 2.7。如果我們有任何解決方案,我也可以靈活地使用perl。在Excel中使用(python,perl)(linux)創建圖表

use python to generate graph in excel

How to generate Excel spreadsheets with embedded graphs?

(試圖用openpyxl:Graphs in xlsx File overwrite by openpyxl

+0

你的問題是什麼? – DevSolar 2013-04-11 08:52:48

+0

需要使用python或perl在Excel中創建Excel工作表數據圖表 – user765443 2013-04-11 09:18:23

+0

您嘗試過什麼?什麼沒有工作? - 這是一個問答網站(如「爲什麼這個函數x()不會返回期望的值」),而不是「爲我解決我的編程任務」網站(如「我需要這樣做,請張貼代碼」 )。 – DevSolar 2013-04-11 09:30:20

回答

2

我已發現下面的URL可能是有用的。

https://metacpan.org/pod/Spreadsheet::WriteExcel::Chart#NAME

+0

我編寫了這個模塊,並且我正在將它移植到一個名爲[XlsxWriter]的Python模塊中((通過Excel :: Writer :: XLSX) https://xlsxwriter.readthedocs.org/)。圖表尚不支持,但[對他們的工作即將開始](https://xlsxwriter.readthedocs.org/en/latest/excel_writer_xlsx.html)。大約一個月後再回來。 – jmcnamara 2013-04-11 11:39:12

+0

非常感謝您的回覆。但我需要在2到3天內實施。如果您已完成此模塊,請更新我們。 – user765443 2013-04-11 12:12:09

+0

如果您現在需要某些功能,請查看Perl模塊[Excel :: Writer:XLSX]( http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX/lib/Excel/Writer/XLSX/Chart.pm)圖表。它們比Spreadsheet :: WriteExcel更先進。 – jmcnamara 2013-04-11 13:36:07

0

從您的其他問題採取...

Here是如何在openpyxl

的例子創建圖表文檔是有點壞了,比較這個代替。

values = Reference(ws, (1, 1), (1, 95)) 
series = Series(values, title="Sample") 
chart = LineChart() 
chart.append(series) 
ws.add_chart(chart)