Commit Graph

9 Commits

Author SHA1 Message Date
MarkBaker 71898419ce Improve web-rendering of Chart Examples by displaying the rendered image 2023-04-12 11:26:05 +02:00
oleibman a3489b5d89 Minor Changes to 3 Tests/Samples (#3451)
No source changes. Act on some items that have come up in recent discussions.
- Sample 33_Chart_create_line creates a stacked line chart. According to @MarkBaker, the stacking is done on the wrong variable, and, even were that not the case, stacking is unusual for line charts. Since this is our primary sample showing how to create a line chart, remove the stacking. Another sample, with a more appropriate choice of chart (33_Chart_create_bar_stacked), still shows how to create a stacked chart.
- The test for reading a styled cell from Html is flawed. It sets a date format for a string date/time, but the format is applied only to numeric data, so the format, although set correctly, is ineffective. Keep the test, but add some explanation in the assertion, and add some new more effective tests, also with explanations in the assertions.
- Wrong namespace used for Writer/Xlsx/ConditionalFillTest.
2023-03-12 00:22:20 -08:00
oleibman 5d5e550342 Additional Support for Chart DataSeriesValues (#2906)
* Additional Support for Chart DataSeriesValues

Fix #2863. DataSeriesValues now extends Properties, allowing it to share code in common with Axis and Gridlines. This causes some minor breakages; in particular line width is now initialized to null instead of Excel's default value, and is specified in points, as the user would expect from Excel, rather than the value stored in Xml.

This change:
- adds support for 1 or 2 marker colors.
- adds support for `smoothLine` to DataSeriesValues.
- will determine `catAx` or `valAx` for Axis based on what is read from the Xml when available, rather than guessing based on format. (Another minor break.)
- reads `formatCode` and `sourceLinked` for Axis.
- correct 2 uses of `$plotSeriesRef` to `$plotSeriesIndex` in Writer/Xlsx/Chart.
- pushes coverage over 90% for Chart (88.70% overall).

* Update Change Log

I had updated previously but forgot to stage the member.

* Adopt Some Suggestions

Incorporate some changes suggested by @bridgeplayr.

* Use ChartColor for DSV Fill And Font Text

DataSeriesValues Fill could be a scalar or an array, so I saved it till last.

* Some Final Cleanup

No code changes.

Illustrate even more of the new features in existing sample files.

Deprecate *_ARGB in Properties/ChartColors in favor of *_RGB, because it uses only 6 hex digits. The alpha value is stored separately.
2022-06-29 17:52:09 -07:00
oleibman a8e179d5d9 Scrutinizer Complains Some Samples Class Name Conflict with Jpgraph (#2684)
Jpgraph does not use namespaces. Neither do the Samples members of this project. As a result, Scrutinizer complains about 13 cases of `use PhpOffice\PhpSpreadsheet\Chart\Legend;`, since this theoretically could cause the use of two different Legend classes in the empty namespace. It suggests using a class alias for Legend, which this PR does in every applicable case. It is a regrettable problem, but it is easy to fix.
2022-03-16 15:59:53 -07:00
Chris Wolcott d49567aad0 File containing a chart can be opened by Excel 2003/2013/2019
All chart examples passed the displayBlanksAs parameter as 0 instead of 'gap'.
I added a constants EMPTY_AS_GAP, EMPTY_AS_ZERO and EMPTY_AS_SPAN to the
DataSeries and then change all chart samples to use this new constant.

Fixes #1337
Closes #1448
2020-05-17 19:28:27 +09:00
Adrien Crivelli b0004cdabf Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
Michael Bollman 4e0344c3af Use line width for data series when rendering Xlsx
Closes #329
2018-01-22 11:50:53 +09:00
Adrien Crivelli 557e80dc03 Rename classes to keep them in their related namespaces 2017-10-29 17:39:42 +09:00
Adrien Crivelli 50a0ec58af Merge all examples together
Closes #17
2017-10-01 17:48:59 +09:00