You are here

private function PHPExcel_Writer_Excel2007_Chart::_writeBubbles 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::_writeBubbles()

Write Bubble Chart Details

Parameters

PHPExcel_Chart_DataSeriesValues $plotSeriesValues:

PHPExcel_Shared_XMLWriter $objWriter XML Writer:

Throws

PHPExcel_Writer_Exception

1 call to PHPExcel_Writer_Excel2007_Chart::_writeBubbles()
PHPExcel_Writer_Excel2007_Chart::_writePlotGroup in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php
Write Plot Group (series of related plots)

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php, line 1441

Class

PHPExcel_Writer_Excel2007_Chart
PHPExcel_Writer_Excel2007_Chart

Code

private function _writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet) {
  if (is_null($plotSeriesValues)) {
    return;
  }
  $objWriter
    ->startElement('c:bubbleSize');
  $objWriter
    ->startElement('c:numLit');
  $objWriter
    ->startElement('c:formatCode');
  $objWriter
    ->writeRawData('General');
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:ptCount');
  $objWriter
    ->writeAttribute('val', $plotSeriesValues
    ->getPointCount());
  $objWriter
    ->endElement();
  $dataValues = $plotSeriesValues
    ->getDataValues();
  if (!empty($dataValues)) {
    if (is_array($dataValues)) {
      foreach ($dataValues as $plotSeriesKey => $plotSeriesValue) {
        $objWriter
          ->startElement('c:pt');
        $objWriter
          ->writeAttribute('idx', $plotSeriesKey);
        $objWriter
          ->startElement('c:v');
        $objWriter
          ->writeRawData(1);
        $objWriter
          ->endElement();
        $objWriter
          ->endElement();
      }
    }
  }
  $objWriter
    ->endElement();
  $objWriter
    ->endElement();
  $objWriter
    ->startElement('c:bubble3D');
  $objWriter
    ->writeAttribute('val', 0);
  $objWriter
    ->endElement();
}