Skip to content
This repository was archived by the owner on Jan 2, 2019. It is now read-only.

Fix smooth line chart #897

Open
wants to merge 1 commit into
base: 1.8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Classes/PHPExcel/Writer/Excel2007/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,7 @@ private function writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart

$this->writeDataLabels($objWriter, $layout);

if ($chartType === PHPExcel_Chart_DataSeries::TYPE_LINECHART) {
// Line only, Line3D can't be smoothed

$objWriter->startElement('c:smooth');
$objWriter->writeAttribute('val', (integer) $plotGroup->getSmoothLine());
$objWriter->endElement();
} elseif (($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) ||($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) {
if (($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) ||($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) {
$objWriter->startElement('c:gapWidth');
$objWriter->writeAttribute('val', 150);
$objWriter->endElement();
Expand Down Expand Up @@ -1134,6 +1128,13 @@ private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMulti
}
$objWriter->endElement();
$objWriter->endElement();
if ($groupType == PHPExcel_Chart_DataSeries::TYPE_LINECHART) {
// Line only, Line3D can't be smoothed

$objWriter->startElement('c:smooth');
$objWriter->writeAttribute('val', (integer)$plotGroup->getSmoothLine());
$objWriter->endElement();
}
}

$plotSeriesValues = $plotGroup->getPlotValuesByIndex($plotSeriesRef);
Expand Down