Skip to content

Added support for multi-level category axes#1012

Closed
MariusOpeepl wants to merge 12 commits intogitbrent:masterfrom
opeepl:cat-axis-multi-level
Closed

Added support for multi-level category axes#1012
MariusOpeepl wants to merge 12 commits intogitbrent:masterfrom
opeepl:cat-axis-multi-level

Conversation

@MariusOpeepl
Copy link
Contributor

Supports AREA, BAR, BAR3D and LINE type charts.

In addition to providing a two-dimentional labels array in the OptsChartData, you also need to include the catAxisMultiLevelLabels chart option.

I've modified most of the XML generation to use a 2D labels internally, but providing a 1D array in the chart data is still possible, it'll get converted automatically to 2D.
PptxGenJS_Demo_Chart_20211011133528071

You can also have more than two levels of category axes:
PptxGenJS_Demo_Chart_20211011135641044

MariusOpeepl and others added 5 commits October 11, 2021 14:18
- modified chart*.xml to support multiple cat axes
- modified table*.xml, worksheets/sheet*.xml and sharedStrings.xml inside .xlsx to support multiple cat axes
- changed chart.data.labels to be a two-dimensional array by default
- added new options prop, catAxisMultiLevelLabels
@MariusOpeepl MariusOpeepl marked this pull request as ready for review October 11, 2021 14:08
@MariusOpeepl
Copy link
Contributor Author

@gitbrent is there anything else you need with this PR?

@gitbrent gitbrent self-assigned this Nov 28, 2021
@gitbrent gitbrent added this to the 3.x.x milestone Nov 28, 2021
@gitbrent
Copy link
Owner

gitbrent commented May 2, 2022

@MariusOpeepl

  1. can you please update this with your changes to the src/*.ts files and not the dist files - those are generated by webpack and are not mergable (see other pull reqs for examples)?
  2. can you include sample code i can test with?

@MariusOpeepl
Copy link
Contributor Author

@gitbrent

  1. Sure, I'll scrap the dist files.
  2. The slides in the PR desc were made with the modules/demo_chart.mjs module, is it good enough if I include the sample code there, as a new slide?

On a side note, I'll remove the support for BAR3D, the chart itself doesn't make sense in multiple category layers.

@gitbrent gitbrent modified the milestones: 3.x.x, 3.11.0 May 4, 2022
@MariusOpeepl
Copy link
Contributor Author

I added two demo slides with the charts that are in the PR desc, and I kept the BAR3D support, maybe someone does find a practical use for it with multiple category axes.

@gitbrent
Copy link
Owner

Thanks @MariusOpeepl, great work!

Merged via Pull #1112

@gitbrent gitbrent closed this May 22, 2022
gitbrent added a commit that referenced this pull request May 22, 2022
@MariusOpeepl MariusOpeepl deleted the cat-axis-multi-level branch May 7, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants