protected function writePlotArea(XMLWriter $objWriter, PlotArea $subject, Chart $chart)
{
// c:plotArea
$objWriter->startElement('c:plotArea');
// Write layout
$this->writeLayout($objWriter, $subject);
// Write chart
$chartType = $subject->getType();
if ($chartType instanceof Area) {
$this->writeTypeArea($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} elseif ($chartType instanceof Bar) {
$this->writeTypeBar($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} elseif ($chartType instanceof Bar3D) {
$this->writeTypeBar3D($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} elseif ($chartType instanceof Pie) {
$this->writeTypePie($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} elseif ($chartType instanceof Pie3D) {
$this->writeTypePie3D($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} elseif ($chartType instanceof Line) {
$this->writeTypeLine($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} elseif ($chartType instanceof Scatter) {
$this->writeTypeScatter($objWriter, $chartType, $chart->hasIncludedSpreadsheet());
} else {
throw new \Exception('The chart type provided could not be rendered.');
}
// Write X axis?
if ($chartType->hasAxisX()) {
$this->writeAxis($objWriter, $subject->getAxisX(), Chart\Axis::AXIS_X);
}
// Write Y axis?
if ($chartType->hasAxisY()) {
$this->writeAxis($objWriter, $subject->getAxisY(), Chart\Axis::AXIS_Y);
}
$objWriter->endElement();
}