示例#1
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     $hashElements = '';
     foreach ($this->cells as $cell) {
         $hashElements .= $cell->getHashCode();
     }
     return md5($hashElements . $this->fill->getHashCode() . $this->height . __CLASS__);
 }
示例#2
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     $hashElements = '';
     foreach ($this->richTextParagraphs as $element) {
         $hashElements .= $element->getHashCode();
     }
     return md5($hashElements . $this->fill->getHashCode() . $this->borders->getHashCode() . $this->width . __CLASS__);
 }
示例#3
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     return md5((is_null($this->fill) ? 'null' : $this->fill->getHashCode()) . (is_null($this->font) ? 'null' : $this->font->getHashCode()) . var_export($this->values, true) . var_export($this, true) . __CLASS__);
 }
示例#4
0
 /**
  * @param Chart $chart
  * @param Chart\Series $series
  * @throws \Exception
  */
 private function writeSeries(Chart $chart, Chart\Series $series)
 {
     $chartType = $chart->getPlotArea()->getType();
     $numRange = count($series->getValues());
     // chart:series
     $this->xmlContent->startElement('chart:series');
     $this->xmlContent->writeAttribute('chart:values-cell-range-address', 'table-local.$' . $this->rangeCol . '$2:.$' . $this->rangeCol . '$' . ($numRange + 1));
     $this->xmlContent->writeAttribute('chart:label-cell-address', 'table-local.$' . $this->rangeCol . '$1');
     if ($chartType instanceof Area) {
         $this->xmlContent->writeAttribute('chart:class', 'chart:area');
     } elseif ($chartType instanceof AbstractTypeBar) {
         $this->xmlContent->writeAttribute('chart:class', 'chart:bar');
     } elseif ($chartType instanceof Line) {
         $this->xmlContent->writeAttribute('chart:class', 'chart:line');
     } elseif ($chartType instanceof AbstractTypePie) {
         $this->xmlContent->writeAttribute('chart:class', 'chart:circle');
     } elseif ($chartType instanceof Scatter) {
         $this->xmlContent->writeAttribute('chart:class', 'chart:scatter');
     }
     $this->xmlContent->writeAttribute('chart:style-name', 'styleSeries' . $this->numSeries);
     if ($chartType instanceof Area || $chartType instanceof AbstractTypeBar || $chartType instanceof Line || $chartType instanceof Scatter) {
         $dataPointFills = $series->getDataPointFills();
         if (empty($dataPointFills)) {
             $incRepeat = $numRange;
         } else {
             $inc = 0;
             $incRepeat = 0;
             $newFill = new Fill();
             do {
                 if ($series->getDataPointFill($inc)->getHashCode() != $newFill->getHashCode()) {
                     // chart:data-point
                     $this->xmlContent->startElement('chart:data-point');
                     $this->xmlContent->writeAttribute('chart:repeated', $incRepeat);
                     // > chart:data-point
                     $this->xmlContent->endElement();
                     $incRepeat = 0;
                     // chart:data-point
                     $this->xmlContent->startElement('chart:data-point');
                     $this->xmlContent->writeAttribute('chart:style-name', 'styleSeries' . $this->numSeries . '_' . $inc);
                     // > chart:data-point
                     $this->xmlContent->endElement();
                 }
                 $inc++;
                 $incRepeat++;
             } while ($inc < $numRange);
             $incRepeat--;
         }
         // chart:data-point
         $this->xmlContent->startElement('chart:data-point');
         $this->xmlContent->writeAttribute('chart:repeated', $incRepeat);
         // > chart:data-point
         $this->xmlContent->endElement();
     } elseif ($chartType instanceof AbstractTypePie) {
         $count = count($series->getDataPointFills());
         for ($inc = 0; $inc < $count; $inc++) {
             // chart:data-point
             $this->xmlContent->startElement('chart:data-point');
             $this->xmlContent->writeAttribute('chart:style-name', 'styleSeries' . $this->numSeries . '_' . $inc);
             // > chart:data-point
             $this->xmlContent->endElement();
         }
     }
     // > chart:series
     $this->xmlContent->endElement();
 }
示例#5
0
 /**
  * Write the gradient style
  * @param XMLWriter $objWriter
  * @param Fill $oFill
  */
 protected function writeGradientFill(XMLWriter $objWriter, Fill $oFill)
 {
     $objWriter->startElement('draw:gradient');
     $objWriter->writeAttribute('draw:name', 'gradient_' . $oFill->getHashCode());
     $objWriter->writeAttribute('draw:display-name', 'gradient_' . $oFill->getHashCode());
     $objWriter->writeAttribute('draw:style', 'linear');
     $objWriter->writeAttribute('draw:start-intensity', '100%');
     $objWriter->writeAttribute('draw:end-intensity', '100%');
     $objWriter->writeAttribute('draw:start-color', '#' . $oFill->getStartColor()->getRGB());
     $objWriter->writeAttribute('draw:end-color', '#' . $oFill->getEndColor()->getRGB());
     $objWriter->writeAttribute('draw:border', '0%');
     $objWriter->writeAttribute('draw:angle', $oFill->getRotation() - 90);
     $objWriter->endElement();
     $this->arrayGradient[] = $oFill->getHashCode();
 }
示例#6
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     return md5($this->position . $this->offsetX . $this->offsetY . $this->width . $this->height . $this->font->getHashCode() . $this->border->getHashCode() . $this->fill->getHashCode() . $this->alignment->getHashCode() . ($this->visible ? 't' : 'f') . __CLASS__);
 }