-
Notifications
You must be signed in to change notification settings - Fork 11
feat: support for overriding color for a data point using a method #902
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #902 +/- ##
==========================================
- Coverage 85.38% 85.38% -0.01%
==========================================
Files 803 803
Lines 16492 16496 +4
Branches 2067 2069 +2
==========================================
+ Hits 14082 14085 +3
- Misses 2378 2379 +1
Partials 32 32
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
context.fill(); | ||
context.stroke(); | ||
context.resetTransform(); | ||
}); | ||
} | ||
|
||
private getColorForDatum(datum: TData): string { | ||
return this.series.getColor ? this.series.getColor(datum) : this.series.color; |
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.
this can shorten with optional function access, but a broader question - wouldn't it make more sense to support specifying a color on the data object rather than a lookup function? that is: {x, y, color}
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.
it is possible, but the actual contents of the series is generic. Doing it that way would be much more intrusive and may have a broader impact across cartesians.
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.
updated to use optional function access.
Description
support for overriding color for a data point using a method
Testing
Manually tested. UTs added.
Checklist: