feat: Zoned series in cartesian chart#225
Conversation
georgylobko
left a comment
There was a problem hiding this comment.
Overall looks good. Left a few comments, address at your discretion
| return (point as Point).getZone(); | ||
| } | ||
| } catch { | ||
| // no-op |
There was a problem hiding this comment.
do we want to send an ops metric in this case?
There was a problem hiding this comment.
There is no reason to report it as this is technically not a bug. The getZone should not throw an error, and this behaviour will be addressed by: highcharts/highcharts#24639
Technically, my check for series zones should already prevent the error, but I decided to keep it for extra safety for now.
| const pointZone = point && getPointZone(point); | ||
| const zoneColor = typeof pointZone?.color === "string" ? pointZone.color : undefined; | ||
| const pointColor = typeof point?.color === "string" ? point.color : undefined; | ||
| return zoneColor ?? pointColor ?? "black"; |
There was a problem hiding this comment.
I'd suggest to cover this scenario in u tests
There was a problem hiding this comment.
It is already covered here: https://github.com/cloudscape-design/chart-components/pull/225/changes#diff-fa6cfa25e156948eb146ea2f343cea682b0aad0b562ce7b07e404173b65330f1R85
There is also an existing test that validates the fallback to "black"
| if ("dashStyle" in series.options && series.options.dashStyle && series.options.dashStyle !== "Solid") { | ||
| if ( | ||
| (dashStyle && dashStyle !== "Solid") || | ||
| ("dashStyle" in series.options && series.options.dashStyle && series.options.dashStyle !== "Solid") |
There was a problem hiding this comment.
why not just
(series.options.dashStyle !== "Solid")
?
There was a problem hiding this comment.
Series options is a union type - not all variants have dashStyle, so need to check first to satisfy the compiler.
Description
This PR adds support for Highcharts zoneAxis and zones API to some of the Cartesian Chart series.
API changes:
The series zones allow to change series' appearance (colour, dash-style) at certain thresholds on x- or y axis.
Screen.Recording.2026-05-15.at.13.55.13.mov
Previously, the same feature was implemented with linked series - which was not quite correct. The linked series cause master and linked series points both appear in the tooltip on the intersection coordinate. The linked series also do not allow a transition between master and linked series to happen without a connecting data point.
Therefore, the existing linked series demo was updated:
This matches Highcharts linked series demos, where master and linked series are usually defined on the same interval. The code to align navigation between master and linked series was removed: now these series are independently navigable.
How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.