How to get rid of numbers around the chart? PHPExcel
Is there a way to setup our chart so it will look like this ..
http://www.epicstan.com/graf.jpg ?
We can't find out how to get rid of the number around our chart.
Here is the file that is generated http://www.epicstan.com/export.xlsx and
on sheet 2 we need to change that chart look.
Here is the code ..
<?php
/* part of generater code */
/* charts */
$dataSeriesValues = array(
new \PHPExcel_Chart_DataSeriesValues('Number',
'sheet2!$I$'.(($i*5)+3).':$I$'.(($i*5)+5), NULL, 6),
);
// Build the dataseries
$series = new \PHPExcel_Chart_DataSeries(
\PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D, // plotType
NULL,
range(0, count($dataSeriesValues)-1),
NULL,
NULL,
$dataSeriesValues
);
$series->setPlotDirection(\PHPExcel_Chart_DataSeries::DIRECTION_BAR);
$layout = new \PHPExcel_Chart_Layout();
$layout->setManual3dAlign(true);
$layout->setXRotation(10);
$layout->setYRotation(20);
$layout->setRightAngleAxes(1);
$layout->setShowVal(true);
$plotarea = new \PHPExcel_Chart_PlotArea($layout, array($series));
$chart = new \PHPExcel_Chart(
'chart1',
NULL,
NULL,
$plotarea,
true,
0,
NULL,
NULL
);
$chart->setTopLeftPosition('I'.(($i*5)+2));
$chart->setBottomRightPosition('J'.(($i*5)+8));
$excel->getActiveSheet()->addChart($chart);
$excel->setActiveSheetIndex(0);
$objWriter = new \PHPExcel_Writer_Excel2007($excel);
$objWriter->setIncludeCharts(TRUE);
$file = DOWNLOAD_DIR . 'export.xlsx';
$objWriter->save($file);
Thanks Ludek
No comments:
Post a Comment