Skip to content

Conversation

@viiccwen
Copy link

Problem Description

When users set only SeriesLegends without SeriesColors, the legend functionality would panic. This occurred because the code attempted to access the config.SeriesColors array, and if the array was empty or the index was out of bounds, it would cause an array index out of bounds error.
In the case, use default color when series colors are not provided to avoid out-of-range error.

Issues

resolves #60

Impact

  • When only legend text is set without series colors, legends will display using the default color
  • Prevents array index out of bounds panic
  • Maintains backward compatibility without affecting existing functionality

Testing

I've tested locally, added test case to verify:

  • Scenario with only legends and no colors
  • Scenario with both legends and colors

However, I didn't found the place that place the test files, I just remained it in locally : )

I already asked about solving this in #60 comments~

…olors

1. Use default color when series colors are not provided to avoid out-of-range error
2. Improve robustness for cases where only legends are specified
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16432493401

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 96.114%

Totals Coverage Status
Change from base Build 11530076975: 0.05%
Covered Lines: 371
Relevant Lines: 386

💛 - Coveralls

@viiccwen
Copy link
Author

viiccwen commented Sep 8, 2025

@guptarohit Hello, any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-sc must be specified for -sl to work

2 participants