From a2e87edf1d05705fb92c2571b5a71496c48d9215 Mon Sep 17 00:00:00 2001 From: "Mr.Dr.Professor Patrick" Date: Tue, 8 Nov 2022 23:52:52 +0600 Subject: [PATCH] feat: add isMobile property (#57) --- src/components/ChartKit.scss | 4 ++++ src/components/ChartKit.tsx | 4 ++-- src/types/index.ts | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/ChartKit.scss b/src/components/ChartKit.scss index 9abcc937..484bd178 100644 --- a/src/components/ChartKit.scss +++ b/src/components/ChartKit.scss @@ -1,4 +1,8 @@ .chartkit { height: 100%; width: 100%; + + &_mobile .chartkit-scrollable-node { + max-height: 3000px; + } } diff --git a/src/components/ChartKit.tsx b/src/components/ChartKit.tsx index c1be72dc..9df5bad6 100644 --- a/src/components/ChartKit.tsx +++ b/src/components/ChartKit.tsx @@ -18,7 +18,7 @@ type ChartKitComponentProps = Omit, 'on const ChartKitComponent = (props: ChartKitComponentProps) => { const widgetRef = React.useRef(); - const {instanceRef, id = getRandomCKId(), type, data, onLoad, ...restProps} = props; + const {instanceRef, id = getRandomCKId(), type, data, onLoad, isMobile, ...restProps} = props; const lang = settings.get('lang'); const plugins = settings.get('plugins'); const plugin = plugins.find((iteratedPlugin) => iteratedPlugin.type === type); @@ -46,7 +46,7 @@ const ChartKitComponent = (props: ChartKitComponentProps return ( }> -
+
= { type: T; data: ChartkitWidget[T]['data']; id?: string; + isMobile?: boolean; onLoad?: (data?: ChartKitOnLoadData) => void; onError?: ChartKitOnError; formatNumber?: ChartKitFormatNumber;