/** * 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__); }
/** * 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__); }
/** * @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 Bar3D) { $this->xmlContent->writeAttribute('chart:class', 'chart:bar'); } elseif ($chartType instanceof Line) { $this->xmlContent->writeAttribute('chart:class', 'chart:line'); } elseif ($chartType instanceof Pie3D) { $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 Bar3D || $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 Pie3D) { $count = count($series->getDataPointFills()); $inc = 0; 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(); }
/** * 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__); }
/** * 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__); }
/** * 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(); }