You are here

private function PHPExcel_Writer_Excel2007_Chart::_writeCatAx in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php \PHPExcel_Writer_Excel2007_Chart::_writeCatAx()

Write Category Axis

Parameters

PHPExcel_Shared_XMLWriter $objWriter XML Writer:

PHPExcel_Chart_PlotArea $plotArea:

PHPExcel_Chart_Title $xAxisLabel:

string $groupType Chart type:

string $id1:

string $id2:

boolean $isMultiLevelSeries:

Throws

PHPExcel_Writer_Exception

1 call to PHPExcel_Writer_Excel2007_Chart::_writeCatAx()
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 451

Class

PHPExcel_Writer_Excel2007_Chart
PHPExcel_Writer_Excel2007_Chart

Code

private function _writeCatAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis) {
  $objWriter
    ->startElement('c:catAx');
  if ($id1 > 0) {
    $objWriter
      ->startElement('c:axId');
    $objWriter
      ->writeAttribute('val', $id1);
    $objWriter
      ->endElement();
  }
  $objWriter
    ->startElement('c:scaling');
  $objWriter
    ->startElement('c:orientation');
  $objWriter
    ->writeAttribute('val', $yAxis
    ->getAxisOptionsProperty('orientation'));
  $objWriter
    ->endElement();
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:delete');
  $objWriter
    ->writeAttribute('val', 0);
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:axPos');
  $objWriter
    ->writeAttribute('val', "b");
  $objWriter
    ->endElement();
  if (!is_null($xAxisLabel)) {
    $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 = $xAxisLabel
      ->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();
    $layout = $xAxisLabel
      ->getLayout();
    $this
      ->_writeLayout($layout, $objWriter);
    $objWriter
      ->startElement('c:overlay');
    $objWriter
      ->writeAttribute('val', 0);
    $objWriter
      ->endElement();
    $objWriter
      ->endElement();
  }
  $objWriter
    ->startElement('c:numFmt');
  $objWriter
    ->writeAttribute('formatCode', $yAxis
    ->getAxisNumberFormat());
  $objWriter
    ->writeAttribute('sourceLinked', $yAxis
    ->getAxisNumberSourceLinked());
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:majorTickMark');
  $objWriter
    ->writeAttribute('val', $yAxis
    ->getAxisOptionsProperty('major_tick_mark'));
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:minorTickMark');
  $objWriter
    ->writeAttribute('val', $yAxis
    ->getAxisOptionsProperty('minor_tick_mark'));
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:tickLblPos');
  $objWriter
    ->writeAttribute('val', $yAxis
    ->getAxisOptionsProperty('axis_labels'));
  $objWriter
    ->endElement();
  if ($id2 > 0) {
    $objWriter
      ->startElement('c:crossAx');
    $objWriter
      ->writeAttribute('val', $id2);
    $objWriter
      ->endElement();
    $objWriter
      ->startElement('c:crosses');
    $objWriter
      ->writeAttribute('val', $yAxis
      ->getAxisOptionsProperty('horizontal_crosses'));
    $objWriter
      ->endElement();
  }
  $objWriter
    ->startElement('c:auto');
  $objWriter
    ->writeAttribute('val', 1);
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:lblAlgn');
  $objWriter
    ->writeAttribute('val', "ctr");
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:lblOffset');
  $objWriter
    ->writeAttribute('val', 100);
  $objWriter
    ->endElement();
  if ($isMultiLevelSeries) {
    $objWriter
      ->startElement('c:noMultiLvlLbl');
    $objWriter
      ->writeAttribute('val', 0);
    $objWriter
      ->endElement();
  }
  $objWriter
    ->endElement();
}