react-native-gifted-charts 1.4.47 → 1.4.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ if (Platform.OS === 'android') {
26
26
  }
27
27
  var Animated2DWithGradient = function (props) {
28
28
  var _a, _b;
29
- var barBackgroundPattern = props.barBackgroundPattern, patternId = props.patternId, bWidth = props.barWidth, barStyle = props.barStyle, item = props.item, index = props.index, opacity = props.opacity, animationDuration = props.animationDuration, noGradient = props.noGradient, noAnimation = props.noAnimation, barMarginBottom = props.barMarginBottom, barInnerComponent = props.barInnerComponent, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle, commonStyleForBar = props.commonStyleForBar, barStyleWithBackground = props.barStyleWithBackground, yAxisOffset = props.yAxisOffset;
29
+ var barBackgroundPattern = props.barBackgroundPattern, patternId = props.patternId, bWidth = props.barWidth, barStyle = props.barStyle, item = props.item, index = props.index, opacity = props.opacity, animationDuration = props.animationDuration, noGradient = props.noGradient, noAnimation = props.noAnimation, barInnerComponent = props.barInnerComponent, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle, commonStyleForBar = props.commonStyleForBar, barStyleWithBackground = props.barStyleWithBackground, yAxisOffset = props.yAxisOffset;
30
30
  var _c = __read(useState(noAnimation ? props.height : 0.4), 2), height = _c[0], setHeight = _c[1]; // if animation fails, increase this constant value of 0.4
31
31
  var _d = __read(useState(!noAnimation), 2), initialRender = _d[0], setInitialRender = _d[1];
32
32
  var _e = __read(useState((_a = item.barWidth) !== null && _a !== void 0 ? _a : bWidth), 2), barWidth = _e[0], setBarWidth = _e[1]; // setting width in state for animation purpose
@@ -68,15 +68,15 @@ var Animated2DWithGradient = function (props) {
68
68
  bottom: 0,
69
69
  width: barWidth,
70
70
  overflow: 'hidden',
71
- height: (noAnimation
71
+ height: noAnimation
72
72
  ? Math.max(props.minHeight, Math.abs(height))
73
- : height) - (barMarginBottom || 0),
73
+ : height,
74
74
  }, children: _jsxs(View, { style: [
75
75
  {
76
76
  width: '100%',
77
- height: (noAnimation
77
+ height: noAnimation
78
78
  ? Math.max(props.minHeight, Math.abs(height))
79
- : height) - (barMarginBottom || 0),
79
+ : height,
80
80
  },
81
81
  item.barStyle || barStyle,
82
82
  ], children: [noGradient ? (_jsx(View, { style: barStyleWithBackground, children: props.cappedBars && item.value ? (_jsx(Cap, { capThicknessFromItem: item.capThickness, capThicknessFromProps: props.capThickness, capColorFromItem: item.capColor, capColorFromProps: props.capColor, capRadiusFromItem: item.capRadius, capRadiusFromProps: props.capRadius })) : null })) : (_jsx(LinearGradient, { style: commonStyleForBar, start: { x: 0, y: 0 }, end: { x: 1, y: 1 }, colors: [
@@ -13,14 +13,11 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
13
13
  import { View, TouchableOpacity, Animated, Text } from 'react-native';
14
14
  import AnimatedThreeDBar from '../Components/AnimatedThreeDBar';
15
15
  import Animated2DWithGradient from './Animated2DWithGradient';
16
- import Cap from '../Components/BarSpecificComponents/cap';
17
- import BarBackgroundPattern from '../Components/BarSpecificComponents/barBackgroundPattern';
18
- import LinearGradient from '../Components/common/LinearGradient';
19
16
  import { getPropsForAnimated2DWithGradient, AxesAndRulesDefaults, } from 'gifted-charts-core';
20
17
  import Tooltip from '../Components/BarSpecificComponents/tooltip';
21
18
  var RenderBars = function (props) {
22
19
  var _a, _b, _c, _d, _e;
23
- var item = props.item, index = props.index, containerHeight = props.containerHeight, maxValue = props.maxValue, minHeight = props.minHeight, spacing = props.spacing, propSpacing = props.propSpacing, side = props.side, data = props.data, barBorderWidth = props.barBorderWidth, barBorderColor = props.barBorderColor, isThreeD = props.isThreeD, isAnimated = props.isAnimated, rotateLabel = props.rotateLabel, appearingOpacity = props.appearingOpacity, animationDuration = props.animationDuration, autoShiftLabels = props.autoShiftLabels, label = props.label, secondaryLabel = props.secondaryLabel, labelTextStyle = props.labelTextStyle, secondaryLabelTextStyle = props.secondaryLabelTextStyle, xAxisTextNumberOfLines = props.xAxisTextNumberOfLines, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift, renderTooltip = props.renderTooltip, leftShiftForTooltip = props.leftShiftForTooltip, leftShiftForLastIndexTooltip = props.leftShiftForLastIndexTooltip, initialSpacing = props.initialSpacing, selectedIndex = props.selectedIndex, setSelectedIndex = props.setSelectedIndex, _f = props.xAxisThickness, xAxisThickness = _f === void 0 ? AxesAndRulesDefaults.xAxisThickness : _f, horizontal = props.horizontal, rtl = props.rtl, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle, pointerConfig = props.pointerConfig, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, yAxisOffset = props.yAxisOffset, barWidth = props.barWidth, _g = props.labelsDistanceFromXaxis, labelsDistanceFromXaxis = _g === void 0 ? 0 : _g, stepHeight = props.stepHeight, stepValue = props.stepValue, negativeStepHeight = props.negativeStepHeight, negativeStepValue = props.negativeStepValue, autoCenterTooltip = props.autoCenterTooltip, secondaryXAxis = props.secondaryXAxis, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue, secondaryNoOfSectionsBelowXAxis = props.secondaryNoOfSectionsBelowXAxis;
20
+ var item = props.item, index = props.index, containerHeight = props.containerHeight, maxValue = props.maxValue, minHeight = props.minHeight, spacing = props.spacing, propSpacing = props.propSpacing, side = props.side, data = props.data, barBorderWidth = props.barBorderWidth, barBorderColor = props.barBorderColor, isThreeD = props.isThreeD, isAnimated = props.isAnimated, rotateLabel = props.rotateLabel, appearingOpacity = props.appearingOpacity, animationDuration = props.animationDuration, autoShiftLabels = props.autoShiftLabels, label = props.label, secondaryLabel = props.secondaryLabel, labelTextStyle = props.labelTextStyle, secondaryLabelTextStyle = props.secondaryLabelTextStyle, xAxisTextNumberOfLines = props.xAxisTextNumberOfLines, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift, renderTooltip = props.renderTooltip, leftShiftForTooltip = props.leftShiftForTooltip, leftShiftForLastIndexTooltip = props.leftShiftForLastIndexTooltip, initialSpacing = props.initialSpacing, selectedIndex = props.selectedIndex, setSelectedIndex = props.setSelectedIndex, _f = props.xAxisThickness, xAxisThickness = _f === void 0 ? AxesAndRulesDefaults.xAxisThickness : _f, horizontal = props.horizontal, rtl = props.rtl, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle, pointerConfig = props.pointerConfig, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, yAxisOffset = props.yAxisOffset, barWidth = props.barWidth, _g = props.labelsDistanceFromXaxis, labelsDistanceFromXaxis = _g === void 0 ? 0 : _g, stepHeight = props.stepHeight, stepValue = props.stepValue, negativeStepHeight = props.negativeStepHeight, negativeStepValue = props.negativeStepValue, autoCenterTooltip = props.autoCenterTooltip, secondaryXAxis = props.secondaryXAxis, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue, secondaryNoOfSectionsBelowXAxis = props.secondaryNoOfSectionsBelowXAxis, _h = props.barMarginBottom, barMarginBottom = _h === void 0 ? 0 : _h;
24
21
  var heightFactor = item.isSecondary
25
22
  ? item.value < 0
26
23
  ? (secondaryNegativeStepHeight !== null && secondaryNegativeStepHeight !== void 0 ? secondaryNegativeStepHeight : secondaryStepHeight) /
@@ -30,14 +27,11 @@ var RenderBars = function (props) {
30
27
  ? negativeStepHeight / negativeStepValue
31
28
  : stepHeight / stepValue;
32
29
  var barHeight = Math.max(minHeight, Math.abs(item.value) * heightFactor - xAxisThickness);
33
- var _h = getPropsForAnimated2DWithGradient(__assign(__assign({}, props), { barHeight: barHeight })), commonStyleForBar = _h.commonStyleForBar, barStyleWithBackground = _h.barStyleWithBackground, commonPropsFor2dAnd3dBars = _h.commonPropsFor2dAnd3dBars, isFocused = _h.isFocused, focusedBarConfig = _h.focusedBarConfig, localFrontColor = _h.localFrontColor;
30
+ var _j = getPropsForAnimated2DWithGradient(__assign(__assign({}, props), { barHeight: barHeight })), commonStyleForBar = _j.commonStyleForBar, barStyleWithBackground = _j.barStyleWithBackground, commonPropsFor2dAnd3dBars = _j.commonPropsFor2dAnd3dBars, isFocused = _j.isFocused, focusedBarConfig = _j.focusedBarConfig, localFrontColor = _j.localFrontColor;
34
31
  var itemOrPropsBarInnerComponent = (_a = item.barInnerComponent) !== null && _a !== void 0 ? _a : props.barInnerComponent;
35
32
  var localBarInnerComponent = isFocused
36
33
  ? ((_b = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.barInnerComponent) !== null && _b !== void 0 ? _b : itemOrPropsBarInnerComponent)
37
34
  : itemOrPropsBarInnerComponent;
38
- var barMarginBottom = item.barMarginBottom === 0
39
- ? 0
40
- : item.barMarginBottom || props.barMarginBottom || 0;
41
35
  var renderLabel = function (top, label, labelTextStyle, value) {
42
36
  var _a, _b;
43
37
  return (_jsx(View, { style: [
@@ -156,31 +150,74 @@ var RenderBars = function (props) {
156
150
  leftSpacing +=
157
151
  ((_c = data[i].spacing) !== null && _c !== void 0 ? _c : propSpacing) + (data[i].barWidth || barWidth);
158
152
  }
159
- var static2DWithGradient = function (item) {
160
- var _a, _b;
161
- var localGradientColor = item.gradientColor || props.gradientColor || 'white';
162
- return (_jsxs(_Fragment, { children: [_jsx(LinearGradient, { style: commonStyleForBar, start: { x: 0, y: 0 }, end: { x: 0, y: 1 }, colors: [
163
- isFocused
164
- ? ((_a = focusedBarConfig === null || focusedBarConfig === void 0 ? void 0 : focusedBarConfig.gradientColor) !== null && _a !== void 0 ? _a : localGradientColor)
165
- : localGradientColor,
166
- localFrontColor,
167
- ], children: props.cappedBars && item.value ? (_jsx(Cap, { capThicknessFromItem: item.capThickness, capThicknessFromProps: props.capThickness, capColorFromItem: item.capColor, capColorFromProps: props.capColor, capRadiusFromItem: item.capRadius, capRadiusFromProps: props.capRadius })) : null }), (item.barBackgroundPattern || props.barBackgroundPattern) && (_jsx(BarBackgroundPattern, { barBackgroundPatternFromItem: item.barBackgroundPattern, barBackgroundPatternFromProps: props.barBackgroundPattern, patternIdFromItem: item.patternId, patternIdFromProps: props.patternId })), (item.topLabelComponent || showValuesAsTopLabel) && (_jsx(View, { style: [
168
- {
169
- position: 'absolute',
170
- top: (item.barWidth || barWidth) * -1,
171
- height: item.barWidth || barWidth,
172
- width: item.barWidth || barWidth,
173
- justifyContent: (horizontal && !intactTopLabel) || item.value < 0
174
- ? 'center'
175
- : 'flex-end',
176
- alignItems: 'center',
177
- },
178
- item.value < 0 && { transform: [{ rotate: '180deg' }] },
179
- horizontal &&
180
- !intactTopLabel && { transform: [{ rotate: '270deg' }] },
181
- topLabelContainerStyle !== null && topLabelContainerStyle !== void 0 ? topLabelContainerStyle : item.topLabelContainerStyle,
182
- ], children: showValuesAsTopLabel ? (_jsx(Text, { style: topLabelTextStyle, children: item.value + yAxisOffset })) : ((_b = item.topLabelComponent) === null || _b === void 0 ? void 0 : _b.call(item)) })), localBarInnerComponent ? (_jsx(View, { style: { height: '100%', width: '100%' }, children: localBarInnerComponent(item, index) })) : null] }));
183
- };
153
+ // const static2DWithGradient = (item: barDataItem) => {
154
+ // const localGradientColor =
155
+ // item.gradientColor || props.gradientColor || 'white';
156
+ // return (
157
+ // <>
158
+ // <LinearGradient
159
+ // style={commonStyleForBar}
160
+ // start={{x: 0, y: 0}}
161
+ // end={{x: 0, y: 1}}
162
+ // colors={[
163
+ // isFocused
164
+ // ? (focusedBarConfig?.gradientColor ?? localGradientColor)
165
+ // : localGradientColor,
166
+ // localFrontColor,
167
+ // ]}>
168
+ // {props.cappedBars && item.value ? (
169
+ // <Cap
170
+ // capThicknessFromItem={item.capThickness}
171
+ // capThicknessFromProps={props.capThickness}
172
+ // capColorFromItem={item.capColor}
173
+ // capColorFromProps={props.capColor}
174
+ // capRadiusFromItem={item.capRadius}
175
+ // capRadiusFromProps={props.capRadius}
176
+ // />
177
+ // ) : null}
178
+ // </LinearGradient>
179
+ // {(item.barBackgroundPattern || props.barBackgroundPattern) && (
180
+ // <BarBackgroundPattern
181
+ // barBackgroundPatternFromItem={item.barBackgroundPattern}
182
+ // barBackgroundPatternFromProps={props.barBackgroundPattern}
183
+ // patternIdFromItem={item.patternId}
184
+ // patternIdFromProps={props.patternId}
185
+ // />
186
+ // )}
187
+ // {(item.topLabelComponent || showValuesAsTopLabel) && (
188
+ // <View
189
+ // style={[
190
+ // {
191
+ // position: 'absolute',
192
+ // top: (item.barWidth || barWidth) * -1,
193
+ // height: item.barWidth || barWidth,
194
+ // width: item.barWidth || barWidth,
195
+ // justifyContent:
196
+ // (horizontal && !intactTopLabel) || item.value < 0
197
+ // ? 'center'
198
+ // : 'flex-end',
199
+ // alignItems: 'center',
200
+ // },
201
+ // item.value < 0 && {transform: [{rotate: '180deg'}]},
202
+ // horizontal &&
203
+ // !intactTopLabel && {transform: [{rotate: '270deg'}]},
204
+ // topLabelContainerStyle ?? item.topLabelContainerStyle,
205
+ // ]}>
206
+ // {showValuesAsTopLabel ? (
207
+ // <Text style={topLabelTextStyle}>{item.value + yAxisOffset}</Text>
208
+ // ) : (
209
+ // item.topLabelComponent?.()
210
+ // )}
211
+ // </View>
212
+ // )}
213
+ // {localBarInnerComponent ? (
214
+ // <View style={{height: '100%', width: '100%'}}>
215
+ // {localBarInnerComponent(item, index)}
216
+ // </View>
217
+ // ) : null}
218
+ // </>
219
+ // );
220
+ // };
184
221
  var barWrapperStyle = [
185
222
  {
186
223
  // overflow: 'visible',
@@ -216,7 +253,7 @@ var RenderBars = function (props) {
216
253
  backgroundColor: props.xAxisIndicesColor,
217
254
  } })), isBarBelowXaxisAndInvisible ? null : isThreeD ? (_jsx(AnimatedThreeDBar, __assign({}, commonPropsFor2dAnd3dBars, { sideWidth: item.sideWidth ||
218
255
  props.sideWidth ||
219
- (item.barWidth || barWidth) / 2, side: side || 'left', sideColor: item.sideColor || props.sideColor || '', topColor: item.topColor || props.topColor || '', horizontal: horizontal, isAnimated: isAnimated, animationDuration: animationDuration || 800, selectedIndex: selectedIndex }))) : item.showGradient || props.showGradient ? (isAnimated ? (animated2DWithGradient(false, false)) : (static2DWithGradient(item))) : isAnimated ? (animated2DWithGradient(true, false)) : (animated2DWithGradient(true, true)), isAnimated
256
+ (item.barWidth || barWidth) / 2, side: side || 'left', sideColor: item.sideColor || props.sideColor || '', topColor: item.topColor || props.topColor || '', horizontal: horizontal, isAnimated: isAnimated, animationDuration: animationDuration || 800, selectedIndex: selectedIndex }))) : item.showGradient || props.showGradient ? (isAnimated ? (animated2DWithGradient(false, false)) : (animated2DWithGradient(false, true))) : isAnimated ? (animated2DWithGradient(true, false)) : (animated2DWithGradient(true, true)), isAnimated
220
257
  ? renderAnimatedLabel(false, label, labelTextStyle, item.value)
221
258
  : renderLabel(false, label, labelTextStyle, item.value), secondaryXAxis
222
259
  ? isAnimated
@@ -22,7 +22,7 @@ if (Platform.OS === 'android') {
22
22
  }
23
23
  var RenderStackBars = function (props) {
24
24
  var _a;
25
- var barBackgroundPattern = props.barBackgroundPattern, patternId = props.patternId, stackData = props.stackData, item = props.item, index = props.index, containerHeight = props.containerHeight, spacing = props.spacing, rotateLabel = props.rotateLabel, label = props.label, labelTextStyle = props.labelTextStyle, xAxisTextNumberOfLines = props.xAxisTextNumberOfLines, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift, renderTooltip = props.renderTooltip, selectedIndex = props.selectedIndex, setSelectedIndex = props.setSelectedIndex, activeOpacity = props.activeOpacity, _b = props.animationDuration, animationDuration = _b === void 0 ? BarDefaults.animationDuration : _b, barBorderWidth = props.barBorderWidth, barBorderColor = props.barBorderColor, stackBorderRadius = props.stackBorderRadius, stackBorderTopLeftRadius = props.stackBorderTopLeftRadius, stackBorderTopRightRadius = props.stackBorderTopRightRadius, stackBorderBottomLeftRadius = props.stackBorderBottomLeftRadius, stackBorderBottomRightRadius = props.stackBorderBottomRightRadius, showValuesAsTopLabel = props.showValuesAsTopLabel, _c = props.autoShiftLabelsForNegativeStacks, autoShiftLabelsForNegativeStacks = _c === void 0 ? true : _c, _d = props.labelsDistanceFromXaxis, labelsDistanceFromXaxis = _d === void 0 ? 0 : _d, horizontal = props.horizontal, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue;
25
+ var barBackgroundPattern = props.barBackgroundPattern, patternId = props.patternId, stackData = props.stackData, item = props.item, index = props.index, containerHeight = props.containerHeight, spacing = props.spacing, rotateLabel = props.rotateLabel, label = props.label, labelTextStyle = props.labelTextStyle, xAxisTextNumberOfLines = props.xAxisTextNumberOfLines, xAxisLabelsVerticalShift = props.xAxisLabelsVerticalShift, renderTooltip = props.renderTooltip, selectedIndex = props.selectedIndex, setSelectedIndex = props.setSelectedIndex, activeOpacity = props.activeOpacity, _b = props.animationDuration, animationDuration = _b === void 0 ? BarDefaults.animationDuration : _b, barBorderWidth = props.barBorderWidth, barBorderColor = props.barBorderColor, stackBorderRadius = props.stackBorderRadius, stackBorderTopLeftRadius = props.stackBorderTopLeftRadius, stackBorderTopRightRadius = props.stackBorderTopRightRadius, stackBorderBottomLeftRadius = props.stackBorderBottomLeftRadius, stackBorderBottomRightRadius = props.stackBorderBottomRightRadius, showValuesAsTopLabel = props.showValuesAsTopLabel, _c = props.autoShiftLabelsForNegativeStacks, autoShiftLabelsForNegativeStacks = _c === void 0 ? true : _c, _d = props.labelsDistanceFromXaxis, labelsDistanceFromXaxis = _d === void 0 ? 0 : _d, horizontal = props.horizontal, secondaryStepHeight = props.secondaryStepHeight, secondaryStepValue = props.secondaryStepValue, secondaryNegativeStepHeight = props.secondaryNegativeStepHeight, secondaryNegativeStepValue = props.secondaryNegativeStepValue, barMarginBottom = props.barMarginBottom;
26
26
  var _e = useRenderStackBars(__assign(__assign({}, props), { secondaryStepHeight: secondaryStepHeight, secondaryStepValue: secondaryStepValue, secondaryNegativeStepHeight: secondaryNegativeStepHeight, secondaryNegativeStepValue: secondaryNegativeStepValue })), containsNegativeValue = _e.containsNegativeValue, noAnimation = _e.noAnimation, localBarInnerComponent = _e.localBarInnerComponent, borderRadius = _e.borderRadius, borderTopLeftRadius = _e.borderTopLeftRadius, borderTopRightRadius = _e.borderTopRightRadius, borderBottomLeftRadius = _e.borderBottomLeftRadius, borderBottomRightRadius = _e.borderBottomRightRadius, disablePress = _e.disablePress, totalHeight = _e.totalHeight, height = _e.height, setHeight = _e.setHeight, getBarHeight = _e.getBarHeight, getPosition = _e.getPosition, lowestBarPosition = _e.lowestBarPosition, getStackBorderRadii = _e.getStackBorderRadii, tooltipProps = _e.tooltipProps;
27
27
  var renderLabel = function (label, labelTextStyle) {
28
28
  return (_jsx(View, { style: [
@@ -35,8 +35,10 @@ var RenderStackBars = function (props) {
35
35
  spacing / 2,
36
36
  position: 'absolute',
37
37
  bottom: autoShiftLabelsForNegativeStacks
38
- ? -6 - xAxisTextNumberOfLines * 18 + lowestBarPosition
39
- : -labelsDistanceFromXaxis,
38
+ ? containsNegativeValue
39
+ ? -0
40
+ : -6 - xAxisTextNumberOfLines * 18
41
+ : -labelsDistanceFromXaxis - 6 - xAxisTextNumberOfLines * 18,
40
42
  },
41
43
  rotateLabel
42
44
  ? horizontal
@@ -69,6 +71,7 @@ var RenderStackBars = function (props) {
69
71
  };
70
72
  var static2DSimple = function () {
71
73
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
74
+ var remainingBarMarginBottom = barMarginBottom;
72
75
  return (_jsxs(_Fragment, { children: [_jsxs(TouchableOpacity, { disabled: disablePress, activeOpacity: activeOpacity, onPress: function () {
73
76
  setSelectedIndex(index);
74
77
  if (item.onPress) {
@@ -101,11 +104,18 @@ var RenderStackBars = function (props) {
101
104
  borderBottomLeftRadius: (_f = (_e = borderBottomLeftRadius !== null && borderBottomLeftRadius !== void 0 ? borderBottomLeftRadius : borderRadius) !== null && _e !== void 0 ? _e : stackBorderBottomLeftRadius) !== null && _f !== void 0 ? _f : stackBorderRadius,
102
105
  borderBottomRightRadius: (_h = (_g = borderBottomRightRadius !== null && borderBottomRightRadius !== void 0 ? borderBottomRightRadius : borderRadius) !== null && _g !== void 0 ? _g : stackBorderBottomRightRadius) !== null && _h !== void 0 ? _h : stackBorderRadius,
103
106
  overflow: lowestBarPosition ? 'visible' : 'hidden',
107
+ // bottom: barMarginBottom
104
108
  },
105
109
  ], children: [item.stacks.map(function (stackItem, index) {
110
+ var _a;
106
111
  var borderRadii = getStackBorderRadii(item, index);
107
- var barHeight = getBarHeight(stackItem.value, stackItem.marginBottom);
108
- return (_jsxs(TouchableOpacity, { onPress: stackItem.onPress, activeOpacity: activeOpacity, disabled: disablePress || !stackItem.onPress, style: __assign({ position: 'absolute', bottom: getPosition(index) + (stackItem.marginBottom || 0), width: '100%', height: barHeight, backgroundColor: stackItem.color || item.color || props.color || 'black', borderWidth: barBorderWidth !== null && barBorderWidth !== void 0 ? barBorderWidth : 0, borderColor: barBorderColor }, borderRadii), children: [stackItem.showGradient ||
112
+ // compute marginBottom here
113
+ var barHeight = getBarHeight(stackItem.value, 0);
114
+ var marginBottom = Math.max((_a = stackItem.marginBottom) !== null && _a !== void 0 ? _a : 0, remainingBarMarginBottom);
115
+ var deductedMargin = Math.min(barHeight, marginBottom);
116
+ remainingBarMarginBottom = Math.max(0, remainingBarMarginBottom - deductedMargin);
117
+ barHeight -= deductedMargin;
118
+ return (_jsxs(TouchableOpacity, { onPress: stackItem.onPress, activeOpacity: activeOpacity, disabled: disablePress || !stackItem.onPress, style: __assign({ position: 'absolute', bottom: getPosition(index, barHeight) + deductedMargin, width: '100%', height: barHeight, backgroundColor: stackItem.color || item.color || props.color || 'black', borderWidth: barBorderWidth !== null && barBorderWidth !== void 0 ? barBorderWidth : 0, borderColor: barBorderColor }, borderRadii), children: [stackItem.showGradient ||
109
119
  item.showGradient ||
110
120
  props.showGradient ? (_jsx(LinearGradient, { style: __assign({ position: 'absolute', width: '100%', height: '100%' }, borderRadii), start: { x: 0, y: 0 }, end: { x: 0, y: 1 }, colors: [
111
121
  stackItem.gradientColor ||
@@ -230,7 +230,7 @@ export var BarChart = function (props) {
230
230
  else {
231
231
  return data.map(function (item, index) {
232
232
  var _a;
233
- return (_jsx(RenderBars, __assign({ data: data, side: side, minHeight: (_a = props.minHeight) !== null && _a !== void 0 ? _a : (isAnimated && !isThreeD ? 0.1 : 0), sideWidth: props.sideWidth, labelWidth: labelWidth, isThreeD: isThreeD, isAnimated: isAnimated, animationDuration: animationDuration, animatedHeight: animatedHeight, appearingOpacity: appearingOpacity, roundedTop: props.roundedTop, roundedBottom: props.roundedBottom, frontColor: props.frontColor, sideColor: props.sideColor, topColor: props.topColor, cappedBars: props.cappedBars, capThickness: props.capThickness, capColor: props.capColor, capRadius: props.capRadius, autoShiftLabels: autoShiftLabels, barMarginBottom: props.barMarginBottom, barStyle: props.barStyle }, getPropsCommonForBarAndStack(item, index)), index));
233
+ return (_jsx(RenderBars, __assign({ data: data, side: side, minHeight: (_a = props.minHeight) !== null && _a !== void 0 ? _a : (isAnimated && !isThreeD ? 0.1 : 0), sideWidth: props.sideWidth, labelWidth: labelWidth, isThreeD: isThreeD, isAnimated: isAnimated, animationDuration: animationDuration, animatedHeight: animatedHeight, appearingOpacity: appearingOpacity, roundedTop: props.roundedTop, roundedBottom: props.roundedBottom, frontColor: props.frontColor, sideColor: props.sideColor, topColor: props.topColor, cappedBars: props.cappedBars, capThickness: props.capThickness, capColor: props.capColor, capRadius: props.capRadius, autoShiftLabels: autoShiftLabels, barStyle: props.barStyle }, getPropsCommonForBarAndStack(item, index)), index));
234
234
  });
235
235
  }
236
236
  };
@@ -29,16 +29,17 @@ import Rule from '../lineSvg';
29
29
  import { styles } from '../../LineChart/styles';
30
30
  import { getHorizSectionVals, yAxisSides, chartTypes, } from 'gifted-charts-core';
31
31
  export var renderHorizSections = function (props) {
32
- var _a, _b, _c, _d;
33
- var chartType = props.chartType, width = props.width, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, totalWidth = props.totalWidth, endSpacing = props.endSpacing, yAxisSide = props.yAxisSide, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, yAxisLabelWidth = props.yAxisLabelWidth, yAxisLabelContainerStyle = props.yAxisLabelContainerStyle, yAxisThickness = props.yAxisThickness, yAxisColor = props.yAxisColor, xAxisThickness = props.xAxisThickness, xAxisColor = props.xAxisColor, xAxisLength = props.xAxisLength, xAxisType = props.xAxisType, dashWidth = props.dashWidth, dashGap = props.dashGap, backgroundColor = props.backgroundColor, hideRules = props.hideRules, rulesLength = props.rulesLength, rulesType = props.rulesType, rulesThickness = props.rulesThickness, rulesColor = props.rulesColor, rulesConfigArray = props.rulesConfigArray, spacing = props.spacing, showYAxisIndices = props.showYAxisIndices, yAxisIndicesHeight = props.yAxisIndicesHeight, yAxisIndicesWidth = props.yAxisIndicesWidth, yAxisIndicesColor = props.yAxisIndicesColor, hideOrigin = props.hideOrigin, hideYAxisText = props.hideYAxisText, yAxisTextNumberOfLines = props.yAxisTextNumberOfLines, yAxisTextStyle = props.yAxisTextStyle, rotateYAxisTexts = props.rotateYAxisTexts, rtl = props.rtl, containerHeight = props.containerHeight, maxValue = props.maxValue, yAxisOffset = props.yAxisOffset, horizontal = props.horizontal, yAxisAtTop = props.yAxisAtTop, secondaryYAxis = props.secondaryYAxis, onlyReferenceLines = props.onlyReferenceLines, renderReferenceLines = props.renderReferenceLines, secondaryXAxis = props.secondaryXAxis;
34
- var _e = getHorizSectionVals(props), secondaryYAxisConfig = _e.secondaryYAxisConfig, horizSections = _e.horizSections, yAxisExtraHeightAtTop = _e.yAxisExtraHeightAtTop, secondaryHorizSections = _e.secondaryHorizSections, showReferenceLine1 = _e.showReferenceLine1, referenceLine1Config = _e.referenceLine1Config, referenceLine1Position = _e.referenceLine1Position, showReferenceLine2 = _e.showReferenceLine2, referenceLine2Config = _e.referenceLine2Config, referenceLine2Position = _e.referenceLine2Position, showReferenceLine3 = _e.showReferenceLine3, referenceLine3Config = _e.referenceLine3Config, referenceLine3Position = _e.referenceLine3Position, horizSectionsBelow = _e.horizSectionsBelow, secondaryHorizSectionsBelow = _e.secondaryHorizSectionsBelow, getLabelTexts = _e.getLabelTexts, getLabelTextsForSecondaryYAxis = _e.getLabelTextsForSecondaryYAxis;
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
33
+ var chartType = props.chartType, width = props.width, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, totalWidth = props.totalWidth, endSpacing = props.endSpacing, yAxisSide = props.yAxisSide, horizontalRulesStyle = props.horizontalRulesStyle, noOfSections = props.noOfSections, sectionColors = props.sectionColors, stepHeight = props.stepHeight, negativeStepHeight = props.negativeStepHeight, yAxisLabelWidth = props.yAxisLabelWidth, yAxisLabelContainerStyle = props.yAxisLabelContainerStyle, yAxisThickness = props.yAxisThickness, yAxisColor = props.yAxisColor, xAxisThickness = props.xAxisThickness, xAxisColor = props.xAxisColor, xAxisLength = props.xAxisLength, xAxisType = props.xAxisType, dashWidth = props.dashWidth, dashGap = props.dashGap, backgroundColor = props.backgroundColor, hideRules = props.hideRules, rulesLength = props.rulesLength, rulesType = props.rulesType, rulesThickness = props.rulesThickness, rulesColor = props.rulesColor, rulesConfigArray = props.rulesConfigArray, spacing = props.spacing, showYAxisIndices = props.showYAxisIndices, yAxisIndicesHeight = props.yAxisIndicesHeight, yAxisIndicesWidth = props.yAxisIndicesWidth, yAxisIndicesColor = props.yAxisIndicesColor, hideOrigin = props.hideOrigin, hideYAxisText = props.hideYAxisText, yAxisTextNumberOfLines = props.yAxisTextNumberOfLines, yAxisTextStyle = props.yAxisTextStyle, rotateYAxisTexts = props.rotateYAxisTexts, rtl = props.rtl, containerHeight = props.containerHeight, maxValue = props.maxValue, yAxisOffset = props.yAxisOffset, horizontal = props.horizontal, yAxisAtTop = props.yAxisAtTop, secondaryYAxis = props.secondaryYAxis, onlyReferenceLines = props.onlyReferenceLines, renderReferenceLines = props.renderReferenceLines, secondaryXAxis = props.secondaryXAxis, customBackground = props.customBackground;
34
+ var _k = getHorizSectionVals(props), secondaryYAxisConfig = _k.secondaryYAxisConfig, horizSections = _k.horizSections, yAxisExtraHeightAtTop = _k.yAxisExtraHeightAtTop, secondaryHorizSections = _k.secondaryHorizSections, showReferenceLine1 = _k.showReferenceLine1, referenceLine1Config = _k.referenceLine1Config, referenceLine1Position = _k.referenceLine1Position, showReferenceLine2 = _k.showReferenceLine2, referenceLine2Config = _k.referenceLine2Config, referenceLine2Position = _k.referenceLine2Position, showReferenceLine3 = _k.showReferenceLine3, referenceLine3Config = _k.referenceLine3Config, referenceLine3Position = _k.referenceLine3Position, horizSectionsBelow = _k.horizSectionsBelow, secondaryHorizSectionsBelow = _k.secondaryHorizSectionsBelow, getLabelTexts = _k.getLabelTexts, getLabelTextsForSecondaryYAxis = _k.getLabelTextsForSecondaryYAxis;
35
35
  var secondaryYAxisExtraHeightAtBottom = 10;
36
36
  var negativeSectionsCountDiffPrimaryVsSecondary = secondaryHorizSectionsBelow.length - horizSectionsBelow.length;
37
37
  var isLineChart = chartType === chartTypes.LINE;
38
38
  var isLineBiColor = chartType === chartTypes.LINE_BI_COLOR;
39
39
  var renderAxesAndRules = function (index) {
40
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
40
+ var _a, _b, _c, _d, _e, _f, _g, _h;
41
41
  var invertedIndex = horizSections.length - index - 1;
42
+ var rulesConfigArrayLocal = rulesConfigArray[invertedIndex - 1];
42
43
  return (_jsxs(View, { style: [
43
44
  index === noOfSections
44
45
  ? styles.lastLeftPart
@@ -63,12 +64,12 @@ export var renderHorizSections = function (props) {
63
64
  dashGap: dashGap,
64
65
  type: xAxisType,
65
66
  } })) : hideRules ? null : (_jsx(Rule, { config: {
66
- thickness: (_c = (_b = rulesConfigArray[invertedIndex]) === null || _b === void 0 ? void 0 : _b.rulesThickness) !== null && _c !== void 0 ? _c : rulesThickness,
67
- color: (_e = (_d = rulesConfigArray[invertedIndex]) === null || _d === void 0 ? void 0 : _d.rulesColor) !== null && _e !== void 0 ? _e : rulesColor,
68
- width: (_h = (_g = (_f = rulesConfigArray[invertedIndex]) === null || _f === void 0 ? void 0 : _f.rulesLength) !== null && _g !== void 0 ? _g : rulesLength) !== null && _h !== void 0 ? _h : (props.width || totalWidth - spacing) + endSpacing,
69
- dashWidth: (_k = (_j = rulesConfigArray[invertedIndex]) === null || _j === void 0 ? void 0 : _j.dashWidth) !== null && _k !== void 0 ? _k : dashWidth,
70
- dashGap: (_m = (_l = rulesConfigArray[invertedIndex]) === null || _l === void 0 ? void 0 : _l.dashGap) !== null && _m !== void 0 ? _m : dashGap,
71
- type: (_p = (_o = rulesConfigArray[invertedIndex]) === null || _o === void 0 ? void 0 : _o.rulesType) !== null && _p !== void 0 ? _p : rulesType,
67
+ thickness: (_b = rulesConfigArrayLocal === null || rulesConfigArrayLocal === void 0 ? void 0 : rulesConfigArrayLocal.rulesThickness) !== null && _b !== void 0 ? _b : rulesThickness,
68
+ color: (_c = rulesConfigArrayLocal === null || rulesConfigArrayLocal === void 0 ? void 0 : rulesConfigArrayLocal.rulesColor) !== null && _c !== void 0 ? _c : rulesColor,
69
+ width: (_e = (_d = rulesConfigArrayLocal === null || rulesConfigArrayLocal === void 0 ? void 0 : rulesConfigArrayLocal.rulesLength) !== null && _d !== void 0 ? _d : rulesLength) !== null && _e !== void 0 ? _e : (props.width || totalWidth - spacing) + endSpacing,
70
+ dashWidth: (_f = rulesConfigArrayLocal === null || rulesConfigArrayLocal === void 0 ? void 0 : rulesConfigArrayLocal.dashWidth) !== null && _f !== void 0 ? _f : dashWidth,
71
+ dashGap: (_g = rulesConfigArrayLocal === null || rulesConfigArrayLocal === void 0 ? void 0 : rulesConfigArrayLocal.dashGap) !== null && _g !== void 0 ? _g : dashGap,
72
+ type: (_h = rulesConfigArrayLocal === null || rulesConfigArrayLocal === void 0 ? void 0 : rulesConfigArrayLocal.rulesType) !== null && _h !== void 0 ? _h : rulesType,
72
73
  } })), showYAxisIndices && index !== noOfSections ? (_jsx(View, { style: {
73
74
  position: 'absolute',
74
75
  height: yAxisIndicesHeight,
@@ -255,7 +256,19 @@ export var renderHorizSections = function (props) {
255
256
  }, children: _jsx(View, { style: { width: (width !== null && width !== void 0 ? width : totalWidth) + endSpacing }, children: referenceLines() }) })) : (_jsxs(View, { pointerEvents: "none", style: {
256
257
  flexDirection: 'row',
257
258
  marginTop: stepHeight / -2,
258
- }, children: [_jsxs(View, { style: { width: (width !== null && width !== void 0 ? width : totalWidth) + endSpacing }, children: [yAxisExtraHeightAtTop ? renderExtraHeightOfYAxisAtTop() : null, horizSections.map(function (sectionItems, index) {
259
+ }, children: [_jsxs(View, { style: { width: (width !== null && width !== void 0 ? width : totalWidth) + endSpacing }, children: [customBackground ? (_jsx(View, { style: {
260
+ position: 'absolute',
261
+ backgroundColor: customBackground.color,
262
+ width: (_a = customBackground.width) !== null && _a !== void 0 ? _a : (width !== null && width !== void 0 ? width : totalWidth) +
263
+ endSpacing -
264
+ 9 +
265
+ ((_b = customBackground.widthAdjustment) !== null && _b !== void 0 ? _b : 0),
266
+ height: (_c = customBackground.height) !== null && _c !== void 0 ? _c : '100%',
267
+ left: yAxisLabelWidth + ((_d = customBackground.horizontalShift) !== null && _d !== void 0 ? _d : 0),
268
+ top: (_e = customBackground.verticalShift) !== null && _e !== void 0 ? _e : 0,
269
+ }, children: customBackground.component
270
+ ? customBackground.component()
271
+ : null })) : null, yAxisExtraHeightAtTop ? renderExtraHeightOfYAxisAtTop() : null, horizSections.map(function (sectionItems, index) {
259
272
  return (_jsxs(View, { style: [
260
273
  styles.horizBar,
261
274
  {
@@ -388,12 +401,12 @@ export var renderHorizSections = function (props) {
388
401
  /************************* Render the secondary Y Axis below origin *********************/
389
402
  /***********************************************************************************************/
390
403
  secondaryYAxis && secondaryYAxisConfig.noOfSectionsBelowXAxis ? (_jsx(View, { style: {
391
- width: (_a = secondaryYAxisConfig.yAxisLabelWidth) !== null && _a !== void 0 ? _a : yAxisLabelWidth,
404
+ width: (_f = secondaryYAxisConfig.yAxisLabelWidth) !== null && _f !== void 0 ? _f : yAxisLabelWidth,
392
405
  left: (width ? yAxisLabelWidth : yAxisLabelWidth - spacing) -
393
- ((_b = secondaryYAxisConfig.yAxisLabelWidth) !== null && _b !== void 0 ? _b : yAxisLabelWidth),
406
+ ((_g = secondaryYAxisConfig.yAxisLabelWidth) !== null && _g !== void 0 ? _g : yAxisLabelWidth),
394
407
  borderColor: secondaryYAxisConfig.yAxisColor,
395
408
  borderLeftWidth: secondaryYAxisConfig.yAxisThickness,
396
- height: ((_d = (_c = secondaryYAxisConfig.negativeStepHeight) !== null && _c !== void 0 ? _c : secondaryYAxisConfig.stepHeight) !== null && _d !== void 0 ? _d : stepHeight) *
409
+ height: ((_j = (_h = secondaryYAxisConfig.negativeStepHeight) !== null && _h !== void 0 ? _h : secondaryYAxisConfig.stepHeight) !== null && _j !== void 0 ? _j : stepHeight) *
397
410
  secondaryHorizSectionsBelow.length +
398
411
  secondaryYAxisExtraHeightAtBottom,
399
412
  bottom: -containerHeight - stepHeight / 2 - yAxisExtraHeightAtTop,
@@ -51,7 +51,7 @@ var RenderLineInBarChart = function (props) {
51
51
  width: animatedWidth,
52
52
  zIndex: lineBehindBars ? -1 : 100000,
53
53
  // backgroundColor: 'wheat',
54
- }, children: _jsxs(Svg, { children: [_jsx(Path, { d: points, fill: "none", stroke: lineConfig.color, strokeWidth: lineConfig.thickness }), renderSpecificVerticalLines(specificVerticalLinesProps), !lineConfig.hideDataPoints
54
+ }, children: _jsxs(Svg, { children: [_jsx(Path, { d: points, fill: "none", stroke: lineConfig.color, strokeWidth: lineConfig.thickness, strokeDasharray: lineConfig.strokeDashArray }), renderSpecificVerticalLines(specificVerticalLinesProps), !lineConfig.hideDataPoints
55
55
  ? renderDataPoints(dataPointsProps)
56
56
  : renderSpecificDataPoints(specificDataPointsProps), lineConfig.showArrow && (_jsx(Path, { d: arrowPoints, fill: (_a = lineConfig.arrowConfig) === null || _a === void 0 ? void 0 : _a.fillColor, stroke: (_b = lineConfig.arrowConfig) === null || _b === void 0 ? void 0 : _b.strokeColor, strokeWidth: (_c = lineConfig.arrowConfig) === null || _c === void 0 ? void 0 : _c.strokeWidth }))] }) }));
57
57
  };
@@ -65,7 +65,7 @@ var RenderLineInBarChart = function (props) {
65
65
  width: totalWidth,
66
66
  zIndex: lineBehindBars ? -1 : 100000,
67
67
  // backgroundColor: 'rgba(200,150,150,0.1)'
68
- }, children: _jsxs(Svg, { children: [_jsx(Path, { d: points, fill: "none", stroke: lineConfig.color, strokeWidth: lineConfig.thickness }), renderSpecificVerticalLines(specificVerticalLinesProps), !lineConfig.hideDataPoints
68
+ }, children: _jsxs(Svg, { children: [_jsx(Path, { d: points, fill: "none", stroke: lineConfig.color, strokeWidth: lineConfig.thickness, strokeDasharray: lineConfig.strokeDashArray }), renderSpecificVerticalLines(specificVerticalLinesProps), !lineConfig.hideDataPoints
69
69
  ? renderDataPoints(dataPointsProps)
70
70
  : renderSpecificDataPoints(specificDataPointsProps), lineConfig.showArrow && (_jsx(Path, { d: arrowPoints, fill: (_a = lineConfig.arrowConfig) === null || _a === void 0 ? void 0 : _a.fillColor, stroke: (_b = lineConfig.arrowConfig) === null || _b === void 0 ? void 0 : _b.strokeColor, strokeWidth: (_c = lineConfig.arrowConfig) === null || _c === void 0 ? void 0 : _c.strokeWidth }))] }) }));
71
71
  };
@@ -26,7 +26,7 @@ var RenderVerticalLines = function (props) {
26
26
  : 0;
27
27
  return (_jsx(View, { style: {
28
28
  position: 'absolute',
29
- height: extendedContainerHeight,
29
+ height: containerHeightIncludingBelowXAxis,
30
30
  bottom: 60 + xAxisLabelsVerticalShift, //stepHeight * -0.5 + xAxisThickness,
31
31
  left: 0,
32
32
  width: totalWidth,
@@ -89,7 +89,7 @@ var RenderVerticalLines = function (props) {
89
89
  : index * spacing + (initialSpacing - 2));
90
90
  return (_jsx(Line, { x1: x, y1: extendedContainerHeight -
91
91
  getHeightOfVerticalLine(index) +
92
- heightAdjustmentDueToStrokeLinecap, x2: x, y2: extendedContainerHeight - heightAdjustmentDueToStrokeLinecap, stroke: verticalLinesColor || 'lightgray', strokeWidth: verticalLinesThickness || 2, strokeDasharray: verticalLinesStrokeDashArray !== null && verticalLinesStrokeDashArray !== void 0 ? verticalLinesStrokeDashArray : '', strokeLinecap: verticalLinesStrokeLinecap }, index));
92
+ heightAdjustmentDueToStrokeLinecap, x2: x, y2: containerHeightIncludingBelowXAxis - heightAdjustmentDueToStrokeLinecap, stroke: verticalLinesColor || 'lightgray', strokeWidth: verticalLinesThickness || 2, strokeDasharray: verticalLinesStrokeDashArray !== null && verticalLinesStrokeDashArray !== void 0 ? verticalLinesStrokeDashArray : '', strokeLinecap: verticalLinesStrokeLinecap }, index));
93
93
  }) }) }));
94
94
  };
95
95
  export default RenderVerticalLines;
@@ -32,9 +32,7 @@ var Tooltip = function (props) {
32
32
  if (!autoCenterTooltip)
33
33
  return;
34
34
  var width = event.nativeEvent.layout.width;
35
- var shift = (width - barWidth) / 2;
36
- if (shift > 0)
37
- setLeftShiftTooltipForCentering(shift);
35
+ setLeftShiftTooltipForCentering((width - barWidth) / 2);
38
36
  }, children: renderTooltip === null || renderTooltip === void 0 ? void 0 : renderTooltip(item, index) }));
39
37
  };
40
38
  export default Tooltip;
@@ -35,18 +35,18 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
35
  return to.concat(ar || Array.prototype.slice.call(from));
36
36
  };
37
37
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
38
- import { Fragment, useCallback, useEffect, useMemo, useRef } from 'react';
38
+ import { Fragment, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
39
39
  import { View, Animated, Easing, Text, Dimensions, I18nManager, } from 'react-native';
40
40
  import { styles } from './styles';
41
41
  import { screenWidth, usePrevious } from '../utils';
42
- import Svg, { Path, LinearGradient, Stop, Circle, Rect, Text as CanvasText, Line, ClipPath, Use, } from 'react-native-svg';
42
+ import Svg, { Path, LinearGradient, Stop, Circle, Rect, Text as CanvasText, Line, ClipPath, Use, ForeignObject, } from 'react-native-svg';
43
43
  import { getSegmentedPathObjects, getRegionPathObjects, RANGE_ENTER, RANGE_EXIT, SEGMENT_END, SEGMENT_START, STOP, useLineChart, adjustToOffset, LineDefaults, pointsWithPaddedRepititions, } from 'gifted-charts-core';
44
44
  import BarAndLineChartsWrapper from '../Components/BarAndLineChartsWrapper';
45
45
  import { StripAndLabel } from '../Components/common/StripAndLabel';
46
46
  import { Pointer } from '../Components/common/Pointer';
47
47
  var AnimatedPath = Animated.createAnimatedComponent(Path);
48
48
  export var LineChart = function (props) {
49
- var _a, _b;
49
+ var _a, _b, _c;
50
50
  var scrollRef = (_a = props.scrollRef) !== null && _a !== void 0 ? _a : useRef(null);
51
51
  var opacityValue = useMemo(function () { return new Animated.Value(0); }, []);
52
52
  var heightValue = useMemo(function () { return new Animated.Value(0); }, []);
@@ -55,7 +55,9 @@ export var LineChart = function (props) {
55
55
  var widthValue3 = useMemo(function () { return new Animated.Value(0); }, []);
56
56
  var widthValue4 = useMemo(function () { return new Animated.Value(0); }, []);
57
57
  var widthValue5 = useMemo(function () { return new Animated.Value(0); }, []);
58
- var _c = useLineChart(__assign(__assign({}, props), { parentWidth: (_b = props.parentWidth) !== null && _b !== void 0 ? _b : screenWidth })), curveType = _c.curveType, scrollX = _c.scrollX, setScrollX = _c.setScrollX, arrow1Points = _c.arrow1Points, arrow2Points = _c.arrow2Points, arrow3Points = _c.arrow3Points, arrow4Points = _c.arrow4Points, arrow5Points = _c.arrow5Points, secondaryArrowPoints = _c.secondaryArrowPoints, pointerIndex = _c.pointerIndex, setPointerIndex = _c.setPointerIndex, pointerX = _c.pointerX, setPointerX = _c.setPointerX, pointerY = _c.pointerY, setPointerY = _c.setPointerY, pointerItem = _c.pointerItem, setPointerItem = _c.setPointerItem, pointerY2 = _c.pointerY2, setPointerY2 = _c.setPointerY2, pointerItem2 = _c.pointerItem2, setPointerItem2 = _c.setPointerItem2, pointerY3 = _c.pointerY3, setPointerY3 = _c.setPointerY3, pointerItem3 = _c.pointerItem3, setPointerItem3 = _c.setPointerItem3, pointerY4 = _c.pointerY4, setPointerY4 = _c.setPointerY4, pointerItem4 = _c.pointerItem4, setPointerItem4 = _c.setPointerItem4, pointerY5 = _c.pointerY5, setPointerY5 = _c.setPointerY5, pointerYsForDataSet = _c.pointerYsForDataSet, setPointerYsForDataSet = _c.setPointerYsForDataSet, pointerItem5 = _c.pointerItem5, setPointerItem5 = _c.setPointerItem5, secondaryPointerY = _c.secondaryPointerY, setSecondaryPointerY = _c.setSecondaryPointerY, secondaryPointerItem = _c.secondaryPointerItem, setSecondaryPointerItem = _c.setSecondaryPointerItem, pointerItemsForSet = _c.pointerItemsForSet, setPointerItemsForSet = _c.setPointerItemsForSet, secondaryPointerItemsForSet = _c.secondaryPointerItemsForSet, setSecondaryPointerItemsForSet = _c.setSecondaryPointerItemsForSet, responderStartTime = _c.responderStartTime, setResponderStartTime = _c.setResponderStartTime, setResponderActive = _c.setResponderActive, points = _c.points, points2 = _c.points2, points3 = _c.points3, points4 = _c.points4, points5 = _c.points5, secondaryPoints = _c.secondaryPoints, fillPoints = _c.fillPoints, fillPoints2 = _c.fillPoints2, fillPoints3 = _c.fillPoints3, fillPoints4 = _c.fillPoints4, fillPoints5 = _c.fillPoints5, secondaryFillPoints = _c.secondaryFillPoints, pointsFromSet = _c.pointsFromSet, fillPointsFromSet = _c.fillPointsFromSet, arrowPointsFromSet = _c.arrowPointsFromSet, selectedIndex = _c.selectedIndex, setSelectedIndex = _c.setSelectedIndex, containerHeight = _c.containerHeight, data = _c.data, data2 = _c.data2, data3 = _c.data3, data4 = _c.data4, data5 = _c.data5, secondaryData = _c.secondaryData, dataSet = _c.dataSet, data0 = _c.data0, labelsExtraHeight = _c.labelsExtraHeight, animationDuration = _c.animationDuration, onDataChangeAnimationDuration = _c.onDataChangeAnimationDuration, animateTogether = _c.animateTogether, animateOnDataChange = _c.animateOnDataChange, startIndex1 = _c.startIndex1, startIndex2 = _c.startIndex2, endIndex1 = _c.endIndex1, endIndex2 = _c.endIndex2, startIndex3 = _c.startIndex3, endIndex3 = _c.endIndex3, startIndex4 = _c.startIndex4, endIndex4 = _c.endIndex4, startIndex5 = _c.startIndex5, endIndex5 = _c.endIndex5, initialSpacing = _c.initialSpacing, thickness = _c.thickness, yAxisLabelWidth = _c.yAxisLabelWidth, spacing = _c.spacing, xAxisThickness = _c.xAxisThickness, dataPointsHeight1 = _c.dataPointsHeight1, dataPointsWidth1 = _c.dataPointsWidth1, dataPointsRadius1 = _c.dataPointsRadius1, dataPointsColor1 = _c.dataPointsColor1, dataPointsShape1 = _c.dataPointsShape1, dataPointsHeight2 = _c.dataPointsHeight2, dataPointsWidth2 = _c.dataPointsWidth2, dataPointsRadius2 = _c.dataPointsRadius2, dataPointsColor2 = _c.dataPointsColor2, dataPointsShape2 = _c.dataPointsShape2, dataPointsHeight3 = _c.dataPointsHeight3, dataPointsWidth3 = _c.dataPointsWidth3, dataPointsRadius3 = _c.dataPointsRadius3, dataPointsColor3 = _c.dataPointsColor3, dataPointsShape3 = _c.dataPointsShape3, dataPointsHeight4 = _c.dataPointsHeight4, dataPointsWidth4 = _c.dataPointsWidth4, dataPointsRadius4 = _c.dataPointsRadius4, dataPointsColor4 = _c.dataPointsColor4, dataPointsShape4 = _c.dataPointsShape4, dataPointsHeight5 = _c.dataPointsHeight5, dataPointsWidth5 = _c.dataPointsWidth5, dataPointsRadius5 = _c.dataPointsRadius5, dataPointsColor5 = _c.dataPointsColor5, dataPointsShape5 = _c.dataPointsShape5, getIsNthAreaChart = _c.getIsNthAreaChart, textFontSize1 = _c.textFontSize1, textFontSize2 = _c.textFontSize2, textFontSize3 = _c.textFontSize3, textFontSize4 = _c.textFontSize4, textFontSize5 = _c.textFontSize5, textColor1 = _c.textColor1, textColor2 = _c.textColor2, textColor3 = _c.textColor3, textColor4 = _c.textColor4, textColor5 = _c.textColor5, totalWidth = _c.totalWidth, maxValue = _c.maxValue, overflowTop = _c.overflowTop, extendedContainerHeight = _c.extendedContainerHeight, getX = _c.getX, getY = _c.getY, getSecondaryY = _c.getSecondaryY, secondaryMaxValue = _c.secondaryMaxValue, showValuesAsDataPointsText = _c.showValuesAsDataPointsText, thickness1 = _c.thickness1, thickness2 = _c.thickness2, thickness3 = _c.thickness3, thickness4 = _c.thickness4, thickness5 = _c.thickness5, zIndex1 = _c.zIndex1, zIndex2 = _c.zIndex2, zIndex3 = _c.zIndex3, zIndex4 = _c.zIndex4, zIndex5 = _c.zIndex5, strokeDashArray1 = _c.strokeDashArray1, strokeDashArray2 = _c.strokeDashArray2, strokeDashArray3 = _c.strokeDashArray3, strokeDashArray4 = _c.strokeDashArray4, strokeDashArray5 = _c.strokeDashArray5, rotateLabel = _c.rotateLabel, isAnimated = _c.isAnimated, hideDataPoints1 = _c.hideDataPoints1, hideDataPoints2 = _c.hideDataPoints2, hideDataPoints3 = _c.hideDataPoints3, hideDataPoints4 = _c.hideDataPoints4, hideDataPoints5 = _c.hideDataPoints5, color1 = _c.color1, color2 = _c.color2, color3 = _c.color3, color4 = _c.color4, color5 = _c.color5, startFillColor1 = _c.startFillColor1, endFillColor1 = _c.endFillColor1, startOpacity1 = _c.startOpacity1, endOpacity1 = _c.endOpacity1, startFillColor2 = _c.startFillColor2, endFillColor2 = _c.endFillColor2, startOpacity2 = _c.startOpacity2, endOpacity2 = _c.endOpacity2, startFillColor3 = _c.startFillColor3, endFillColor3 = _c.endFillColor3, startOpacity3 = _c.startOpacity3, endOpacity3 = _c.endOpacity3, startFillColor4 = _c.startFillColor4, endFillColor4 = _c.endFillColor4, startOpacity4 = _c.startOpacity4, endOpacity4 = _c.endOpacity4, startFillColor5 = _c.startFillColor5, endFillColor5 = _c.endFillColor5, startOpacity5 = _c.startOpacity5, endOpacity5 = _c.endOpacity5, arrowStrokeWidth1 = _c.arrowStrokeWidth1, arrowStrokeColor1 = _c.arrowStrokeColor1, arrowFillColor1 = _c.arrowFillColor1, arrowStrokeWidth2 = _c.arrowStrokeWidth2, arrowStrokeColor2 = _c.arrowStrokeColor2, arrowFillColor2 = _c.arrowFillColor2, arrowStrokeWidth3 = _c.arrowStrokeWidth3, arrowStrokeColor3 = _c.arrowStrokeColor3, arrowFillColor3 = _c.arrowFillColor3, arrowStrokeWidth4 = _c.arrowStrokeWidth4, arrowStrokeColor4 = _c.arrowStrokeColor4, arrowFillColor4 = _c.arrowFillColor4, arrowStrokeWidth5 = _c.arrowStrokeWidth5, arrowStrokeColor5 = _c.arrowStrokeColor5, arrowFillColor5 = _c.arrowFillColor5, arrowStrokeWidthsFromSet = _c.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _c.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _c.arrowFillColorsFromSet, secondaryLineConfig = _c.secondaryLineConfig, gradientDirection = _c.gradientDirection, stepHeight = _c.stepHeight, noOfSectionsBelowXAxis = _c.noOfSectionsBelowXAxis, xAxisTextNumberOfLines = _c.xAxisTextNumberOfLines, xAxisLabelsVerticalShift = _c.xAxisLabelsVerticalShift, pointerConfig = _c.pointerConfig, pointerHeight = _c.pointerHeight, pointerWidth = _c.pointerWidth, pointerRadius = _c.pointerRadius, pointerColor = _c.pointerColor, pointerComponent = _c.pointerComponent, showPointerStrip = _c.showPointerStrip, pointerStripHeight = _c.pointerStripHeight, pointerStripWidth = _c.pointerStripWidth, pointerStripColor = _c.pointerStripColor, pointerStripUptoDataPoint = _c.pointerStripUptoDataPoint, pointerLabelComponent = _c.pointerLabelComponent, stripOverPointer = _c.stripOverPointer, shiftPointerLabelX = _c.shiftPointerLabelX, shiftPointerLabelY = _c.shiftPointerLabelY, pointerLabelWidth = _c.pointerLabelWidth, pointerLabelHeight = _c.pointerLabelHeight, autoAdjustPointerLabelPosition = _c.autoAdjustPointerLabelPosition, pointerVanishDelay = _c.pointerVanishDelay, activatePointersOnLongPress = _c.activatePointersOnLongPress, activatePointersDelay = _c.activatePointersDelay, persistPointer = _c.persistPointer, hidePointers = _c.hidePointers, hidePointer1 = _c.hidePointer1, hidePointer2 = _c.hidePointer2, hidePointer3 = _c.hidePointer3, hidePointer4 = _c.hidePointer4, hidePointer5 = _c.hidePointer5, cumulativeSpacing1 = _c.cumulativeSpacing1, cumulativeSpacing2 = _c.cumulativeSpacing2, cumulativeSpacing3 = _c.cumulativeSpacing3, cumulativeSpacing4 = _c.cumulativeSpacing4, cumulativeSpacing5 = _c.cumulativeSpacing5, cumulativeSpacingSecondary = _c.cumulativeSpacingSecondary, cumulativeSpacingForSet = _c.cumulativeSpacingForSet, hideSecondaryPointer = _c.hideSecondaryPointer, hidePointerDataPointForMissingValues = _c.hidePointerDataPointForMissingValues, pointerEvents = _c.pointerEvents, focusEnabled = _c.focusEnabled, showDataPointOnFocus = _c.showDataPointOnFocus, showStripOnFocus = _c.showStripOnFocus, stripOverDataPoints = _c.stripOverDataPoints, showTextOnFocus = _c.showTextOnFocus, showDataPointLabelOnFocus = _c.showDataPointLabelOnFocus, stripHeight = _c.stripHeight, stripWidth = _c.stripWidth, stripColor = _c.stripColor, stripOpacity = _c.stripOpacity, stripStrokeDashArray = _c.stripStrokeDashArray, unFocusOnPressOut = _c.unFocusOnPressOut, delayBeforeUnFocus = _c.delayBeforeUnFocus, _d = _c.containerHeightIncludingBelowXAxis, containerHeightIncludingBelowXAxis = _d === void 0 ? 0 : _d, lineGradient = _c.lineGradient, lineGradientDirection = _c.lineGradientDirection, lineGradientStartColor = _c.lineGradientStartColor, lineGradientEndColor = _c.lineGradientEndColor, barAndLineChartsWrapperProps = _c.barAndLineChartsWrapperProps, areaChart = _c.areaChart, mostNegativeValue = _c.mostNegativeValue, strips = _c.strips;
58
+ var _d = useLineChart(__assign(__assign({}, props), { parentWidth: (_b = props.parentWidth) !== null && _b !== void 0 ? _b : screenWidth })), curveType = _d.curveType, scrollX = _d.scrollX, setScrollX = _d.setScrollX, arrow1Points = _d.arrow1Points, arrow2Points = _d.arrow2Points, arrow3Points = _d.arrow3Points, arrow4Points = _d.arrow4Points, arrow5Points = _d.arrow5Points, secondaryArrowPoints = _d.secondaryArrowPoints, pointerIndex = _d.pointerIndex, setPointerIndex = _d.setPointerIndex, pointerX = _d.pointerX, setPointerX = _d.setPointerX, pointerY = _d.pointerY, setPointerY = _d.setPointerY, pointerItem = _d.pointerItem, setPointerItem = _d.setPointerItem, pointerY2 = _d.pointerY2, setPointerY2 = _d.setPointerY2, pointerItem2 = _d.pointerItem2, setPointerItem2 = _d.setPointerItem2, pointerY3 = _d.pointerY3, setPointerY3 = _d.setPointerY3, pointerItem3 = _d.pointerItem3, setPointerItem3 = _d.setPointerItem3, pointerY4 = _d.pointerY4, setPointerY4 = _d.setPointerY4, pointerItem4 = _d.pointerItem4, setPointerItem4 = _d.setPointerItem4, pointerY5 = _d.pointerY5, setPointerY5 = _d.setPointerY5, pointerYsForDataSet = _d.pointerYsForDataSet, setPointerYsForDataSet = _d.setPointerYsForDataSet, pointerItem5 = _d.pointerItem5, setPointerItem5 = _d.setPointerItem5, secondaryPointerY = _d.secondaryPointerY, setSecondaryPointerY = _d.setSecondaryPointerY, secondaryPointerItem = _d.secondaryPointerItem, setSecondaryPointerItem = _d.setSecondaryPointerItem, pointerItemsForSet = _d.pointerItemsForSet, setPointerItemsForSet = _d.setPointerItemsForSet, secondaryPointerItemsForSet = _d.secondaryPointerItemsForSet, setSecondaryPointerItemsForSet = _d.setSecondaryPointerItemsForSet, responderStartTime = _d.responderStartTime, setResponderStartTime = _d.setResponderStartTime, setResponderActive = _d.setResponderActive, points = _d.points, points2 = _d.points2, points3 = _d.points3, points4 = _d.points4, points5 = _d.points5, secondaryPoints = _d.secondaryPoints, fillPoints = _d.fillPoints, fillPoints2 = _d.fillPoints2, fillPoints3 = _d.fillPoints3, fillPoints4 = _d.fillPoints4, fillPoints5 = _d.fillPoints5, secondaryFillPoints = _d.secondaryFillPoints, pointsFromSet = _d.pointsFromSet, fillPointsFromSet = _d.fillPointsFromSet, arrowPointsFromSet = _d.arrowPointsFromSet, selectedIndex = _d.selectedIndex, setSelectedIndex = _d.setSelectedIndex, containerHeight = _d.containerHeight, data = _d.data, data2 = _d.data2, data3 = _d.data3, data4 = _d.data4, data5 = _d.data5, secondaryData = _d.secondaryData, dataSet = _d.dataSet, data0 = _d.data0, labelsExtraHeight = _d.labelsExtraHeight, animationDuration = _d.animationDuration, onDataChangeAnimationDuration = _d.onDataChangeAnimationDuration, animateTogether = _d.animateTogether, renderDataPointsAfterAnimationEnds = _d.renderDataPointsAfterAnimationEnds, animateOnDataChange = _d.animateOnDataChange, startIndex1 = _d.startIndex1, startIndex2 = _d.startIndex2, endIndex1 = _d.endIndex1, endIndex2 = _d.endIndex2, startIndex3 = _d.startIndex3, endIndex3 = _d.endIndex3, startIndex4 = _d.startIndex4, endIndex4 = _d.endIndex4, startIndex5 = _d.startIndex5, endIndex5 = _d.endIndex5, initialSpacing = _d.initialSpacing, thickness = _d.thickness, yAxisLabelWidth = _d.yAxisLabelWidth, spacing = _d.spacing, xAxisThickness = _d.xAxisThickness, dataPointsHeight1 = _d.dataPointsHeight1, dataPointsWidth1 = _d.dataPointsWidth1, dataPointsRadius1 = _d.dataPointsRadius1, dataPointsColor1 = _d.dataPointsColor1, dataPointsShape1 = _d.dataPointsShape1, dataPointsHeight2 = _d.dataPointsHeight2, dataPointsWidth2 = _d.dataPointsWidth2, dataPointsRadius2 = _d.dataPointsRadius2, dataPointsColor2 = _d.dataPointsColor2, dataPointsShape2 = _d.dataPointsShape2, dataPointsHeight3 = _d.dataPointsHeight3, dataPointsWidth3 = _d.dataPointsWidth3, dataPointsRadius3 = _d.dataPointsRadius3, dataPointsColor3 = _d.dataPointsColor3, dataPointsShape3 = _d.dataPointsShape3, dataPointsHeight4 = _d.dataPointsHeight4, dataPointsWidth4 = _d.dataPointsWidth4, dataPointsRadius4 = _d.dataPointsRadius4, dataPointsColor4 = _d.dataPointsColor4, dataPointsShape4 = _d.dataPointsShape4, dataPointsHeight5 = _d.dataPointsHeight5, dataPointsWidth5 = _d.dataPointsWidth5, dataPointsRadius5 = _d.dataPointsRadius5, dataPointsColor5 = _d.dataPointsColor5, dataPointsShape5 = _d.dataPointsShape5, getIsNthAreaChart = _d.getIsNthAreaChart, textFontSize1 = _d.textFontSize1, textFontSize2 = _d.textFontSize2, textFontSize3 = _d.textFontSize3, textFontSize4 = _d.textFontSize4, textFontSize5 = _d.textFontSize5, textColor1 = _d.textColor1, textColor2 = _d.textColor2, textColor3 = _d.textColor3, textColor4 = _d.textColor4, textColor5 = _d.textColor5, totalWidth = _d.totalWidth, maxValue = _d.maxValue, overflowTop = _d.overflowTop, extendedContainerHeight = _d.extendedContainerHeight, getX = _d.getX, getY = _d.getY, getSecondaryY = _d.getSecondaryY, secondaryMaxValue = _d.secondaryMaxValue, showValuesAsDataPointsText = _d.showValuesAsDataPointsText, thickness1 = _d.thickness1, thickness2 = _d.thickness2, thickness3 = _d.thickness3, thickness4 = _d.thickness4, thickness5 = _d.thickness5, zIndex1 = _d.zIndex1, zIndex2 = _d.zIndex2, zIndex3 = _d.zIndex3, zIndex4 = _d.zIndex4, zIndex5 = _d.zIndex5, strokeDashArray1 = _d.strokeDashArray1, strokeDashArray2 = _d.strokeDashArray2, strokeDashArray3 = _d.strokeDashArray3, strokeDashArray4 = _d.strokeDashArray4, strokeDashArray5 = _d.strokeDashArray5, rotateLabel = _d.rotateLabel, isAnimated = _d.isAnimated, hideDataPoints1 = _d.hideDataPoints1, hideDataPoints2 = _d.hideDataPoints2, hideDataPoints3 = _d.hideDataPoints3, hideDataPoints4 = _d.hideDataPoints4, hideDataPoints5 = _d.hideDataPoints5, color1 = _d.color1, color2 = _d.color2, color3 = _d.color3, color4 = _d.color4, color5 = _d.color5, startFillColor1 = _d.startFillColor1, endFillColor1 = _d.endFillColor1, startOpacity1 = _d.startOpacity1, endOpacity1 = _d.endOpacity1, startFillColor2 = _d.startFillColor2, endFillColor2 = _d.endFillColor2, startOpacity2 = _d.startOpacity2, endOpacity2 = _d.endOpacity2, startFillColor3 = _d.startFillColor3, endFillColor3 = _d.endFillColor3, startOpacity3 = _d.startOpacity3, endOpacity3 = _d.endOpacity3, startFillColor4 = _d.startFillColor4, endFillColor4 = _d.endFillColor4, startOpacity4 = _d.startOpacity4, endOpacity4 = _d.endOpacity4, startFillColor5 = _d.startFillColor5, endFillColor5 = _d.endFillColor5, startOpacity5 = _d.startOpacity5, endOpacity5 = _d.endOpacity5, arrowStrokeWidth1 = _d.arrowStrokeWidth1, arrowStrokeColor1 = _d.arrowStrokeColor1, arrowFillColor1 = _d.arrowFillColor1, arrowStrokeWidth2 = _d.arrowStrokeWidth2, arrowStrokeColor2 = _d.arrowStrokeColor2, arrowFillColor2 = _d.arrowFillColor2, arrowStrokeWidth3 = _d.arrowStrokeWidth3, arrowStrokeColor3 = _d.arrowStrokeColor3, arrowFillColor3 = _d.arrowFillColor3, arrowStrokeWidth4 = _d.arrowStrokeWidth4, arrowStrokeColor4 = _d.arrowStrokeColor4, arrowFillColor4 = _d.arrowFillColor4, arrowStrokeWidth5 = _d.arrowStrokeWidth5, arrowStrokeColor5 = _d.arrowStrokeColor5, arrowFillColor5 = _d.arrowFillColor5, arrowStrokeWidthsFromSet = _d.arrowStrokeWidthsFromSet, arrowStrokeColorsFromSet = _d.arrowStrokeColorsFromSet, arrowFillColorsFromSet = _d.arrowFillColorsFromSet, secondaryLineConfig = _d.secondaryLineConfig, gradientDirection = _d.gradientDirection, stepHeight = _d.stepHeight, noOfSectionsBelowXAxis = _d.noOfSectionsBelowXAxis, xAxisTextNumberOfLines = _d.xAxisTextNumberOfLines, xAxisLabelsVerticalShift = _d.xAxisLabelsVerticalShift, pointerConfig = _d.pointerConfig, pointerHeight = _d.pointerHeight, pointerWidth = _d.pointerWidth, pointerRadius = _d.pointerRadius, pointerColor = _d.pointerColor, pointerComponent = _d.pointerComponent, showPointerStrip = _d.showPointerStrip, pointerStripHeight = _d.pointerStripHeight, pointerStripWidth = _d.pointerStripWidth, pointerStripColor = _d.pointerStripColor, pointerStripUptoDataPoint = _d.pointerStripUptoDataPoint, pointerLabelComponent = _d.pointerLabelComponent, stripOverPointer = _d.stripOverPointer, shiftPointerLabelX = _d.shiftPointerLabelX, shiftPointerLabelY = _d.shiftPointerLabelY, pointerLabelWidth = _d.pointerLabelWidth, pointerLabelHeight = _d.pointerLabelHeight, autoAdjustPointerLabelPosition = _d.autoAdjustPointerLabelPosition, pointerVanishDelay = _d.pointerVanishDelay, activatePointersOnLongPress = _d.activatePointersOnLongPress, activatePointersInstantlyOnTouch = _d.activatePointersInstantlyOnTouch, activatePointersDelay = _d.activatePointersDelay, persistPointer = _d.persistPointer, resetPointerIndexOnRelease = _d.resetPointerIndexOnRelease, hidePointers = _d.hidePointers, hidePointer1 = _d.hidePointer1, hidePointer2 = _d.hidePointer2, hidePointer3 = _d.hidePointer3, hidePointer4 = _d.hidePointer4, hidePointer5 = _d.hidePointer5, cumulativeSpacing1 = _d.cumulativeSpacing1, cumulativeSpacing2 = _d.cumulativeSpacing2, cumulativeSpacing3 = _d.cumulativeSpacing3, cumulativeSpacing4 = _d.cumulativeSpacing4, cumulativeSpacing5 = _d.cumulativeSpacing5, cumulativeSpacingSecondary = _d.cumulativeSpacingSecondary, cumulativeSpacingForSet = _d.cumulativeSpacingForSet, hideSecondaryPointer = _d.hideSecondaryPointer, hidePointerDataPointForMissingValues = _d.hidePointerDataPointForMissingValues, pointerEvents = _d.pointerEvents, focusEnabled = _d.focusEnabled, showDataPointOnFocus = _d.showDataPointOnFocus, showStripOnFocus = _d.showStripOnFocus, stripOverDataPoints = _d.stripOverDataPoints, showTextOnFocus = _d.showTextOnFocus, showDataPointLabelOnFocus = _d.showDataPointLabelOnFocus, stripHeight = _d.stripHeight, stripWidth = _d.stripWidth, stripColor = _d.stripColor, stripOpacity = _d.stripOpacity, stripStrokeDashArray = _d.stripStrokeDashArray, unFocusOnPressOut = _d.unFocusOnPressOut, delayBeforeUnFocus = _d.delayBeforeUnFocus, _e = _d.containerHeightIncludingBelowXAxis, containerHeightIncludingBelowXAxis = _e === void 0 ? 0 : _e, lineGradient = _d.lineGradient, lineGradientDirection = _d.lineGradientDirection, lineGradientStartColor = _d.lineGradientStartColor, lineGradientEndColor = _d.lineGradientEndColor, barAndLineChartsWrapperProps = _d.barAndLineChartsWrapperProps, areaChart = _d.areaChart, mostNegativeValue = _d.mostNegativeValue, strips = _d.strips, lastLineNumber = _d.lastLineNumber, focusTogether = _d.focusTogether, focusProximity = _d.focusProximity;
59
+ var svgHeight = containerHeightIncludingBelowXAxis +
60
+ ((_c = props.overflowBottom) !== null && _c !== void 0 ? _c : dataPointsRadius1);
59
61
  var secondaryXAxis = props.secondaryXAxis, intersectionAreaConfig = props.intersectionAreaConfig;
60
62
  var widthValuesFromSet = useMemo(function () { return dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set) { return new Animated.Value(0); }); }, []);
61
63
  var animatedPoints = new Animated.Value(0);
@@ -199,7 +201,7 @@ export var LineChart = function (props) {
199
201
  ]);
200
202
  var svgWrapperViewStyle = {
201
203
  position: 'absolute',
202
- bottom: 62 + xAxisLabelsVerticalShift + labelsExtraHeight - xAxisThickness,
204
+ bottom: 61 + xAxisLabelsVerticalShift + labelsExtraHeight - xAxisThickness,
203
205
  left: 0,
204
206
  zIndex: 1,
205
207
  transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
@@ -257,18 +259,19 @@ export var LineChart = function (props) {
257
259
  props.onFocus(item, index);
258
260
  }
259
261
  };
262
+ var _f = __read(useState(-1), 2), selectedLineNumber = _f[0], setSelectedLineNumber = _f[1];
260
263
  var renderDataPoints = function (hideDataPoints, dataForRender, originalDataFromProps, dataPtsShape, dataPtsWidth, dataPtsHeight, dataPtsColor, dataPtsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray, key) {
261
264
  var getYOrSecondaryY = isSecondary ? getSecondaryY : getY;
262
265
  return dataForRender.map(function (item, index) {
263
- var _a;
264
- var _b, _c, _d, _e;
266
+ var _a, _b, _c, _d, _e;
265
267
  if (index < startIndex || index > endIndex)
266
268
  return null;
267
269
  if (item.hideDataPoint) {
268
270
  return null;
269
271
  }
270
272
  var dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, text, customDataPoint, dataPointLabelComponent;
271
- if (index === selectedIndex) {
273
+ if (index === selectedIndex &&
274
+ (focusTogether || key === selectedLineNumber)) {
272
275
  dataPointsShape =
273
276
  item.focusedDataPointShape ||
274
277
  props.focusedDataPointShape ||
@@ -289,7 +292,7 @@ export var LineChart = function (props) {
289
292
  props.focusedDataPointColor ||
290
293
  LineDefaults.focusedDataPointColor;
291
294
  dataPointsRadius =
292
- (_d = (_c = (_b = item.focusedDataPointRadius) !== null && _b !== void 0 ? _b : props.focusedDataPointRadius) !== null && _c !== void 0 ? _c : item.dataPointRadius) !== null && _d !== void 0 ? _d : dataPtsRadius;
295
+ (_c = (_b = (_a = item.focusedDataPointRadius) !== null && _a !== void 0 ? _a : props.focusedDataPointRadius) !== null && _b !== void 0 ? _b : item.dataPointRadius) !== null && _c !== void 0 ? _c : dataPtsRadius;
293
296
  if (showTextOnFocus) {
294
297
  text = item.dataPointText;
295
298
  }
@@ -306,7 +309,7 @@ export var LineChart = function (props) {
306
309
  dataPointsWidth = item.dataPointWidth || dataPtsWidth;
307
310
  dataPointsHeight = item.dataPointHeight || dataPtsHeight;
308
311
  dataPointsColor = item.dataPointColor || dataPtsColor;
309
- dataPointsRadius = (_e = item.dataPointRadius) !== null && _e !== void 0 ? _e : dataPtsRadius;
312
+ dataPointsRadius = (_d = item.dataPointRadius) !== null && _d !== void 0 ? _d : dataPtsRadius;
310
313
  if (showTextOnFocus) {
311
314
  text = '';
312
315
  }
@@ -316,21 +319,82 @@ export var LineChart = function (props) {
316
319
  if (showValuesAsDataPointsText) {
317
320
  text = originalDataFromProps[index].value;
318
321
  }
319
- var position = I18nManager.isRTL ? 'right' : 'left';
320
- return (_jsxs(Fragment, { children: [focusEnabled ? (_jsx(_Fragment, { children: unFocusOnPressOut ? ( // remove strip on onFocus
321
- _jsx(Rect, { onPressIn: function () { return onStripPress(item, index); }, onPressOut: function () {
322
- return setTimeout(function () { return setSelectedIndex(-1); }, delayBeforeUnFocus);
323
- }, x: initialSpacing + (spacing * index - spacing / 2), y: 8, width: spacing, height: containerHeight - 0, fill: 'none' })) : (_jsx(Rect, { onPress: function () { return onStripPress(item, index); }, x: initialSpacing + (spacing * index - spacing / 2), y: 8, width: spacing, height: containerHeight, fill: 'none' })) })) : null, hideDataPoints ? null : (_jsxs(_Fragment, { children: [customDataPoint ? (_jsx(View, { style: [
324
- styles.customDataPointContainer,
325
- (_a = {
326
- height: dataPointsHeight,
327
- width: dataPointsWidth,
328
- top: getYOrSecondaryY(item.value)
329
- },
330
- _a[position] = initialSpacing - dataPointsWidth + spacing * index,
331
- _a.transform = [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
332
- _a),
333
- ], children: customDataPoint(item, index) })) : null, dataPointsShape === 'rectangular' ? (_jsx(Fragment, { children: customDataPoint ? null : (_jsx(Rect, { x: getX(spacingArray, index) - dataPointsWidth / 2, y: getYOrSecondaryY(item.value) - dataPointsHeight / 2, width: dataPointsWidth, height: dataPointsHeight, fill: showDataPointOnFocus
322
+ return (_jsxs(Fragment, { children: [focusEnabled ? (_jsx(_Fragment, { children: key === lastLineNumber - 1 ? (_jsx(Rect, { x: initialSpacing + (spacing * index - spacing / 2), y: 8, width: spacing, height: containerHeight - 0, fill: 'none', onPressIn: function (evt) {
323
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
324
+ var locationY = evt.nativeEvent.locationY; // Note that we have another property named pageY which can be useful
325
+ var lineNumber = 0;
326
+ if (dataSet) {
327
+ var minDistance_1 = Infinity;
328
+ dataSet.forEach(function (setItem, setIndex) {
329
+ var _a;
330
+ var distance = Math.abs(getY((_a = setItem.data[index]) === null || _a === void 0 ? void 0 : _a.value) - locationY);
331
+ if (distance < minDistance_1) {
332
+ minDistance_1 = distance;
333
+ lineNumber = setIndex + 1;
334
+ }
335
+ });
336
+ }
337
+ else {
338
+ var distance1 = void 0, distance2 = void 0, distance3 = void 0, distance4 = void 0, distance5 = void 0, distance6 = void 0;
339
+ var minDistance = Infinity;
340
+ if (typeof ((_a = data[index]) === null || _a === void 0 ? void 0 : _a.value) === 'number') {
341
+ distance1 = Math.abs(getY((_b = data[index]) === null || _b === void 0 ? void 0 : _b.value) - locationY);
342
+ minDistance = distance1;
343
+ if (distance1 < focusProximity)
344
+ lineNumber = 1;
345
+ }
346
+ if (typeof ((_c = data2[index]) === null || _c === void 0 ? void 0 : _c.value) === 'number') {
347
+ distance2 = Math.abs(getY((_d = data2[index]) === null || _d === void 0 ? void 0 : _d.value) - locationY);
348
+ if (minDistance > distance2 &&
349
+ distance2 < focusProximity) {
350
+ minDistance = distance2;
351
+ lineNumber = 2;
352
+ }
353
+ }
354
+ if (typeof ((_e = data3[index]) === null || _e === void 0 ? void 0 : _e.value) === 'number') {
355
+ distance3 = Math.abs(getY((_f = data3[index]) === null || _f === void 0 ? void 0 : _f.value) - locationY);
356
+ if (minDistance > distance3 &&
357
+ distance3 < focusProximity) {
358
+ minDistance = distance3;
359
+ lineNumber = 3;
360
+ }
361
+ }
362
+ if (typeof ((_g = data4[index]) === null || _g === void 0 ? void 0 : _g.value) === 'number') {
363
+ distance4 = Math.abs(getY((_h = data4[index]) === null || _h === void 0 ? void 0 : _h.value) - locationY);
364
+ if (minDistance > distance4 &&
365
+ distance4 < focusProximity) {
366
+ minDistance = distance4;
367
+ lineNumber = 4;
368
+ }
369
+ }
370
+ if (typeof ((_j = data5[index]) === null || _j === void 0 ? void 0 : _j.value) === 'number') {
371
+ distance5 = Math.abs(getY((_k = data5[index]) === null || _k === void 0 ? void 0 : _k.value) - locationY);
372
+ if (minDistance > distance5 &&
373
+ distance5 < focusProximity) {
374
+ minDistance = distance5;
375
+ lineNumber = 5;
376
+ }
377
+ }
378
+ if (typeof ((_l = secondaryData[index]) === null || _l === void 0 ? void 0 : _l.value) === 'number') {
379
+ distance6 = Math.abs(getY((_m = secondaryData[index]) === null || _m === void 0 ? void 0 : _m.value) - locationY);
380
+ if (minDistance > distance6 &&
381
+ distance6 < focusProximity) {
382
+ minDistance = distance6;
383
+ lineNumber = 6666;
384
+ }
385
+ }
386
+ }
387
+ setSelectedLineNumber(lineNumber - 1);
388
+ if (lineNumber) {
389
+ onStripPress(item, index);
390
+ }
391
+ }, onPressOut: function () {
392
+ if (unFocusOnPressOut) {
393
+ setTimeout(function () { return setSelectedIndex(-1); }, delayBeforeUnFocus);
394
+ }
395
+ } })) : null })) : null, hideDataPoints ? null : (_jsxs(_Fragment, { children: [customDataPoint ? (_jsx(ForeignObject, { height: svgHeight, width: totalWidth, x: initialSpacing -
396
+ dataPointsWidth / 2 +
397
+ ((_e = spacingArray[index - 1]) !== null && _e !== void 0 ? _e : 0), y: getYOrSecondaryY(item.value) - dataPointsHeight / 2, children: customDataPoint(item, index) })) : null, dataPointsShape === 'rectangular' ? (_jsx(Fragment, { children: customDataPoint ? null : (_jsx(Rect, { x: getX(spacingArray, index) - dataPointsWidth / 2, y: getYOrSecondaryY(item.value) - dataPointsHeight / 2, width: dataPointsWidth, height: dataPointsHeight, fill: showDataPointOnFocus
334
398
  ? index === selectedIndex
335
399
  ? dataPointsColor
336
400
  : 'none'
@@ -372,7 +436,8 @@ export var LineChart = function (props) {
372
436
  spacing * index,
373
437
  },
374
438
  ], children: showDataPointLabelOnFocus
375
- ? index === selectedIndex
439
+ ? index === selectedIndex &&
440
+ (focusTogether || key == selectedLineNumber)
376
441
  ? dataPointLabelComponent()
377
442
  : null
378
443
  : dataPointLabelComponent() })) : null) : text || item.dataPointText ? (!showTextOnFocus || index === selectedIndex ? (_jsx(CanvasText, { fill: item.textColor || textColor, fontSize: item.textFontSize || textFontSize, x: getX(spacingArray, index) -
@@ -389,9 +454,13 @@ export var LineChart = function (props) {
389
454
  var _a, _b, _c;
390
455
  if (item.showVerticalLine) {
391
456
  var x = getX(spacingArray, index);
392
- return (_jsx(Line, { x1: x, y1: extendedContainerHeight, x2: x, y2: ((_a = item.verticalLineUptoDataPoint) !== null && _a !== void 0 ? _a : props.verticalLinesUptoDataPoint)
393
- ? getY(item.value)
394
- : -xAxisThickness, stroke: item.verticalLineColor || props.verticalLinesColor || 'lightgray', strokeWidth: item.verticalLineThickness || props.verticalLinesThickness || 2, strokeDasharray: (_c = (_b = item.verticalLineStrokeDashArray) !== null && _b !== void 0 ? _b : props.verticalLinesStrokeDashArray) !== null && _c !== void 0 ? _c : '' }, index));
457
+ return (_jsx(Line, { x1: x, y1: extendedContainerHeight, x2: x, y2: item.verticalLineHeight
458
+ ? extendedContainerHeight - item.verticalLineHeight
459
+ : props.verticalLinesHeight
460
+ ? extendedContainerHeight - props.verticalLinesHeight
461
+ : ((_a = item.verticalLineUptoDataPoint) !== null && _a !== void 0 ? _a : props.verticalLinesUptoDataPoint)
462
+ ? getY(item.value)
463
+ : -xAxisThickness, stroke: item.verticalLineColor || props.verticalLinesColor || 'lightgray', strokeWidth: item.verticalLineThickness || props.verticalLinesThickness || 2, strokeDasharray: (_c = (_b = item.verticalLineStrokeDashArray) !== null && _b !== void 0 ? _b : props.verticalLinesStrokeDashArray) !== null && _c !== void 0 ? _c : '' }, index));
395
464
  }
396
465
  return null;
397
466
  });
@@ -436,8 +505,8 @@ export var LineChart = function (props) {
436
505
  return;
437
506
  if (lineNumber === 5 && hidePointer5)
438
507
  return;
439
- // 6 is for secondaryData
440
- if (lineNumber === 6 && hideSecondaryPointer)
508
+ // 6666 is for secondaryData
509
+ if (lineNumber === 6666 && hideSecondaryPointer)
441
510
  return;
442
511
  var pointerItemLocal, pointerYLocal, pointerColorLocal;
443
512
  switch (lineNumber) {
@@ -466,7 +535,7 @@ export var LineChart = function (props) {
466
535
  pointerYLocal = pointerY5;
467
536
  pointerColorLocal = (pointerConfig === null || pointerConfig === void 0 ? void 0 : pointerConfig.pointer5Color) || pointerColor;
468
537
  break;
469
- case 6:
538
+ case 6666:
470
539
  pointerItemLocal = secondaryPointerItem;
471
540
  pointerYLocal = secondaryPointerY;
472
541
  pointerColorLocal =
@@ -563,8 +632,28 @@ export var LineChart = function (props) {
563
632
  var _a;
564
633
  return (_jsx(View, { style: [svgWrapperViewStyle, { width: totalWidth }], children: _jsxs(Svg, { children: [_jsx(Path, { id: "path1", d: fillPoints, fill: "none", stroke: 'none' }), _jsx(Path, { id: "path2", d: fillPoints2, fill: "none", stroke: 'none' }), _jsx(ClipPath, { id: "clip", children: _jsx(Use, { href: "#path1" }) }), _jsx(Path, { d: fillPoints2, clipPath: "url(#clip)", fill: (_a = intersectionAreaConfig === null || intersectionAreaConfig === void 0 ? void 0 : intersectionAreaConfig.fillColor) !== null && _a !== void 0 ? _a : 'white' }), _jsx(Path, { d: points, stroke: color1, strokeWidth: thickness1 !== null && thickness1 !== void 0 ? thickness1 : thickness, fill: 'none' })] }) }));
565
634
  };
635
+ var renderDataPointsForEachLine = function () {
636
+ if (dataSet && pointsFromSet.length) {
637
+ return (_jsx(_Fragment, { children: dataSet.map(function (set, index) {
638
+ var _a;
639
+ var hideDataPoints = set.hideDataPoints, data = set.data, dataPointsShape = set.dataPointsShape, dataPointsWidth = set.dataPointsWidth, dataPointsHeight = set.dataPointsHeight, dataPointsColor = set.dataPointsColor, dataPointsRadius = set.dataPointsRadius, textColor = set.textColor, textFontSize = set.textFontSize, startIndex = set.startIndex, endIndex = set.endIndex, isSecondary = set.isSecondary;
640
+ return renderDataPoints(hideDataPoints !== null && hideDataPoints !== void 0 ? hideDataPoints : hideDataPoints1, data, adjustToOffset(data, -((_a = props.yAxisOffset) !== null && _a !== void 0 ? _a : 0)), dataPointsShape !== null && dataPointsShape !== void 0 ? dataPointsShape : dataPointsShape1, dataPointsWidth !== null && dataPointsWidth !== void 0 ? dataPointsWidth : dataPointsWidth1, dataPointsHeight !== null && dataPointsHeight !== void 0 ? dataPointsHeight : dataPointsHeight1, dataPointsColor !== null && dataPointsColor !== void 0 ? dataPointsColor : dataPointsColor1, dataPointsRadius !== null && dataPointsRadius !== void 0 ? dataPointsRadius : dataPointsRadius1, textColor !== null && textColor !== void 0 ? textColor : textColor1, textFontSize !== null && textFontSize !== void 0 ? textFontSize : textFontSize1, startIndex !== null && startIndex !== void 0 ? startIndex : 0, endIndex !== null && endIndex !== void 0 ? endIndex : set.data.length - 1, isSecondary, showValuesAsDataPointsText, cumulativeSpacingForSet[index], index);
641
+ }) }));
642
+ }
643
+ return (_jsxs(_Fragment, { children: [renderDataPoints(hideDataPoints1, data, props.data, dataPointsShape1, dataPointsWidth1, dataPointsHeight1, dataPointsColor1, dataPointsRadius1, textColor1, textFontSize1, startIndex1, endIndex1, false, showValuesAsDataPointsText, cumulativeSpacing1, 0), points2
644
+ ? renderDataPoints(hideDataPoints2, data2, props.data2, dataPointsShape2, dataPointsWidth2, dataPointsHeight2, dataPointsColor2, dataPointsRadius2, textColor2, textFontSize2, startIndex2, endIndex2, false, showValuesAsDataPointsText, cumulativeSpacing2, 1)
645
+ : null, points3
646
+ ? renderDataPoints(hideDataPoints3, data3, props.data3, dataPointsShape3, dataPointsWidth3, dataPointsHeight3, dataPointsColor3, dataPointsRadius3, textColor3, textFontSize3, startIndex3, endIndex3, false, showValuesAsDataPointsText, cumulativeSpacing3, 2)
647
+ : null, points4
648
+ ? renderDataPoints(hideDataPoints4, data4, props.data4, dataPointsShape4, dataPointsWidth4, dataPointsHeight4, dataPointsColor4, dataPointsRadius4, textColor4, textFontSize4, startIndex4, endIndex4, false, showValuesAsDataPointsText, cumulativeSpacing4, 3)
649
+ : null, points5
650
+ ? renderDataPoints(hideDataPoints5, data5, props.data5, dataPointsShape5, dataPointsWidth5, dataPointsHeight5, dataPointsColor5, dataPointsRadius5, textColor5, textFontSize5, startIndex5, endIndex5, false, showValuesAsDataPointsText, cumulativeSpacing5, 4)
651
+ : null, secondaryPoints
652
+ ? renderDataPoints(secondaryLineConfig.hideDataPoints, secondaryData, props.secondaryData, secondaryLineConfig.dataPointsShape, secondaryLineConfig.dataPointsWidth, secondaryLineConfig.dataPointsHeight, secondaryLineConfig.dataPointsColor, secondaryLineConfig.dataPointsRadius, secondaryLineConfig.textColor, secondaryLineConfig.textFontSize, secondaryLineConfig.startIndex, secondaryLineConfig.endIndex, true, secondaryLineConfig.showValuesAsDataPointsText, cumulativeSpacingSecondary, 6666)
653
+ : null] }));
654
+ };
566
655
  var lineSvgComponent = function (points, currentLineThickness, color, fillPoints, startFillColor, endFillColor, startOpacity, endOpacity, strokeDashArray, showArrow, arrowPoints, arrowStrokeWidth, arrowStrokeColor, arrowFillColor, key, hideDataPoints, data, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray) {
567
- var _a, _b, _c;
656
+ var _a, _b;
568
657
  if (!points)
569
658
  return null;
570
659
  var isCurved = points.includes('C') || points.includes('Q');
@@ -594,8 +683,7 @@ export var LineChart = function (props) {
594
683
  typeof strokeDashArray[1] === 'number') {
595
684
  lineSvgPropsOuter.strokeDasharray = strokeDashArray;
596
685
  }
597
- return (_jsxs(Svg, { height: containerHeightIncludingBelowXAxis +
598
- ((_b = props.overflowBottom) !== null && _b !== void 0 ? _b : dataPointsRadius1),
686
+ return (_jsxs(Svg, { height: svgHeight,
599
687
  // width={widthValue}
600
688
  onPress: props.onBackgroundPress, children: [lineGradient && getLineGradientComponent(), points.includes(SEGMENT_START) || points.includes(RANGE_ENTER) ? (ar.map(function (item, index) {
601
689
  var lineSvgProps = {
@@ -621,9 +709,13 @@ export var LineChart = function (props) {
621
709
  ? "url(#".concat(props.areaGradientId, ")")
622
710
  : "url(#Gradient)", stroke: 'none', strokeWidth: currentLineThickness || thickness })) : (_jsx(Path, { onPress: props.onChartAreaPress, d: fillPoints, fill: props.areaGradientId
623
711
  ? "url(#".concat(props.areaGradientId, ")")
624
- : "url(#Gradient)", stroke: 'none', strokeWidth: currentLineThickness || thickness }))) : null, renderSpecificVerticalLines(data, cumulativeSpacing1), renderSpecificVerticalLines(data2, cumulativeSpacing2), renderSpecificVerticalLines(data3, cumulativeSpacing3), renderSpecificVerticalLines(data4, cumulativeSpacing4), renderSpecificVerticalLines(data5, cumulativeSpacing5), (_c = dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set, index) {
712
+ : "url(#Gradient)", stroke: 'none', strokeWidth: currentLineThickness || thickness }))) : null, renderSpecificVerticalLines(data, cumulativeSpacing1), renderSpecificVerticalLines(data2, cumulativeSpacing2), renderSpecificVerticalLines(data3, cumulativeSpacing3), renderSpecificVerticalLines(data4, cumulativeSpacing4), renderSpecificVerticalLines(data5, cumulativeSpacing5), (_b = dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set, index) {
625
713
  return renderSpecificVerticalLines(set === null || set === void 0 ? void 0 : set.data, cumulativeSpacingForSet[index]);
626
- })) !== null && _c !== void 0 ? _c : null, renderDataPoints(hideDataPoints, data, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray, key), showArrow && (_jsx(Path, { d: arrowPoints, fill: arrowFillColor, stroke: arrowStrokeColor, strokeWidth: arrowStrokeWidth }))] }));
714
+ })) !== null && _b !== void 0 ? _b : null, isAnimated && !renderDataPointsAfterAnimationEnds // in this condition onPress won't work properly in case of multi-line, so it's suggested to use either renderDataPointsAfterAnimationEnds prop if you want to use onPress for data points
715
+ ? renderDataPoints(hideDataPoints, data, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray, key)
716
+ : key === lastLineNumber - 1
717
+ ? renderDataPointsForEachLine()
718
+ : null, showArrow && (_jsx(Path, { d: arrowPoints, fill: arrowFillColor, stroke: arrowStrokeColor, strokeWidth: arrowStrokeWidth }))] }));
627
719
  };
628
720
  // const getClosestValueFromSpacingArray = (spacingArray:number[],x:number):number => {
629
721
  // let dif=0,prevDif=0,i;
@@ -641,23 +733,25 @@ export var LineChart = function (props) {
641
733
  factor = Math.round(factor);
642
734
  factor = Math.min(factor, (data0 !== null && data0 !== void 0 ? data0 : data).length - 1);
643
735
  factor = Math.max(factor, 0);
644
- var z = getX(cumulativeSpacing1, factor) -
645
- (pointerRadius || pointerWidth / 2) -
646
- 1;
647
- setPointerX(z);
648
- setPointerIndex(factor);
649
736
  var item, y;
650
737
  item = (data0 !== null && data0 !== void 0 ? data0 : data)[factor];
651
- y =
652
- containerHeight -
653
- (item.value * containerHeight) / maxValue -
654
- (pointerRadius || pointerHeight / 2) +
655
- 10;
656
- setPointerY(y);
657
- setPointerItem(item);
738
+ if (!item.hidePointer) {
739
+ var z = getX((dataSet === null || dataSet === void 0 ? void 0 : dataSet.length) ? cumulativeSpacingForSet[0] : cumulativeSpacing1, factor) -
740
+ (pointerRadius || pointerWidth / 2) -
741
+ 1;
742
+ setPointerX(Math.max(0.1, z)); // 0.1 is to avoid pointer going out of the chart, See https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/925
743
+ setPointerIndex(factor);
744
+ y =
745
+ containerHeight -
746
+ (item.value * containerHeight) / maxValue -
747
+ (pointerRadius || pointerHeight / 2) +
748
+ 10;
749
+ setPointerY(y);
750
+ setPointerItem(item);
751
+ }
658
752
  if (data2 && data2.length) {
659
753
  item = data2[factor];
660
- if (item) {
754
+ if (item && !item.hidePointer) {
661
755
  y =
662
756
  containerHeight -
663
757
  (item.value * containerHeight) / maxValue -
@@ -669,7 +763,7 @@ export var LineChart = function (props) {
669
763
  }
670
764
  if (data3 && data3.length) {
671
765
  item = data3[factor];
672
- if (item) {
766
+ if (item && !item.hidePointer) {
673
767
  y =
674
768
  containerHeight -
675
769
  (item.value * containerHeight) / maxValue -
@@ -681,7 +775,7 @@ export var LineChart = function (props) {
681
775
  }
682
776
  if (data4 && data4.length) {
683
777
  item = data4[factor];
684
- if (item) {
778
+ if (item && !item.hidePointer) {
685
779
  y =
686
780
  containerHeight -
687
781
  (item.value * containerHeight) / maxValue -
@@ -693,7 +787,7 @@ export var LineChart = function (props) {
693
787
  }
694
788
  if (data5 && data5.length) {
695
789
  item = data5[factor];
696
- if (item) {
790
+ if (item && !item.hidePointer) {
697
791
  y =
698
792
  containerHeight -
699
793
  (item.value * containerHeight) / maxValue -
@@ -742,7 +836,9 @@ export var LineChart = function (props) {
742
836
  }
743
837
  };
744
838
  var renderLine = function (containerHeightIncludingBelowXAxis, zIndex, points, currentLineThickness, color, fillPoints, startFillColor, endFillColor, startOpacity, endOpacity, strokeDashArray, showArrow, arrowPoints, arrowStrokeWidth, arrowStrokeColor, arrowFillColor, hideDataPoints, paramData, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray, key) {
745
- return (_jsx(View, { onMoveShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onResponderGrant: function (evt) {
839
+ return (_jsx(View, { onMoveShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onStartShouldSetResponder: function (evt) {
840
+ return pointerConfig && activatePointersInstantlyOnTouch ? true : false;
841
+ }, onResponderGrant: function (evt) {
746
842
  if (!pointerConfig)
747
843
  return;
748
844
  setResponderStartTime(evt.timeStamp);
@@ -771,9 +867,9 @@ export var LineChart = function (props) {
771
867
  // console.log('evt...reject.......',evt);
772
868
  // }}
773
869
  onResponderEnd: function (evt) {
774
- // console.log('evt...end.......',evt);
775
870
  setResponderStartTime(0);
776
- // setPointerIndex(-1);
871
+ if (resetPointerIndexOnRelease)
872
+ setPointerIndex(-1);
777
873
  setResponderActive(false);
778
874
  if (!persistPointer)
779
875
  setTimeout(function () { return setPointerX(0); }, pointerVanishDelay);
@@ -796,7 +892,9 @@ export var LineChart = function (props) {
796
892
  ], children: lineSvgComponent(points, currentLineThickness, color, fillPoints, startFillColor, endFillColor, startOpacity, endOpacity, strokeDashArray, showArrow, arrowPoints, arrowStrokeWidth, arrowStrokeColor, arrowFillColor, key, hideDataPoints, paramData, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray) }, key !== null && key !== void 0 ? key : 0));
797
893
  };
798
894
  var renderAnimatedLine = function (containerHeightIncludingBelowXAxis, zIndex, points, animatedWidth, currentLineThickness, color, fillPoints, startFillColor, endFillColor, startOpacity, endOpacity, strokeDashArray, showArrow, arrowPoints, arrowStrokeWidth, arrowStrokeColor, arrowFillColor, hideDataPoints, paramsData, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText, spacingArray, key) {
799
- return (_jsx(Animated.View, { onStartShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onMoveShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onResponderGrant: function (evt) {
895
+ return (_jsx(Animated.View, { onMoveShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onStartShouldSetResponder: function (evt) {
896
+ return pointerConfig && activatePointersInstantlyOnTouch ? true : false;
897
+ }, onResponderGrant: function (evt) {
800
898
  if (!pointerConfig)
801
899
  return;
802
900
  setResponderStartTime(evt.timeStamp);
@@ -827,7 +925,8 @@ export var LineChart = function (props) {
827
925
  onResponderEnd: function (evt) {
828
926
  // console.log('evt...end.......',evt);
829
927
  setResponderStartTime(0);
830
- // setPointerIndex(-1);
928
+ if (resetPointerIndexOnRelease)
929
+ setPointerIndex(-1);
831
930
  setResponderActive(false);
832
931
  if (!persistPointer)
833
932
  setTimeout(function () { return setPointerX(0); }, pointerVanishDelay);
@@ -861,7 +960,7 @@ export var LineChart = function (props) {
861
960
  },
862
961
  };
863
962
  var renderStrips = function (item, index, ind) {
864
- var _a, _b, _c, _d, _e, _f;
963
+ var _a, _b, _c, _d, _e, _f, _g, _h;
865
964
  if (item.showStrip || index === selectedIndex) {
866
965
  var currentStripHeight = (_a = item.stripHeight) !== null && _a !== void 0 ? _a : stripHeight;
867
966
  var currentStripWidth = (_b = item.stripWidth) !== null && _b !== void 0 ? _b : stripWidth;
@@ -873,9 +972,9 @@ export var LineChart = function (props) {
873
972
  : containerHeight -
874
973
  ((_f = item.dataPointHeight) !== null && _f !== void 0 ? _f : dataPointsHeight1) / 2 +
875
974
  14 -
876
- (item.value * containerHeight) / maxValue;
975
+ (((_g = item.value) !== null && _g !== void 0 ? _g : 0) * containerHeight) / maxValue;
877
976
  var actualStripHeight = currentStripHeight ||
878
- (item.value * containerHeight) / maxValue - 2 + overflowTop;
977
+ (((_h = item.value) !== null && _h !== void 0 ? _h : 0) * containerHeight) / maxValue - 2 + overflowTop;
879
978
  return (_jsx(Line, { x1: initialSpacing + spacing * index, y1: y1, x2: initialSpacing + spacing * index, y2: y1 + actualStripHeight + 2, strokeWidth: currentStripWidth, stroke: currentStripColor, strokeDasharray: currentStripStrokeDashArray, opacity: currentStripOpacity }, 'strip' + (ind * 10000 + index)));
880
979
  }
881
980
  return null;
@@ -933,8 +1032,8 @@ export var LineChart = function (props) {
933
1032
  ? renderAnimatedLine(containerHeightIncludingBelowXAxis, zIndex1, points, widthValue, thickness1, color1, fillPoints, startFillColor1, endFillColor1, startOpacity1, endOpacity1, strokeDashArray1, props.showArrow1 || props.showArrows, arrow1Points, arrowStrokeWidth1, arrowStrokeColor1, arrowFillColor1, hideDataPoints1, data, props.data, dataPointsShape1, dataPointsWidth1, dataPointsHeight1, dataPointsColor1, dataPointsRadius1, textColor1, textFontSize1, startIndex1, endIndex1, false, showValuesAsDataPointsText, cumulativeSpacing1, 0)
934
1033
  : renderLine(containerHeightIncludingBelowXAxis, zIndex1, points, thickness1, color1, fillPoints, startFillColor1, endFillColor1, startOpacity1, endOpacity1, strokeDashArray1, props.showArrow1 || props.showArrows, arrow1Points, arrowStrokeWidth1, arrowStrokeColor1, arrowFillColor1, hideDataPoints1, data, props.data, dataPointsShape1, dataPointsWidth1, dataPointsHeight1, dataPointsColor1, dataPointsRadius1, textColor1, textFontSize1, startIndex1, endIndex1, false, showValuesAsDataPointsText, cumulativeSpacing1, 0), secondaryPoints
935
1034
  ? isAnimated
936
- ? renderAnimatedLine(containerHeightIncludingBelowXAxis, secondaryLineConfig.zIndex, secondaryPoints, widthValue, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_h = secondaryLineConfig.arrowConfig) === null || _h === void 0 ? void 0 : _h.strokeWidth, (_j = secondaryLineConfig.arrowConfig) === null || _j === void 0 ? void 0 : _j.strokeColor, (_k = secondaryLineConfig.arrowConfig) === null || _k === void 0 ? void 0 : _k.fillColor, secondaryLineConfig.hideDataPoints, secondaryData, props.secondaryData, secondaryLineConfig.dataPointsShape, secondaryLineConfig.dataPointsWidth, secondaryLineConfig.dataPointsHeight, secondaryLineConfig.dataPointsColor, secondaryLineConfig.dataPointsRadius, secondaryLineConfig.textColor, secondaryLineConfig.textFontSize, secondaryLineConfig.startIndex, secondaryLineConfig.endIndex, true, secondaryLineConfig.showValuesAsDataPointsText, cumulativeSpacingSecondary, 6)
937
- : renderLine(containerHeightIncludingBelowXAxis, secondaryLineConfig.zIndex, secondaryPoints, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_l = secondaryLineConfig.arrowConfig) === null || _l === void 0 ? void 0 : _l.strokeWidth, (_m = secondaryLineConfig.arrowConfig) === null || _m === void 0 ? void 0 : _m.strokeColor, (_o = secondaryLineConfig.arrowConfig) === null || _o === void 0 ? void 0 : _o.fillColor, secondaryLineConfig.hideDataPoints, secondaryData, props.secondaryData, secondaryLineConfig.dataPointsShape, secondaryLineConfig.dataPointsWidth, secondaryLineConfig.dataPointsHeight, secondaryLineConfig.dataPointsColor, secondaryLineConfig.dataPointsRadius, secondaryLineConfig.textColor, secondaryLineConfig.textFontSize, secondaryLineConfig.startIndex, secondaryLineConfig.endIndex, true, secondaryLineConfig.showValuesAsDataPointsText, cumulativeSpacingSecondary, 6)
1035
+ ? renderAnimatedLine(containerHeightIncludingBelowXAxis, secondaryLineConfig.zIndex, secondaryPoints, widthValue, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_h = secondaryLineConfig.arrowConfig) === null || _h === void 0 ? void 0 : _h.strokeWidth, (_j = secondaryLineConfig.arrowConfig) === null || _j === void 0 ? void 0 : _j.strokeColor, (_k = secondaryLineConfig.arrowConfig) === null || _k === void 0 ? void 0 : _k.fillColor, secondaryLineConfig.hideDataPoints, secondaryData, props.secondaryData, secondaryLineConfig.dataPointsShape, secondaryLineConfig.dataPointsWidth, secondaryLineConfig.dataPointsHeight, secondaryLineConfig.dataPointsColor, secondaryLineConfig.dataPointsRadius, secondaryLineConfig.textColor, secondaryLineConfig.textFontSize, secondaryLineConfig.startIndex, secondaryLineConfig.endIndex, true, secondaryLineConfig.showValuesAsDataPointsText, cumulativeSpacingSecondary, 6666)
1036
+ : renderLine(containerHeightIncludingBelowXAxis, secondaryLineConfig.zIndex, secondaryPoints, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_l = secondaryLineConfig.arrowConfig) === null || _l === void 0 ? void 0 : _l.strokeWidth, (_m = secondaryLineConfig.arrowConfig) === null || _m === void 0 ? void 0 : _m.strokeColor, (_o = secondaryLineConfig.arrowConfig) === null || _o === void 0 ? void 0 : _o.fillColor, secondaryLineConfig.hideDataPoints, secondaryData, props.secondaryData, secondaryLineConfig.dataPointsShape, secondaryLineConfig.dataPointsWidth, secondaryLineConfig.dataPointsHeight, secondaryLineConfig.dataPointsColor, secondaryLineConfig.dataPointsRadius, secondaryLineConfig.textColor, secondaryLineConfig.textFontSize, secondaryLineConfig.startIndex, secondaryLineConfig.endIndex, true, secondaryLineConfig.showValuesAsDataPointsText, cumulativeSpacingSecondary, 6666)
938
1037
  : null, points2
939
1038
  ? isAnimated
940
1039
  ? renderAnimatedLine(containerHeightIncludingBelowXAxis, zIndex2, points2, widthValue2, thickness2, color2, fillPoints2, startFillColor2, endFillColor2, startOpacity2, endOpacity2, strokeDashArray2, props.showArrow2 || props.showArrows, arrow2Points, arrowStrokeWidth2, arrowStrokeColor2, arrowFillColor2, hideDataPoints2, data2, props.data2, dataPointsShape2, dataPointsWidth2, dataPointsHeight2, dataPointsColor2, dataPointsRadius2, textColor2, textFontSize2, startIndex2, endIndex2, false, showValuesAsDataPointsText, cumulativeSpacing2, 1)
@@ -962,7 +1061,7 @@ export var LineChart = function (props) {
962
1061
  zIndex: 20,
963
1062
  }, children: [!stripOverPointer && renderStripAndLabel(), dataSet ? (renderPointer(0, true)) : (
964
1063
  // dataSet.map((set, index) => renderPointer(index))
965
- _jsxs(_Fragment, { children: [renderPointer(1), points2 ? renderPointer(2) : null, points3 ? renderPointer(3) : null, points4 ? renderPointer(4) : null, points5 ? renderPointer(5) : null, secondaryPoints ? renderPointer(6) : null, stripOverPointer && renderStripAndLabel()] }))] })) : null, (data0 !== null && data0 !== void 0 ? data0 : data).map(function (item, index) {
1064
+ _jsxs(_Fragment, { children: [renderPointer(1), points2 ? renderPointer(2) : null, points3 ? renderPointer(3) : null, points4 ? renderPointer(4) : null, points5 ? renderPointer(5) : null, secondaryPoints ? renderPointer(6666) : null, stripOverPointer && renderStripAndLabel()] }))] })) : null, (data0 !== null && data0 !== void 0 ? data0 : data).map(function (item, index) {
966
1065
  var _a, _b, _c, _d, _e, _f;
967
1066
  var secondaryLabel = (_c = (_a = item.secondaryLabel) !== null && _a !== void 0 ? _a : (_b = secondaryXAxis === null || secondaryXAxis === void 0 ? void 0 : secondaryXAxis.labelTexts) === null || _b === void 0 ? void 0 : _b[index]) !== null && _c !== void 0 ? _c : '';
968
1067
  var secondaryLabelTextStyle = (_f = (_e = (_d = item.secondaryLabelTextStyle) !== null && _d !== void 0 ? _d : secondaryXAxis === null || secondaryXAxis === void 0 ? void 0 : secondaryXAxis.labelsTextStyle) !== null && _e !== void 0 ? _e : item.labelTextStyle) !== null && _f !== void 0 ? _f : props.xAxisLabelTextStyle;
@@ -992,5 +1091,5 @@ export var LineChart = function (props) {
992
1091
  pointerItem5,
993
1092
  ].filter(function (item) { return !!item; }), pointerIndex) })) : null] }));
994
1093
  };
995
- return (_jsx(BarAndLineChartsWrapper, __assign({}, barAndLineChartsWrapperProps, { dataSet: props.dataSet, scrollRef: scrollRef, animatedWidth: widthValue, renderChartContent: renderChartContent, remainingScrollViewProps: remainingScrollViewProps })));
1094
+ return (_jsx(BarAndLineChartsWrapper, __assign({}, barAndLineChartsWrapperProps, { dataSet: dataSet, scrollRef: scrollRef, animatedWidth: widthValue, renderChartContent: renderChartContent, remainingScrollViewProps: remainingScrollViewProps })));
996
1095
  };
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Platform, View } from 'react-native';
14
14
  import { PieChartMain } from './main';
15
- import { pieColors, usePieChart } from 'gifted-charts-core';
15
+ import { usePieChart } from 'gifted-charts-core';
16
16
  export var PieChart = function (props) {
17
17
  var _a = usePieChart(props), radius = _a.radius, extraRadius = _a.extraRadius, selectedIndex = _a.selectedIndex, setSelectedIndex = _a.setSelectedIndex, startAngle = _a.startAngle, total = _a.total, donut = _a.donut, isThreeD = _a.isThreeD, semiCircle = _a.semiCircle, inwardExtraLengthForFocused = _a.inwardExtraLengthForFocused, canvasWidth = _a.canvasWidth, canvasHeight = _a.canvasHeight, innerRadius = _a.innerRadius, innerCircleColor = _a.innerCircleColor, innerCircleBorderWidth = _a.innerCircleBorderWidth, innerCircleBorderColor = _a.innerCircleBorderColor, shiftInnerCenterX = _a.shiftInnerCenterX, shiftInnerCenterY = _a.shiftInnerCenterY, tiltAngle = _a.tiltAngle, isDataShifted = _a.isDataShifted, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical;
18
18
  var renderInnerCircle = function (innerRadius, innerCircleBorderWidth) {
@@ -79,17 +79,7 @@ export var PieChart = function (props) {
79
79
  left: -extraRadius,
80
80
  zIndex: Platform.OS === 'web' ? -1 : 0, // was not getting displayed in web (using Expo)
81
81
  }, children: _jsx(PieChartMain, __assign({}, props, { data: [
82
- {
83
- value: props.data[selectedIndex].value,
84
- text: props.data[selectedIndex].text,
85
- color: props.data[selectedIndex].color ||
86
- pieColors[selectedIndex % 9],
87
- strokeColor: props.data[selectedIndex].strokeColor || undefined,
88
- strokeWidth: props.data[selectedIndex].strokeWidth || undefined,
89
- gradientCenterColor: props.data[selectedIndex].gradientCenterColor || undefined,
90
- shiftTextX: props.data[selectedIndex].shiftTextX || undefined,
91
- shiftTextY: props.data[selectedIndex].shiftTextY || undefined,
92
- },
82
+ __assign({}, props.data[selectedIndex]),
93
83
  {
94
84
  value: total - props.data[selectedIndex].value,
95
85
  // onPress: () => alert('black'),
package/dist/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export { PieChartPro } from './PieChartPro';
4
4
  export { LineChart } from './LineChart';
5
5
  export { LineChartBicolor } from './LineChart/LineChartBicolor';
6
6
  export { PopulationPyramid } from './PopulationPyramid';
7
- export { type barDataItem, type stackDataItem, type BarChartPropsType, type StackedBarChartPropsType, type pieDataItem, type PieChartPropsType, type lineDataItem, type bicolorLineDataItem, type LineChartPropsType, type LineChartBicolorPropsType, type popnPyramidDataItem, type PopulationPyramidPropsType, chartTypes, ruleTypes, yAxisSides, EdgePosition, type DataSet, type Linecap } from 'gifted-charts-core';
7
+ export { type barDataItem, type barDataItemNullSafe, type stackDataItem, type BarChartPropsType, type StackedBarChartPropsType, type pieDataItem, type PieChartPropsType, type lineDataItem, type lineDataItemNullSafe, type bicolorLineDataItem, type LineChartPropsType, type LineChartBicolorPropsType, type popnPyramidDataItem, type PopulationPyramidPropsType, chartTypes, ruleTypes, yAxisSides, EdgePosition, type DataSet, type DataSetNullSafe, type Linecap, } from 'gifted-charts-core';
package/dist/index.js CHANGED
@@ -4,4 +4,4 @@ export { PieChartPro } from './PieChartPro';
4
4
  export { LineChart } from './LineChart';
5
5
  export { LineChartBicolor } from './LineChart/LineChartBicolor';
6
6
  export { PopulationPyramid } from './PopulationPyramid';
7
- export { chartTypes, ruleTypes, yAxisSides, EdgePosition } from 'gifted-charts-core';
7
+ export { chartTypes, ruleTypes, yAxisSides, EdgePosition, } from 'gifted-charts-core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gifted-charts",
3
- "version": "1.4.47",
3
+ "version": "1.4.49",
4
4
  "description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -9,6 +9,7 @@
9
9
  "scripts": {
10
10
  "android": "react-native run-android",
11
11
  "build": "rm -rf ./dist && tsc -p . && ./build.sh",
12
+ "prepare": "npm run build",
12
13
  "ios": "react-native run-ios",
13
14
  "start": "react-native start",
14
15
  "test": "jest",
@@ -25,7 +26,7 @@
25
26
  "registry": "https://registry.npmjs.org/"
26
27
  },
27
28
  "dependencies": {
28
- "gifted-charts-core": "0.1.47"
29
+ "gifted-charts-core": "0.1.50"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@babel/cli": "^7.24.8",