Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Display Options for Chart Axis and Legend #3434

Merged
merged 5 commits into from
Mar 9, 2023

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Mar 5, 2023

Fix #3414. There had been no way to color the text used for the data points on an axis. It is now supported via a new AxisText class, which derives from Properties, and has FillColor and effects (glow/shadow/softEdges) properties. The code changes in chart sample 33_Chart_create_scatter2 illustrate usage.

Similarly, following a wide-ranging discussion in #3433, there was no way to add a border to a Legend. This change allows the setting of border color and fill color, and likewise adds an AxisText object to Legend, permitting the addition of colors and effects to the Legend text.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

Why this change is needed?

Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.

Fix PHPOffice#3414. There had been no way to do this. It is now supported via a new AxisText class, which derives from Properties, and has FillColor and effects (glow/shadow/softEdges) properties. The code changes in chart sample 33_Chart_create_scatter2 illustrate usage.
oleibman added 2 commits March 5, 2023 09:30
May also get rid of Scrutinizer complaint.
Much in common with Data Point formatting.
@oleibman oleibman changed the title Allow Color and Effects on Data Points on Chart Axis More Display Options for Chart Axis and Legend Mar 7, 2023
@ByronSilvaOlvera
Copy link

I am going to try

@oleibman oleibman merged commit 2034864 into PHPOffice:master Mar 9, 2023
@ByronSilvaOlvera
Copy link

I'm testing, but I don't get the new class.

This class

$xAxisText = new AxisText();
$xAxisText->getFillColorObject()->setValue('00FF00')->setType(ChartColor::EXCEL_COLOR_TYPE_RGB);
$xAxis->setAxisText($xAxisText);

I already actulize composer update but it does not download the new

@oleibman
Copy link
Collaborator Author

oleibman commented Mar 9, 2023

@ByronSilvaOlvera you need to install from master.

composer require phpoffice/phpspreadsheet:dev-master

@oleibman oleibman deleted the issue3408 branch March 24, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Change the color of the Title and data
2 participants