-
Notifications
You must be signed in to change notification settings - Fork 128
[Excel] (Chart) Add leader lines snippet #992
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new Excel chart leader lines snippet that demonstrates how to show, hide, and format leader lines for chart data labels. The sample provides a complete workflow for working with leader lines in Excel charts using Office.js APIs.
- Adds a new sample file demonstrating leader lines functionality for Excel charts
- Implements functions to enable/disable leader lines and modify their formatting
- Provides UI controls for testing all leader line operations
// Load the current leader lines setting. | ||
dataLabels.load("showLeaderLines"); | ||
await context.sync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment suggests loading the current setting, but the loaded value is never used in the function. Consider removing the load operation and comment, or clarify why the current value needs to be loaded.
// Load the current leader lines setting. | |
dataLabels.load("showLeaderLines"); | |
await context.sync(); |
Copilot uses AI. Check for mistakes.
// Load the current leader lines setting. | ||
dataLabels.load("showLeaderLines"); | ||
await context.sync(); | ||
|
||
// Enable leader lines. | ||
dataLabels.showLeaderLines = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The showLeaderLines property is loaded but never accessed before being set to true. This load operation appears unnecessary and could be removed for better performance.
// Load the current leader lines setting. | |
dataLabels.load("showLeaderLines"); | |
await context.sync(); | |
// Enable leader lines. | |
dataLabels.showLeaderLines = true; | |
// Enable leader lines. | |
dataLabels.showLeaderLines = true; | |
await context.sync(); |
Copilot uses AI. Check for mistakes.
This PR is in draft mode because the
enableLeaderLines
method isn't working properly yet -- it's adding leader lines, which shouldn't happen until theenableLeaderLines
method.