private function PHPExcel_Writer_Excel2007_Chart::_writeValAx in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php \PHPExcel_Writer_Excel2007_Chart::_writeValAx()
Write Value Axis
Parameters
PHPExcel_Shared_XMLWriter $objWriter XML Writer:
PHPExcel_Chart_PlotArea $plotArea:
PHPExcel_Chart_Title $yAxisLabel:
string $groupType Chart type:
string $id1:
string $id2:
boolean $isMultiLevelSeries:
Throws
1 call to PHPExcel_Writer_Excel2007_Chart::_writeValAx()
- PHPExcel_Writer_Excel2007_Chart::_writePlotArea in vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel2007/ Chart.php - Write Chart Plot Area
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel2007/ Chart.php, line 573
Class
- PHPExcel_Writer_Excel2007_Chart
- PHPExcel_Writer_Excel2007_Chart
Code
private function _writeValAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines) {
$objWriter
->startElement('c:valAx');
if ($id2 > 0) {
$objWriter
->startElement('c:axId');
$objWriter
->writeAttribute('val', $id2);
$objWriter
->endElement();
}
$objWriter
->startElement('c:scaling');
$objWriter
->startElement('c:orientation');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('orientation'));
if (!is_null($xAxis
->getAxisOptionsProperty('maximum'))) {
$objWriter
->startElement('c:max');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('maximum'));
$objWriter
->endElement();
}
if (!is_null($xAxis
->getAxisOptionsProperty('minimum'))) {
$objWriter
->startElement('c:min');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('minimum'));
$objWriter
->endElement();
}
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->startElement('c:delete');
$objWriter
->writeAttribute('val', 0);
$objWriter
->endElement();
$objWriter
->startElement('c:axPos');
$objWriter
->writeAttribute('val', "l");
$objWriter
->endElement();
$objWriter
->startElement('c:majorGridlines');
$objWriter
->startElement('c:spPr');
if (!is_null($majorGridlines
->getLineColorProperty('value'))) {
$objWriter
->startElement('a:ln');
$objWriter
->writeAttribute('w', $majorGridlines
->getLineStyleProperty('width'));
$objWriter
->startElement('a:solidFill');
$objWriter
->startElement("a:{$majorGridlines->getLineColorProperty('type')}");
$objWriter
->writeAttribute('val', $majorGridlines
->getLineColorProperty('value'));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $majorGridlines
->getLineColorProperty('alpha'));
$objWriter
->endElement();
//end alpha
$objWriter
->endElement();
//end srgbClr
$objWriter
->endElement();
//end solidFill
$objWriter
->startElement('a:prstDash');
$objWriter
->writeAttribute('val', $majorGridlines
->getLineStyleProperty('dash'));
$objWriter
->endElement();
if ($majorGridlines
->getLineStyleProperty('join') == 'miter') {
$objWriter
->startElement('a:miter');
$objWriter
->writeAttribute('lim', '800000');
$objWriter
->endElement();
}
else {
$objWriter
->startElement('a:bevel');
$objWriter
->endElement();
}
if (!is_null($majorGridlines
->getLineStyleProperty(array(
'arrow',
'head',
'type',
)))) {
$objWriter
->startElement('a:headEnd');
$objWriter
->writeAttribute('type', $majorGridlines
->getLineStyleProperty(array(
'arrow',
'head',
'type',
)));
$objWriter
->writeAttribute('w', $majorGridlines
->getLineStyleArrowParameters('head', 'w'));
$objWriter
->writeAttribute('len', $majorGridlines
->getLineStyleArrowParameters('head', 'len'));
$objWriter
->endElement();
}
if (!is_null($majorGridlines
->getLineStyleProperty(array(
'arrow',
'end',
'type',
)))) {
$objWriter
->startElement('a:tailEnd');
$objWriter
->writeAttribute('type', $majorGridlines
->getLineStyleProperty(array(
'arrow',
'end',
'type',
)));
$objWriter
->writeAttribute('w', $majorGridlines
->getLineStyleArrowParameters('end', 'w'));
$objWriter
->writeAttribute('len', $majorGridlines
->getLineStyleArrowParameters('end', 'len'));
$objWriter
->endElement();
}
$objWriter
->endElement();
//end ln
}
$objWriter
->startElement('a:effectLst');
if (!is_null($majorGridlines
->getGlowSize())) {
$objWriter
->startElement('a:glow');
$objWriter
->writeAttribute('rad', $majorGridlines
->getGlowSize());
$objWriter
->startElement("a:{$majorGridlines->getGlowColor('type')}");
$objWriter
->writeAttribute('val', $majorGridlines
->getGlowColor('value'));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $majorGridlines
->getGlowColor('alpha'));
$objWriter
->endElement();
//end alpha
$objWriter
->endElement();
//end schemeClr
$objWriter
->endElement();
//end glow
}
if (!is_null($majorGridlines
->getShadowProperty('presets'))) {
$objWriter
->startElement("a:{$majorGridlines->getShadowProperty('effect')}");
if (!is_null($majorGridlines
->getShadowProperty('blur'))) {
$objWriter
->writeAttribute('blurRad', $majorGridlines
->getShadowProperty('blur'));
}
if (!is_null($majorGridlines
->getShadowProperty('distance'))) {
$objWriter
->writeAttribute('dist', $majorGridlines
->getShadowProperty('distance'));
}
if (!is_null($majorGridlines
->getShadowProperty('direction'))) {
$objWriter
->writeAttribute('dir', $majorGridlines
->getShadowProperty('direction'));
}
if (!is_null($majorGridlines
->getShadowProperty('algn'))) {
$objWriter
->writeAttribute('algn', $majorGridlines
->getShadowProperty('algn'));
}
if (!is_null($majorGridlines
->getShadowProperty(array(
'size',
'sx',
)))) {
$objWriter
->writeAttribute('sx', $majorGridlines
->getShadowProperty(array(
'size',
'sx',
)));
}
if (!is_null($majorGridlines
->getShadowProperty(array(
'size',
'sy',
)))) {
$objWriter
->writeAttribute('sy', $majorGridlines
->getShadowProperty(array(
'size',
'sy',
)));
}
if (!is_null($majorGridlines
->getShadowProperty(array(
'size',
'kx',
)))) {
$objWriter
->writeAttribute('kx', $majorGridlines
->getShadowProperty(array(
'size',
'kx',
)));
}
if (!is_null($majorGridlines
->getShadowProperty('rotWithShape'))) {
$objWriter
->writeAttribute('rotWithShape', $majorGridlines
->getShadowProperty('rotWithShape'));
}
$objWriter
->startElement("a:{$majorGridlines->getShadowProperty(array(
'color',
'type',
))}");
$objWriter
->writeAttribute('val', $majorGridlines
->getShadowProperty(array(
'color',
'value',
)));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $majorGridlines
->getShadowProperty(array(
'color',
'alpha',
)));
$objWriter
->endElement();
//end alpha
$objWriter
->endElement();
//end color:type
$objWriter
->endElement();
//end shadow
}
if (!is_null($majorGridlines
->getSoftEdgesSize())) {
$objWriter
->startElement('a:softEdge');
$objWriter
->writeAttribute('rad', $majorGridlines
->getSoftEdgesSize());
$objWriter
->endElement();
//end softEdge
}
$objWriter
->endElement();
//end effectLst
$objWriter
->endElement();
//end spPr
$objWriter
->endElement();
//end majorGridLines
if ($minorGridlines
->getObjectState()) {
$objWriter
->startElement('c:minorGridlines');
$objWriter
->startElement('c:spPr');
if (!is_null($minorGridlines
->getLineColorProperty('value'))) {
$objWriter
->startElement('a:ln');
$objWriter
->writeAttribute('w', $minorGridlines
->getLineStyleProperty('width'));
$objWriter
->startElement('a:solidFill');
$objWriter
->startElement("a:{$minorGridlines->getLineColorProperty('type')}");
$objWriter
->writeAttribute('val', $minorGridlines
->getLineColorProperty('value'));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $minorGridlines
->getLineColorProperty('alpha'));
$objWriter
->endElement();
//end alpha
$objWriter
->endElement();
//end srgbClr
$objWriter
->endElement();
//end solidFill
$objWriter
->startElement('a:prstDash');
$objWriter
->writeAttribute('val', $minorGridlines
->getLineStyleProperty('dash'));
$objWriter
->endElement();
if ($minorGridlines
->getLineStyleProperty('join') == 'miter') {
$objWriter
->startElement('a:miter');
$objWriter
->writeAttribute('lim', '800000');
$objWriter
->endElement();
}
else {
$objWriter
->startElement('a:bevel');
$objWriter
->endElement();
}
if (!is_null($minorGridlines
->getLineStyleProperty(array(
'arrow',
'head',
'type',
)))) {
$objWriter
->startElement('a:headEnd');
$objWriter
->writeAttribute('type', $minorGridlines
->getLineStyleProperty(array(
'arrow',
'head',
'type',
)));
$objWriter
->writeAttribute('w', $minorGridlines
->getLineStyleArrowParameters('head', 'w'));
$objWriter
->writeAttribute('len', $minorGridlines
->getLineStyleArrowParameters('head', 'len'));
$objWriter
->endElement();
}
if (!is_null($minorGridlines
->getLineStyleProperty(array(
'arrow',
'end',
'type',
)))) {
$objWriter
->startElement('a:tailEnd');
$objWriter
->writeAttribute('type', $minorGridlines
->getLineStyleProperty(array(
'arrow',
'end',
'type',
)));
$objWriter
->writeAttribute('w', $minorGridlines
->getLineStyleArrowParameters('end', 'w'));
$objWriter
->writeAttribute('len', $minorGridlines
->getLineStyleArrowParameters('end', 'len'));
$objWriter
->endElement();
}
$objWriter
->endElement();
//end ln
}
$objWriter
->startElement('a:effectLst');
if (!is_null($minorGridlines
->getGlowSize())) {
$objWriter
->startElement('a:glow');
$objWriter
->writeAttribute('rad', $minorGridlines
->getGlowSize());
$objWriter
->startElement("a:{$minorGridlines->getGlowColor('type')}");
$objWriter
->writeAttribute('val', $minorGridlines
->getGlowColor('value'));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $minorGridlines
->getGlowColor('alpha'));
$objWriter
->endElement();
//end alpha
$objWriter
->endElement();
//end schemeClr
$objWriter
->endElement();
//end glow
}
if (!is_null($minorGridlines
->getShadowProperty('presets'))) {
$objWriter
->startElement("a:{$minorGridlines->getShadowProperty('effect')}");
if (!is_null($minorGridlines
->getShadowProperty('blur'))) {
$objWriter
->writeAttribute('blurRad', $minorGridlines
->getShadowProperty('blur'));
}
if (!is_null($minorGridlines
->getShadowProperty('distance'))) {
$objWriter
->writeAttribute('dist', $minorGridlines
->getShadowProperty('distance'));
}
if (!is_null($minorGridlines
->getShadowProperty('direction'))) {
$objWriter
->writeAttribute('dir', $minorGridlines
->getShadowProperty('direction'));
}
if (!is_null($minorGridlines
->getShadowProperty('algn'))) {
$objWriter
->writeAttribute('algn', $minorGridlines
->getShadowProperty('algn'));
}
if (!is_null($minorGridlines
->getShadowProperty(array(
'size',
'sx',
)))) {
$objWriter
->writeAttribute('sx', $minorGridlines
->getShadowProperty(array(
'size',
'sx',
)));
}
if (!is_null($minorGridlines
->getShadowProperty(array(
'size',
'sy',
)))) {
$objWriter
->writeAttribute('sy', $minorGridlines
->getShadowProperty(array(
'size',
'sy',
)));
}
if (!is_null($minorGridlines
->getShadowProperty(array(
'size',
'kx',
)))) {
$objWriter
->writeAttribute('kx', $minorGridlines
->getShadowProperty(array(
'size',
'kx',
)));
}
if (!is_null($minorGridlines
->getShadowProperty('rotWithShape'))) {
$objWriter
->writeAttribute('rotWithShape', $minorGridlines
->getShadowProperty('rotWithShape'));
}
$objWriter
->startElement("a:{$minorGridlines->getShadowProperty(array(
'color',
'type',
))}");
$objWriter
->writeAttribute('val', $minorGridlines
->getShadowProperty(array(
'color',
'value',
)));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $minorGridlines
->getShadowProperty(array(
'color',
'alpha',
)));
$objWriter
->endElement();
//end alpha
$objWriter
->endElement();
//end color:type
$objWriter
->endElement();
//end shadow
}
if (!is_null($minorGridlines
->getSoftEdgesSize())) {
$objWriter
->startElement('a:softEdge');
$objWriter
->writeAttribute('rad', $minorGridlines
->getSoftEdgesSize());
$objWriter
->endElement();
//end softEdge
}
$objWriter
->endElement();
//end effectLst
$objWriter
->endElement();
//end spPr
$objWriter
->endElement();
//end minorGridLines
}
if (!is_null($yAxisLabel)) {
$objWriter
->startElement('c:title');
$objWriter
->startElement('c:tx');
$objWriter
->startElement('c:rich');
$objWriter
->startElement('a:bodyPr');
$objWriter
->endElement();
$objWriter
->startElement('a:lstStyle');
$objWriter
->endElement();
$objWriter
->startElement('a:p');
$objWriter
->startElement('a:r');
$caption = $yAxisLabel
->getCaption();
if (is_array($caption)) {
$caption = $caption[0];
}
$objWriter
->startElement('a:t');
// $objWriter->writeAttribute('xml:space', 'preserve');
$objWriter
->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption));
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
$layout = $yAxisLabel
->getLayout();
$this
->_writeLayout($layout, $objWriter);
}
$objWriter
->startElement('c:overlay');
$objWriter
->writeAttribute('val', 0);
$objWriter
->endElement();
$objWriter
->endElement();
}
$objWriter
->startElement('c:numFmt');
$objWriter
->writeAttribute('formatCode', $xAxis
->getAxisNumberFormat());
$objWriter
->writeAttribute('sourceLinked', $xAxis
->getAxisNumberSourceLinked());
$objWriter
->endElement();
$objWriter
->startElement('c:majorTickMark');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('major_tick_mark'));
$objWriter
->endElement();
$objWriter
->startElement('c:minorTickMark');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('minor_tick_mark'));
$objWriter
->endElement();
$objWriter
->startElement('c:tickLblPos');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('axis_labels'));
$objWriter
->endElement();
$objWriter
->startElement('c:spPr');
if (!is_null($xAxis
->getFillProperty('value'))) {
$objWriter
->startElement('a:solidFill');
$objWriter
->startElement("a:" . $xAxis
->getFillProperty('type'));
$objWriter
->writeAttribute('val', $xAxis
->getFillProperty('value'));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $xAxis
->getFillProperty('alpha'));
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
}
$objWriter
->startElement('a:ln');
$objWriter
->writeAttribute('w', $xAxis
->getLineStyleProperty('width'));
$objWriter
->writeAttribute('cap', $xAxis
->getLineStyleProperty('cap'));
$objWriter
->writeAttribute('cmpd', $xAxis
->getLineStyleProperty('compound'));
if (!is_null($xAxis
->getLineProperty('value'))) {
$objWriter
->startElement('a:solidFill');
$objWriter
->startElement("a:" . $xAxis
->getLineProperty('type'));
$objWriter
->writeAttribute('val', $xAxis
->getLineProperty('value'));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $xAxis
->getLineProperty('alpha'));
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
}
$objWriter
->startElement('a:prstDash');
$objWriter
->writeAttribute('val', $xAxis
->getLineStyleProperty('dash'));
$objWriter
->endElement();
if ($xAxis
->getLineStyleProperty('join') == 'miter') {
$objWriter
->startElement('a:miter');
$objWriter
->writeAttribute('lim', '800000');
$objWriter
->endElement();
}
else {
$objWriter
->startElement('a:bevel');
$objWriter
->endElement();
}
if (!is_null($xAxis
->getLineStyleProperty(array(
'arrow',
'head',
'type',
)))) {
$objWriter
->startElement('a:headEnd');
$objWriter
->writeAttribute('type', $xAxis
->getLineStyleProperty(array(
'arrow',
'head',
'type',
)));
$objWriter
->writeAttribute('w', $xAxis
->getLineStyleArrowWidth('head'));
$objWriter
->writeAttribute('len', $xAxis
->getLineStyleArrowLength('head'));
$objWriter
->endElement();
}
if (!is_null($xAxis
->getLineStyleProperty(array(
'arrow',
'end',
'type',
)))) {
$objWriter
->startElement('a:tailEnd');
$objWriter
->writeAttribute('type', $xAxis
->getLineStyleProperty(array(
'arrow',
'end',
'type',
)));
$objWriter
->writeAttribute('w', $xAxis
->getLineStyleArrowWidth('end'));
$objWriter
->writeAttribute('len', $xAxis
->getLineStyleArrowLength('end'));
$objWriter
->endElement();
}
$objWriter
->endElement();
$objWriter
->startElement('a:effectLst');
if (!is_null($xAxis
->getGlowProperty('size'))) {
$objWriter
->startElement('a:glow');
$objWriter
->writeAttribute('rad', $xAxis
->getGlowProperty('size'));
$objWriter
->startElement("a:{$xAxis->getGlowProperty(array(
'color',
'type',
))}");
$objWriter
->writeAttribute('val', $xAxis
->getGlowProperty(array(
'color',
'value',
)));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $xAxis
->getGlowProperty(array(
'color',
'alpha',
)));
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
}
if (!is_null($xAxis
->getShadowProperty('presets'))) {
$objWriter
->startElement("a:{$xAxis->getShadowProperty('effect')}");
if (!is_null($xAxis
->getShadowProperty('blur'))) {
$objWriter
->writeAttribute('blurRad', $xAxis
->getShadowProperty('blur'));
}
if (!is_null($xAxis
->getShadowProperty('distance'))) {
$objWriter
->writeAttribute('dist', $xAxis
->getShadowProperty('distance'));
}
if (!is_null($xAxis
->getShadowProperty('direction'))) {
$objWriter
->writeAttribute('dir', $xAxis
->getShadowProperty('direction'));
}
if (!is_null($xAxis
->getShadowProperty('algn'))) {
$objWriter
->writeAttribute('algn', $xAxis
->getShadowProperty('algn'));
}
if (!is_null($xAxis
->getShadowProperty(array(
'size',
'sx',
)))) {
$objWriter
->writeAttribute('sx', $xAxis
->getShadowProperty(array(
'size',
'sx',
)));
}
if (!is_null($xAxis
->getShadowProperty(array(
'size',
'sy',
)))) {
$objWriter
->writeAttribute('sy', $xAxis
->getShadowProperty(array(
'size',
'sy',
)));
}
if (!is_null($xAxis
->getShadowProperty(array(
'size',
'kx',
)))) {
$objWriter
->writeAttribute('kx', $xAxis
->getShadowProperty(array(
'size',
'kx',
)));
}
if (!is_null($xAxis
->getShadowProperty('rotWithShape'))) {
$objWriter
->writeAttribute('rotWithShape', $xAxis
->getShadowProperty('rotWithShape'));
}
$objWriter
->startElement("a:{$xAxis->getShadowProperty(array(
'color',
'type',
))}");
$objWriter
->writeAttribute('val', $xAxis
->getShadowProperty(array(
'color',
'value',
)));
$objWriter
->startElement('a:alpha');
$objWriter
->writeAttribute('val', $xAxis
->getShadowProperty(array(
'color',
'alpha',
)));
$objWriter
->endElement();
$objWriter
->endElement();
$objWriter
->endElement();
}
if (!is_null($xAxis
->getSoftEdgesSize())) {
$objWriter
->startElement('a:softEdge');
$objWriter
->writeAttribute('rad', $xAxis
->getSoftEdgesSize());
$objWriter
->endElement();
}
$objWriter
->endElement();
//effectList
$objWriter
->endElement();
//end spPr
if ($id1 > 0) {
$objWriter
->startElement('c:crossAx');
$objWriter
->writeAttribute('val', $id2);
$objWriter
->endElement();
if (!is_null($xAxis
->getAxisOptionsProperty('horizontal_crosses_value'))) {
$objWriter
->startElement('c:crossesAt');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('horizontal_crosses_value'));
$objWriter
->endElement();
}
else {
$objWriter
->startElement('c:crosses');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('horizontal_crosses'));
$objWriter
->endElement();
}
$objWriter
->startElement('c:crossBetween');
$objWriter
->writeAttribute('val', "midCat");
$objWriter
->endElement();
if (!is_null($xAxis
->getAxisOptionsProperty('major_unit'))) {
$objWriter
->startElement('c:majorUnit');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('major_unit'));
$objWriter
->endElement();
}
if (!is_null($xAxis
->getAxisOptionsProperty('minor_unit'))) {
$objWriter
->startElement('c:minorUnit');
$objWriter
->writeAttribute('val', $xAxis
->getAxisOptionsProperty('minor_unit'));
$objWriter
->endElement();
}
}
if ($isMultiLevelSeries) {
if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
$objWriter
->startElement('c:noMultiLvlLbl');
$objWriter
->writeAttribute('val', 0);
$objWriter
->endElement();
}
}
$objWriter
->endElement();
}