From d9aa483362e096dcf5866223599d8045de7c6f0c Mon Sep 17 00:00:00 2001 From: Emma Cunningham Date: Fri, 3 May 2019 16:46:15 -0700 Subject: [PATCH] feat(annotations): set zIndex per spec --- src/lib/series/specs.ts | 10 +++++++++- src/specs/line_annotation.tsx | 2 +- src/specs/rect_annotation.tsx | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/series/specs.ts b/src/lib/series/specs.ts index 9144ad4b1d..eab53c36bd 100644 --- a/src/lib/series/specs.ts +++ b/src/lib/series/specs.ts @@ -218,6 +218,10 @@ export type LineAnnotationSpec = BaseAnnotationSpec & { }; /** Annotation lines are hidden */ hideLines?: boolean; + /** z-index of the annotation relative to other elements in the chart + * @default 1 + */ + zIndex?: number; }; export interface RectAnnotationDatum { @@ -238,6 +242,10 @@ export type RectAnnotationSpec = BaseAnnotationSpec & { dataValues: RectAnnotationDatum[]; /** Custom annotation style */ style?: Partial; + /** z-index of the annotation relative to other elements in the chart + * @default -1 + */ + zIndex?: number; }; export interface BaseAnnotationSpec { @@ -256,7 +264,7 @@ export interface BaseAnnotationSpec { /** Toggles tooltip annotation visibility */ hideTooltips?: boolean; /** z-index of the annotation relative to other elements in the chart - * @default 0 + * Default specified per specific annotation spec. */ zIndex?: number; } diff --git a/src/specs/line_annotation.tsx b/src/specs/line_annotation.tsx index 116f1f55c1..910a7ddcb5 100644 --- a/src/specs/line_annotation.tsx +++ b/src/specs/line_annotation.tsx @@ -14,7 +14,7 @@ export class LineAnnotationSpecComponent extends PureComponent(); diff --git a/src/specs/rect_annotation.tsx b/src/specs/rect_annotation.tsx index 8c53fb65ac..c7f995d72d 100644 --- a/src/specs/rect_annotation.tsx +++ b/src/specs/rect_annotation.tsx @@ -10,7 +10,7 @@ export class RectAnnotationSpecComponent extends PureComponent = { groupId: getGroupId('__global__'), annotationType: 'rectangle', - zIndex: 0, + zIndex: -1, }; componentDidMount() {