phpexcel圖形圖表(一)入門

來源:互聯網
上載者:User
PHPExcel - Excel的PHP處理引擎 PHPExcel 提供了一系列的 PHP語言 類,讓你可以輕鬆地讀寫操作以下格式的檔案:.xls/.xlsx/.csv/.ods/Gnumeric/PDF/HTML...主要功能包括:設定檔案的meta資訊,多工作表,定製字型和樣式,邊框和填充,圖片,計算公式,轉換檔類型等等 之前我只是用到了匯出資料到列表格式的Excel檔案,這次需要實現的目標是:JSON->phpexcel->excel+chart(line/pie/etc...) 本系列《phpexcel圖形圖表》文章梗概如下: phpexcel圖形圖表(一)-入門----------------介紹PHPExcel類庫和畫圖的基本步驟phpexcel圖形圖表(二)-圖形----------------以最常用的line/pie/bar/radar圖形為例作圖,並對比和分析4種APIphpexcel圖形圖表(三)-進階----------------讓圖形美化,完成一些進階的效果phpexcel圖形圖表(三)-進階----------------PHPExcel能完成的圖表相關的進階功能 原創文章,轉載請註明出處:http://www.cnblogs.com/phpgcs 本篇文章梗概:1. 下載並研究PHPExcel倉庫2. PHPExcel畫圖和普通資料處理的區別3. 注意事項總結  首先最好是把PHPExcel的項目下載到本地來研究 1git clone git@github.com:PHPOffice/PHPExcel.git請先仔細閱讀README.md說明文檔,因為裡麵包含了很重要的版本資訊,尤其是讀寫Excel文檔的版本範圍資訊 1234567891011121314151617181920212223### Reading * BIFF 5-8 (.xls) Excel 95 and above * Office Open XML (.xlsx) Excel 2007 and above * SpreadsheetML (.xml) Excel 2003 * Open Document Format/OASIS (.ods) * Gnumeric * HTML * SYLK * CSV ### Writing * BIFF 8 (.xls) Excel 95 and above * Office Open XML (.xlsx) Excel 2007 and above * HTML * CSV * PDF (using either the tcPDF, DomPDF or mPDF libraries, which need to be installed separately)  ## Requirements * PHP version 5.2.0 or higher * PHP extension php_zip enabled (required if you need PHPExcel to handle .xlsx .ods or .gnumeric files) * PHP extension php_xml enabled * PHP extension php_gd2 enabled (optional, but required for exact column width autocalculation)   進入Examples檔案夾,OhMygod,可以完成這麼多的功能呀 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899001pharSimple.php01simple-download-pdf.php01simple-download-xls.php01simple-download-xlsx.php01simplePCLZip.php01simple.php02types.php02types-xls.php03formulas.php04printing.php05featuredemo.inc.php05featuredemo.php06largescale.php06largescale-with-cellcaching.php06largescale-with-cellcaching-sqlite3.php06largescale-with-cellcaching-sqlite.php06largescale-xls.php07readerPCLZip.php07reader.php08conditionalformatting2.php08conditionalformatting.php09pagebreaks.php10autofilter.php10autofilter-selection-1.php10autofilter-selection-2.php10autofilter-selection-display.php11documentsecurity.php11documentsecurity-xls.php12cellProtection.php13calculation.php14excel5.php15datavalidation.php15datavalidation-xls.php16csv.php17html.php18extendedcalculation.php19namedrange.php20readexcel5.php21pdf.php22heavilyformatted.php23sharedstyles.php24readfilter.php25inmemoryimage.php26utf8.php27imagesexcel5.php28iterator.php29advancedvaluebinder.php30template.php31docproperties_write.php31docproperties_write-xls.php32chartreadwrite.php33chartcreate-area.php33chartcreate-bar.php33chartcreate-bar-stacked.php33chartcreate-column-2.php33chartcreate-column.php33chartcreate-composite.php33chartcreate-line.php33chartcreate-multiple-charts.php33chartcreate-pie.php33chartcreate-radar.php33chartcreate-scatter.php33chartcreate-stock.php34chartupdate.php35chartrender.php36chartreadwriteHTML.php36chartreadwritePDF.php37page_layout_view.php38cloneWorksheet.php40duplicateStyle.phpExcel2003XMLReader.phpExcel2003XMLTest.xml.gitignoreGnumericReader.phpGnumericTest.gnumericimages/list.~lock.33chartcreate-line.xlsx#OOCalcReaderPCLZip.phpOOCalcReader.phpOOCalcTest.odsQuadratic2.phpQuadratic.phpQuadratic.xlsxrunall.phpSylkReader.phpSylkTest.slktemplates/XMLReader.phpXMLTest.xml  好吧,這次的任務是chart,就先從 line chart 入手,相關的檔案只有一個 ***line.php 我們先直接運行一把: 123456liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ php 33chartcreate-line.php 07:13:22 Write to Excel2007 format07:13:23 File written to 33chartcreate-line.xlsx07:13:23 Peak memory usage: 8.75 MB07:13:23 Done writing fileFile has been created in /var/www/projects/PHPExcel/Examples  

相關文章

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。