creates excel but doesn't draw the chart, phpexcel and codeigniter -
I have a big problem, I need to create an Excel with a chart, but when executing the function, Excel creates But does not 'drag the chart.
The function is
function excel_get () {$ this-> Load-> Library ('classes / PHPExcel'); $ This- & gt; Phpexcel- & gt; GetActiveSheet () - & gt; SetTitle ('numbre de la hoya'); $ This- & gt; Phpexcel- & gt; GetActiveSheet () - & gt; FromArray (array (array ( '' 2010, 2011, 2012), array ( 'Q 1', 12, 15, 21), array ( 'Q2', 56, 73, 86), array ( 'Q3', 52 , 61, 69), array ('Q4', 30, 32, 0))); $ DataseriesLabels = array (New PHPExcel_Chart_DataSeriesValues ( 'string', 'worksheet! $ B $ 1, minus 1), New PHPExcel_Chart_DataSeriesValues (' string ',' worksheet! $ C $ 1, minus 1) , New PHPExcel_Chart_DataSeriesValues ('string', 'worksheet! $ D $ 1', NULL, 1)); $ XAxisTickValues = array (New PHPExcel_Chart_DataSeriesValues ( 'string', 'worksheet! $ A $ 2: $ A $ 5', NULL, 4)); $ DataSeriesValues = array (New PHPExcel_Chart_DataSeriesValues (number, 'Worksheet $' B $ 2: $ B $ 5, minus 4), New PHPExcel_Chart_DataSeriesValues ( 'number', 'Worksheet $ C $ 2: $ C $ 5 ', zero, 4), new PHPExcel_Chart_DataSeriesValues (' number ',' worksheet! $ D $ 2: $ D $ 5 ', NULL, 4)); $ Chain = new PHPExcel_Chart_DataSeries (PHPExcel_Chart_DataSeries :: TYPE_BARCHART, PHPExcel_Chart_DataSeries :: GROUPING_STANDARD, range (0, count ($ dataSeriesValues) -1), $ dataseriesLabels, $ xAxisTickValues, $ dataSeriesValues); $ Series- & gt; SetPlotDirection (PHPExcel_Chart_DataSeries :: DIRECTION_COL); $ Plotarea = New PHPExcel_Chart_PlotArea (NULL, array ($ series)); $ Legend = new PHPExcel_Chart_Legend (PHPExcel_Chart_Legend :: POSITION_RIGHT, NULL, incorrect); $ Title = new PHPExcel_Chart_Title ('Test column chart'); $ YAxisLabel = New PHPExcel_Chart_Title ('Value Query'); // Create chart $ chart = new PHPExcel_Chart ('Chart 1', $ title, $ legend, $ plotters, true, 0, zero, $ yAxisLabel); $ This- & gt; Phpexcel- & gt; GetActiveSheet () - & gt; AddChart ($ chart); $ Author = new PHPExcel_Writer_Excel5 ($ this- & gt; phpexcel); Header ('content-type: application / vnd.openxmlformats- officedocument.spreadsheetml.sheet'); Header ('content-type: application / vnd.ms-excel'); Header ('content-dispute: attachment; filename = "newfile.xls"'); Header ('cache-control: max-age = 0'); $ Author- & gt; SetIncludeCharts (TRUE); $ Author- & gt; Save ('php: // output'); } PD: The table is generated properly.
Please help me, regards.
chart Excel2007 Reader / OfficeOpenXML author (for .xlsx) Format files
Comments
Post a Comment