Skip to content

Allow series color to be defined at spec level #179

@emmacunningham

Description

@emmacunningham

Is your feature request related to a problem? Please describe.
Currently a series chart element gets its color from either our internal color palette (which is assigned by index of the series) or from customSeriesColors; both of these color specifications operate on each individual series (so if a series is defined with a splitAccessor, it will provide a color for each subseries).

We expose stroke in lineSeriesStyle, but defining a value for it does not currently affect the color of the lines of a series.

Describe the solution you'd like
We can implement the charts to support the series-level color specifications such that:

  • customSeriesColors takes precedence; if a series color is also defined, use the color defined in customSeriesColors.
  • if customSeriesColors does not have a color for a series and series color is defined, use the series color (instead of the color from the internal palette). This can have the effect that if a series has splitAccessors defined and renders distinct subseries, all of the subseries elements will have that same color.
  • if neither customSeriesColors nor a series color is defined, use the color from the internal palette.

Describe alternatives you've considered
Could also just disable the color-related props for series styling configs.

Additional context

Kibana Cross Issues
N/A

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present

Metadata

Metadata

Assignees

Labels

:chartChart element related issue:stylingStyling related issueenhancementNew feature or requestreleasedIssue released publicly

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions