From d446e47bc618b638ddec1513e48c3fd0f01e3256 Mon Sep 17 00:00:00 2001 From: Eric Yang <59426533+hlyang397@users.noreply.github.com> Date: Fri, 8 Jan 2021 01:07:54 +0800 Subject: [PATCH] fix: set definedZoomBarData to zoom bar data (#909) Co-authored-by: carbon-bot --- packages/core/src/model-cartesian-charts.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/core/src/model-cartesian-charts.ts b/packages/core/src/model-cartesian-charts.ts index 79a4e21153..b99b8f1fd3 100644 --- a/packages/core/src/model-cartesian-charts.ts +++ b/packages/core/src/model-cartesian-charts.ts @@ -19,12 +19,20 @@ export class ChartModelCartesian extends ChartModel { Tools.getProperty( this.getOptions(), "zoomBar", - "top", + AxisPositions.TOP, "enabled" ) ) { + // get pre-defined zoom bar data + const definedZoomBarData = Tools.getProperty( + this.getOptions(), + "zoomBar", + AxisPositions.TOP, + "data" + ); // if we have zoom bar data we need to update it as well - this.setZoomBarData(); + // with pre-defined zoom bar data + this.setZoomBarData(definedZoomBarData); } }