1

I need to generate chart/graph into Excel sheet from data present into Excel sheet. I am using python in linux environment. I have gone through below question but did not find any answer.I am using python 2.7 in linux enviroment. I am flexible to use perl also if we have any solution.

use python to generate graph in excel

How to generate Excel spreadsheets with embedded graphs?

(Tried with openpyxl :Graphs in xlsx File overwrite by openpyxl)

Community
  • 1
  • 1
user765443
  • 1,856
  • 7
  • 31
  • 56
  • What is your question? – DevSolar Apr 11 '13 at 08:52
  • Need to create graph from Excel sheet data in Excel using python or perl – user765443 Apr 11 '13 at 09:18
  • What have you tried? What exactly didn't work? -- This is a Q&A site (as in "why does this function x() not return the expected value"), not a "solve my programming assignment for me" site (as in "I need this done, please post code"). – DevSolar Apr 11 '13 at 09:30
  • Ya I have tried with openpyxl and found that xlwt and openpyxl both do not support the graph creation – user765443 Apr 11 '13 at 09:35

3 Answers3

2

I have found below url which may be useful .

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

sid_com
  • 24,137
  • 26
  • 96
  • 187
user765443
  • 1,856
  • 7
  • 31
  • 56
  • I wrote that module and I am currently porting it (via Excel::Writer::XLSX) to a Python module called [XlsxWriter](https://xlsxwriter.readthedocs.org/). Charts aren't supported yet but the [work on them is about to start](https://xlsxwriter.readthedocs.org/en/latest/excel_writer_xlsx.html). Check back in about a month. – jmcnamara Apr 11 '13 at 11:39
  • Thanks a Lot for reply.But I need to implement within 2 to 3 days.Please update us if you done with this module – user765443 Apr 11 '13 at 12:12
  • If you need something that works now then look at the Perl module [Excel::Writer:XLSX](http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX/lib/Excel/Writer/XLSX/Chart.pm) Charts. They are more advanced than Spreadsheet::WriteExcel. – jmcnamara Apr 11 '13 at 13:36
1

The Python module XlsxWriter supports charts.

jmcnamara
  • 38,196
  • 6
  • 90
  • 108
0

Taken from your other question...

Here is the documentation on how to create a chart in openpyxl

The example is a little broken, compare to this instead.

values = Reference(ws, (1, 1), (1, 95))
series = Series(values, title="Sample" )
chart = LineChart()
chart.append(series)
ws.add_chart(chart)  
oden
  • 3,461
  • 1
  • 31
  • 33