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

ChartsCollection.onDeactivated event fires wrongly when shift-click a second chart - fix or document? #4370

Open
NickRedwood opened this issue Apr 16, 2024 · 7 comments
Assignees
Labels
Area: Excel Issue related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs

Comments

@NickRedwood
Copy link

Article URL
On what page did you find the problem?
https://learn.microsoft.com/en-us/javascript/api/excel/excel.chartcollection?view=excel-js-preview#excel-excel-chartcollection-ondeactivated-member

Describe the problem
You have two charts on an Excel sheet and you add onActivated and onDeactivated methods to either the individual Charts or the ChartCollection, as in the linked example. If you click one chart then onActivated fires. If you then shift-click the second chart, onDeactivated fires on the first chart, even though it is still active.

I recently realised the web version of Excel (which I rarely use) does not allow multiple selection of charts or shapes, which I guess is the source of this problem. In desktop Excel though the current behaviour is not right. If it can't be fixed, a note in the documentation could be added.

The overall context is I'm trying to create an add-in to apply bulk formatting to charts, and was trying to use events to write my own version of getActiveCharts in the absence of a built-in method. There is only the singular getActiveChart.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Apr 16, 2024
@AlexJerabek
Copy link
Collaborator

Thanks for reporting this @NickRedwood. I'm going to transfer it to the office-js repo and get a member of the Excel feature crew to take a look.

@AlexJerabek AlexJerabek transferred this issue from OfficeDev/office-js-docs-reference Apr 16, 2024
@AlexJerabek AlexJerabek added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Excel Issue related to Excel add-ins Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Apr 16, 2024
@NickRedwood
Copy link
Author

NickRedwood commented Apr 16, 2024

Thanks @AlexJerabek

@NickRedwood
Copy link
Author

NickRedwood commented Apr 17, 2024

I have found that the Excel.Shape onActivated and onDeactivated methods work correctly for multiple selection, and I think I may be able to use those for Chart, though yet to flesh that out. Unfortunately there is no onActivated and onDeactivated method on ShapeCollection. No getActiveShapes either, or onAdded, onRemoved.

@dingjin-ms
Copy link

Thank you @NickRedwood for raising the problem.

  1. For chart.unactivated/ chartCollection.unactivated event bug: I could repro it and opened an internal ticket #8920432 to track it. We will keep you updated if progress is made.
  2. For other apis you mentioned, we apologize for the inconvenience. If you would like to request the features, please post it on our developer forum, where our product managers will regularly review and prioritize the suggestions.

@NickRedwood
Copy link
Author

Thanks @dingjin-ms

@shanshanzheng-dev shanshanzheng-dev added the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Apr 24, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: no recent activity Issue or PR is stale (no recent activity) label Apr 28, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

Copy link
Contributor

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.

@shanshanzheng-dev shanshanzheng-dev removed Needs: author feedback Waiting for author (creator) of Issue to provide more info Status: no recent activity Issue or PR is stale (no recent activity) labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Excel Issue related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs
Projects
None yet
Development

No branches or pull requests

7 participants