Add point size option for scatter charts

This commit is contained in:
MarkBaker 2022-05-03 08:47:34 +02:00
parent 853cc22913
commit 70f5ec60d7
4 changed files with 30 additions and 3 deletions

View File

@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
### Added
- Nothing
- Add point size option for scatter charts
### Changed

View File

@ -4957,7 +4957,7 @@ parameters:
-
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, int given\\.$#"
count: 45
count: 44
path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php
-

View File

@ -45,6 +45,13 @@ class DataSeriesValues
*/
private $pointMarker;
/**
* Series Point Size.
*
* @var int
*/
private $pointSize = 3;
/**
* Point Count (The number of datapoints in the dataseries).
*
@ -175,6 +182,26 @@ class DataSeriesValues
return $this;
}
/**
* Get Point Size.
*/
public function getPointSize(): int
{
return $this->pointSize;
}
/**
* Set Point Size.
*
* @return $this
*/
public function setPointSize(int $size = 3)
{
$this->pointSize = $size;
return $this;
}
/**
* Get Series Format Code.
*

View File

@ -1140,7 +1140,7 @@ class Chart extends WriterPart
if ($plotSeriesMarker !== 'none') {
$objWriter->startElement('c:size');
$objWriter->writeAttribute('val', 3);
$objWriter->writeAttribute('val', (string) $plotSeriesValues->getPointSize());
$objWriter->endElement();
}