react-native-gifted-charts 1.4.21 → 1.4.23
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.
- package/dist/BarChart/Animated2DWithGradient.d.ts +3 -0
- package/dist/BarChart/Animated2DWithGradient.js +113 -1
- package/dist/BarChart/RenderBars.d.ts +3 -0
- package/dist/BarChart/RenderBars.js +264 -1
- package/dist/BarChart/RenderStackBars.d.ts +3 -0
- package/dist/BarChart/RenderStackBars.js +174 -1
- package/dist/BarChart/index.d.ts +2 -0
- package/dist/BarChart/index.js +236 -1
- package/dist/BarChart/styles.d.ts +45 -0
- package/dist/BarChart/styles.js +46 -1
- package/dist/Components/AnimatedThreeDBar/index.d.ts +3 -0
- package/dist/Components/AnimatedThreeDBar/index.js +129 -1
- package/dist/Components/AnimatedThreeDBar/styles.d.ts +10 -0
- package/dist/Components/AnimatedThreeDBar/styles.js +13 -1
- package/dist/Components/BarAndLineChartsWrapper/index.d.ts +3 -0
- package/dist/Components/BarAndLineChartsWrapper/index.js +128 -1
- package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.d.ts +2 -0
- package/dist/Components/BarAndLineChartsWrapper/renderHorizSections.js +322 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.d.ts +3 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.js +76 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.d.ts +2 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.js +50 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.d.ts +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.js +25 -1
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.d.ts +1 -0
- package/dist/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.js +20 -1
- package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.d.ts +2 -0
- package/dist/Components/BarAndLineChartsWrapper/renderVerticalLines.js +94 -1
- package/dist/Components/BarSpecificComponents/barBackgroundPattern.d.ts +2 -0
- package/dist/Components/BarSpecificComponents/barBackgroundPattern.js +9 -1
- package/dist/Components/BarSpecificComponents/cap.d.ts +2 -0
- package/dist/Components/BarSpecificComponents/cap.js +16 -1
- package/dist/Components/BarSpecificComponents/tooltip.d.ts +15 -0
- package/dist/Components/BarSpecificComponents/tooltip.js +40 -1
- package/dist/Components/common/LinearGradient.d.ts +16 -0
- package/dist/Components/common/LinearGradient.js +15 -1
- package/dist/Components/common/Pointer.d.ts +1 -0
- package/dist/Components/common/Pointer.js +16 -1
- package/dist/Components/common/StripAndLabel.d.ts +2 -0
- package/dist/Components/common/StripAndLabel.js +43 -1
- package/dist/Components/lineSvg.d.ts +14 -0
- package/dist/Components/lineSvg.js +22 -1
- package/dist/LineChart/LineChartBicolor.d.ts +2 -0
- package/dist/LineChart/LineChartBicolor.js +294 -1
- package/dist/LineChart/index.d.ts +2 -0
- package/dist/LineChart/index.js +1110 -1
- package/dist/LineChart/previous.d.ts +2 -0
- package/dist/LineChart/previous.js +9 -0
- package/dist/LineChart/styles.d.ts +43 -0
- package/dist/LineChart/styles.js +46 -1
- package/dist/PieChart/index.d.ts +2 -0
- package/dist/PieChart/index.js +99 -1
- package/dist/PieChart/main.d.ts +2 -0
- package/dist/PieChart/main.js +182 -1
- package/dist/PieChartPro/index.d.ts +2 -0
- package/dist/PieChartPro/index.js +124 -1
- package/dist/PopulationPyramid/index.d.ts +2 -0
- package/dist/PopulationPyramid/index.js +130 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +20 -1
- package/package.json +3 -3
|
@@ -1 +1,129 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
+
if (!m) return o;
|
|
4
|
+
var i = m.call(o), r, ar = [], e;
|
|
5
|
+
try {
|
|
6
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
+
}
|
|
8
|
+
catch (error) { e = { error: error }; }
|
|
9
|
+
finally {
|
|
10
|
+
try {
|
|
11
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
+
}
|
|
13
|
+
finally { if (e) throw e.error; }
|
|
14
|
+
}
|
|
15
|
+
return ar;
|
|
16
|
+
};
|
|
17
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { useEffect, useState } from 'react';
|
|
19
|
+
import { View, StyleSheet, LayoutAnimation, Platform, UIManager, Text, } from 'react-native';
|
|
20
|
+
import Svg, { Defs, Rect } from 'react-native-svg';
|
|
21
|
+
import { styles } from './styles';
|
|
22
|
+
import LinearGradient from "../common/LinearGradient";
|
|
23
|
+
import { useAnimatedThreeDBar, } from 'gifted-charts-core';
|
|
24
|
+
if (Platform.OS === 'android') {
|
|
25
|
+
UIManager.setLayoutAnimationEnabledExperimental &&
|
|
26
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
27
|
+
}
|
|
28
|
+
var TriangleCorner = function (props) {
|
|
29
|
+
return (_jsx(View, { style: [
|
|
30
|
+
triangleStyles.triangleCorner,
|
|
31
|
+
props.style,
|
|
32
|
+
{
|
|
33
|
+
borderRightWidth: props.width / 2,
|
|
34
|
+
borderTopWidth: props.width / 2,
|
|
35
|
+
borderTopColor: props.color,
|
|
36
|
+
},
|
|
37
|
+
] }));
|
|
38
|
+
};
|
|
39
|
+
var triangleStyles = StyleSheet.create({
|
|
40
|
+
triangleCorner: {
|
|
41
|
+
width: 0,
|
|
42
|
+
height: 0,
|
|
43
|
+
backgroundColor: 'transparent',
|
|
44
|
+
borderStyle: 'solid',
|
|
45
|
+
borderRightColor: 'transparent',
|
|
46
|
+
transform: [{ rotate: '90deg' }],
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
var AnimatedThreeDBar = function (props) {
|
|
50
|
+
var _a;
|
|
51
|
+
var heightCopy = props.height;
|
|
52
|
+
var _b = __read(useState(props.isAnimated ? (Platform.OS === 'ios' ? 0 : 20) : heightCopy), 2), height = _b[0], setHeight = _b[1];
|
|
53
|
+
var isAnimated = props.isAnimated, animationDuration = props.animationDuration, item = props.item, index = props.index, barWidth = props.barWidth, sideWidth = props.sideWidth, barStyle = props.barStyle, barBackgroundPattern = props.barBackgroundPattern, barInnerComponent = props.barInnerComponent, patternId = props.patternId, intactTopLabel = props.intactTopLabel, showValuesAsTopLabel = props.showValuesAsTopLabel, topLabelContainerStyle = props.topLabelContainerStyle, topLabelTextStyle = props.topLabelTextStyle;
|
|
54
|
+
var _c = useAnimatedThreeDBar(props), showGradient = _c.showGradient, gradientColor = _c.gradientColor, frontColor = _c.frontColor, sideColor = _c.sideColor, topColor = _c.topColor, opacity = _c.opacity, initialRender = _c.initialRender, setInitialRender = _c.setInitialRender;
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
if (isAnimated) {
|
|
57
|
+
if (initialRender) {
|
|
58
|
+
setTimeout(function () {
|
|
59
|
+
layoutAppear();
|
|
60
|
+
}, 20);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
elevate();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, [props.height]);
|
|
67
|
+
var elevate = function () {
|
|
68
|
+
LayoutAnimation.configureNext({
|
|
69
|
+
duration: animationDuration,
|
|
70
|
+
update: { type: 'linear', property: 'scaleY' },
|
|
71
|
+
});
|
|
72
|
+
setHeight(props.height);
|
|
73
|
+
};
|
|
74
|
+
var layoutAppear = function () {
|
|
75
|
+
LayoutAnimation.configureNext({
|
|
76
|
+
duration: Platform.OS == 'ios' ? animationDuration : 20,
|
|
77
|
+
create: { type: 'linear', property: 'scaleY' },
|
|
78
|
+
// update: { type: 'linear' }
|
|
79
|
+
});
|
|
80
|
+
setInitialRender(false);
|
|
81
|
+
setTimeout(function () { return elevate(); }, Platform.OS == 'ios' ? 10 : 100);
|
|
82
|
+
};
|
|
83
|
+
return (_jsx(View, { style: styles.container, children: !initialRender && (_jsxs(View, { style: [
|
|
84
|
+
styles.row,
|
|
85
|
+
{ opacity: opacity, position: 'absolute', bottom: 0 },
|
|
86
|
+
props.side === 'right' && { transform: [{ rotateY: '180deg' }] },
|
|
87
|
+
], children: [props.height ? (_jsxs(_Fragment, { children: [_jsx(View, { style: { position: 'absolute', top: sideWidth / -2 }, children: _jsx(TriangleCorner, { color: topColor, width: sideWidth, style: { transform: [{ rotate: '90deg' }], opacity: opacity } }) }), _jsx(View, { style: { position: 'absolute', top: sideWidth / -2 }, children: _jsx(View, { style: {
|
|
88
|
+
width: barWidth,
|
|
89
|
+
height: barWidth,
|
|
90
|
+
// left: width / 2,
|
|
91
|
+
backgroundColor: topColor,
|
|
92
|
+
opacity: opacity,
|
|
93
|
+
} }) }), _jsx(View, { style: {
|
|
94
|
+
position: 'absolute',
|
|
95
|
+
top: sideWidth / -2,
|
|
96
|
+
left: barWidth - 1,
|
|
97
|
+
}, children: _jsx(TriangleCorner, { color: topColor, width: sideWidth, style: { transform: [{ rotate: '-90deg' }], opacity: opacity } }) })] })) : null, _jsxs(View, { style: { marginTop: sideWidth / -2 - 1 }, children: [_jsx(TriangleCorner, { color: height ? sideColor : 'transparent', width: sideWidth, style: { transform: [{ rotate: '-90deg' }], opacity: opacity } }), _jsx(View, { style: {
|
|
98
|
+
width: sideWidth / 2 + 1,
|
|
99
|
+
height: height - sideWidth / 2, //animatedSideHeight
|
|
100
|
+
backgroundColor: sideColor,
|
|
101
|
+
opacity: opacity,
|
|
102
|
+
} }), _jsx(TriangleCorner, { color: height ? sideColor : 'transparent', width: sideWidth + 1, style: { transform: [{ rotate: '90deg' }], opacity: opacity } })] }), _jsxs(View, { style: [
|
|
103
|
+
{
|
|
104
|
+
width: barWidth,
|
|
105
|
+
height: height, //animatedHeight
|
|
106
|
+
backgroundColor: frontColor,
|
|
107
|
+
borderLeftWidth: StyleSheet.hairlineWidth,
|
|
108
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
109
|
+
borderColor: 'white',
|
|
110
|
+
opacity: opacity,
|
|
111
|
+
},
|
|
112
|
+
item.barStyle || barStyle,
|
|
113
|
+
], children: [showGradient && (_jsx(LinearGradient, { style: { position: 'absolute', width: '100%', height: '100%' }, start: { x: 0, y: 0 }, end: { x: 1, y: 1 }, colors: [gradientColor, frontColor] })), barBackgroundPattern && (_jsxs(Svg, { children: [_jsx(Defs, { children: barBackgroundPattern() }), _jsx(Rect, { stroke: "transparent", x: "1", y: "1", width: barWidth || 30, height: height, fill: "url(#".concat(patternId, ")") })] })), barInnerComponent ? (_jsx(View, { style: { height: '100%', width: '100%' }, children: barInnerComponent(item, index) })) : null] }), (item.topLabelComponent || showValuesAsTopLabel) && (_jsx(View, { style: [
|
|
114
|
+
{
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
top: barWidth * -2,
|
|
117
|
+
height: (barWidth * 3) / 2,
|
|
118
|
+
width: (barWidth * 3) / 2,
|
|
119
|
+
justifyContent: 'flex-end',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
opacity: opacity,
|
|
122
|
+
},
|
|
123
|
+
props.horizontal &&
|
|
124
|
+
!intactTopLabel && { transform: [{ rotate: '270deg' }] },
|
|
125
|
+
props.side === 'right' && { transform: [{ rotateY: '180deg' }] },
|
|
126
|
+
topLabelContainerStyle !== null && topLabelContainerStyle !== void 0 ? topLabelContainerStyle : item.topLabelContainerStyle,
|
|
127
|
+
], children: showValuesAsTopLabel ? (_jsx(Text, { style: topLabelTextStyle, children: item.value })) : ((_a = item.topLabelComponent) === null || _a === void 0 ? void 0 : _a.call(item)) }))] })) }));
|
|
128
|
+
};
|
|
129
|
+
export default AnimatedThreeDBar;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
export var styles = StyleSheet.create({
|
|
3
|
+
container: {
|
|
4
|
+
flex: 1,
|
|
5
|
+
// width: '100%',
|
|
6
|
+
// height: '100%',
|
|
7
|
+
justifyContent: 'center',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
},
|
|
10
|
+
row: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -1 +1,128 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment, useEffect } from 'react';
|
|
14
|
+
import { View, ScrollView, StyleSheet, I18nManager } from 'react-native';
|
|
15
|
+
import { renderHorizSections } from './renderHorizSections';
|
|
16
|
+
import RenderLineInBarChart from './renderLineInBarChart';
|
|
17
|
+
import RenderVerticalLines from './renderVerticalLines';
|
|
18
|
+
import { chartTypes, yAxisSides, useBarAndLineChartsWrapper, } from 'gifted-charts-core';
|
|
19
|
+
var BarAndLineChartsWrapper = function (props) {
|
|
20
|
+
var _a, _b, _c, _d, _e;
|
|
21
|
+
var chartType = props.chartType, containerHeight = props.containerHeight, noOfSectionsBelowXAxis = props.noOfSectionsBelowXAxis, stepHeight = props.stepHeight, labelsExtraHeight = props.labelsExtraHeight, yAxisLabelWidth = props.yAxisLabelWidth, horizontal = props.horizontal, scrollRef = props.scrollRef, initialSpacing = props.initialSpacing, data = props.data, barWidth = props.barWidth, xAxisThickness = props.xAxisThickness, totalWidth = props.totalWidth, disableScroll = props.disableScroll, showScrollIndicator = props.showScrollIndicator, scrollToEnd = props.scrollToEnd, scrollToIndex = props.scrollToIndex, scrollAnimation = props.scrollAnimation, indicatorColor = props.indicatorColor, spacing = props.spacing, showLine = props.showLine, points2 = props.points2, renderChartContent = props.renderChartContent, remainingScrollViewProps = props.remainingScrollViewProps, endSpacing = props.endSpacing, hideAxesAndRules = props.hideAxesAndRules, showXAxisIndices = props.showXAxisIndices, xAxisIndicesHeight = props.xAxisIndicesHeight, xAxisIndicesWidth = props.xAxisIndicesWidth, xAxisIndicesColor = props.xAxisIndicesColor, pointerConfig = props.pointerConfig, getPointerProps = props.getPointerProps, pointerIndex = props.pointerIndex, pointerX = props.pointerX, pointerY = props.pointerY, onEndReached = props.onEndReached, onStartReached = props.onStartReached, onMomentumScrollEnd = props.onMomentumScrollEnd, nestedScrollEnabled = props.nestedScrollEnabled, _f = props.extraWidthDueToDataPoint, extraWidthDueToDataPoint = _f === void 0 ? 0 : _f;
|
|
22
|
+
var _g = useBarAndLineChartsWrapper(__assign(__assign({}, props), { isRTL: I18nManager.isRTL })), containerHeightIncludingBelowXAxis = _g.containerHeightIncludingBelowXAxis, xAxisLabelsVerticalShift = _g.xAxisLabelsVerticalShift, trimYAxisAtTop = _g.trimYAxisAtTop, yAxisExtraHeight = _g.yAxisExtraHeight, overflowTop = _g.overflowTop, xAxisLabelsHeight = _g.xAxisLabelsHeight, xAxisTextNumberOfLines = _g.xAxisTextNumberOfLines, actualContainerWidth = _g.actualContainerWidth, transformForHorizontal = _g.transformForHorizontal, horizSectionProps = _g.horizSectionProps, referenceLinesOverChartContent = _g.referenceLinesOverChartContent, setCanMomentum = _g.setCanMomentum, isCloseToStart = _g.isCloseToStart, isCloseToEnd = _g.isCloseToEnd, canMomentum = _g.canMomentum, yAxisAtTop = _g.yAxisAtTop, yAxisThickness = _g.yAxisThickness, yAxisSide = _g.yAxisSide, showVerticalLines = _g.showVerticalLines, verticalLinesProps = _g.verticalLinesProps, lineInBarChartProps = _g.lineInBarChartProps, lineInBarChartProps2 = _g.lineInBarChartProps2;
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
if (pointerConfig && getPointerProps) {
|
|
25
|
+
getPointerProps({ pointerIndex: pointerIndex, pointerX: pointerX, pointerY: pointerY });
|
|
26
|
+
}
|
|
27
|
+
}, [pointerIndex, pointerX, pointerY]);
|
|
28
|
+
/*******************************************************************************************************************************************/
|
|
29
|
+
/*******************************************************************************************************************************************/
|
|
30
|
+
var styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
width: '100%',
|
|
33
|
+
height: containerHeightIncludingBelowXAxis +
|
|
34
|
+
labelsExtraHeight +
|
|
35
|
+
xAxisLabelsVerticalShift +
|
|
36
|
+
(trimYAxisAtTop ? 0 : yAxisExtraHeight) +
|
|
37
|
+
50 -
|
|
38
|
+
overflowTop,
|
|
39
|
+
marginTop: trimYAxisAtTop ? containerHeight / 20 : 0,
|
|
40
|
+
marginBottom: (xAxisLabelsHeight !== null && xAxisLabelsHeight !== void 0 ? xAxisLabelsHeight : xAxisTextNumberOfLines * 18) - 55, //This is to not let the Things that should be rendered below the chart overlap with it
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return (_jsxs(View, { style: [
|
|
44
|
+
styles.container,
|
|
45
|
+
horizontal && {
|
|
46
|
+
width: actualContainerWidth,
|
|
47
|
+
transform: transformForHorizontal,
|
|
48
|
+
},
|
|
49
|
+
], children: [hideAxesAndRules !== true
|
|
50
|
+
? renderHorizSections(__assign(__assign({}, horizSectionProps), { onlyReferenceLines: false, renderReferenceLines: !referenceLinesOverChartContent }))
|
|
51
|
+
: null, _jsx(ScrollView, __assign({ onScrollBeginDrag: function () {
|
|
52
|
+
setCanMomentum(true);
|
|
53
|
+
}, nestedScrollEnabled: nestedScrollEnabled, onMomentumScrollEnd: function (_a) {
|
|
54
|
+
var nativeEvent = _a.nativeEvent;
|
|
55
|
+
if (onMomentumScrollEnd) {
|
|
56
|
+
onMomentumScrollEnd();
|
|
57
|
+
}
|
|
58
|
+
if (isCloseToEnd(nativeEvent) && canMomentum) {
|
|
59
|
+
onEndReached ? onEndReached() : null;
|
|
60
|
+
setCanMomentum(false);
|
|
61
|
+
}
|
|
62
|
+
if (isCloseToStart(nativeEvent) && canMomentum) {
|
|
63
|
+
onStartReached ? onStartReached() : null;
|
|
64
|
+
setCanMomentum(false);
|
|
65
|
+
}
|
|
66
|
+
}, scrollEventThrottle: props.scrollEventThrottle ? props.scrollEventThrottle : 16, horizontal: true, ref: scrollRef, style: [
|
|
67
|
+
{
|
|
68
|
+
marginLeft: horizontal && !yAxisAtTop
|
|
69
|
+
? -yAxisThickness -
|
|
70
|
+
(props.width ? 20 : 0) -
|
|
71
|
+
((_c = (_b = (_a = data[data.length - 1]) === null || _a === void 0 ? void 0 : _a.barWidth) !== null && _b !== void 0 ? _b : barWidth) !== null && _c !== void 0 ? _c : 0) / 2
|
|
72
|
+
: yAxisSide === yAxisSides.RIGHT
|
|
73
|
+
? 0
|
|
74
|
+
: yAxisLabelWidth + yAxisThickness,
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
bottom: chartType === chartTypes.LINE_BI_COLOR ? 0 : xAxisThickness,
|
|
77
|
+
},
|
|
78
|
+
!!props.width && { width: props.width + extraWidthDueToDataPoint },
|
|
79
|
+
horizontal && {
|
|
80
|
+
width: ((_d = props.width) !== null && _d !== void 0 ? _d : totalWidth) + (props.width ? endSpacing : -20),
|
|
81
|
+
},
|
|
82
|
+
], contentContainerStyle: [
|
|
83
|
+
{
|
|
84
|
+
height: containerHeightIncludingBelowXAxis +
|
|
85
|
+
yAxisExtraHeight +
|
|
86
|
+
labelsExtraHeight +
|
|
87
|
+
(50 + xAxisLabelsVerticalShift),
|
|
88
|
+
width: Math.max((_e = props.width) !== null && _e !== void 0 ? _e : 0, totalWidth - spacing + endSpacing) +
|
|
89
|
+
extraWidthDueToDataPoint,
|
|
90
|
+
paddingLeft: initialSpacing,
|
|
91
|
+
paddingBottom: noOfSectionsBelowXAxis * stepHeight + labelsExtraHeight,
|
|
92
|
+
alignItems: 'flex-end',
|
|
93
|
+
},
|
|
94
|
+
!props.width && { width: totalWidth },
|
|
95
|
+
], scrollEnabled: !disableScroll, showsHorizontalScrollIndicator: showScrollIndicator, indicatorStyle: indicatorColor, onContentSizeChange: function () {
|
|
96
|
+
if (scrollRef.current && scrollToEnd) {
|
|
97
|
+
scrollRef.current.scrollToEnd({ animated: scrollAnimation });
|
|
98
|
+
}
|
|
99
|
+
else if (scrollRef.current && scrollToIndex) {
|
|
100
|
+
scrollRef.current.scrollTo({
|
|
101
|
+
x: initialSpacing +
|
|
102
|
+
((barWidth !== null && barWidth !== void 0 ? barWidth : 0) + spacing) * scrollToIndex -
|
|
103
|
+
spacing,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
} }, remainingScrollViewProps, { children: _jsxs(Fragment, { children: [showVerticalLines ? (_jsx(RenderVerticalLines, __assign({}, verticalLinesProps))) : null,
|
|
107
|
+
// Only For Bar Charts-
|
|
108
|
+
showLine ? _jsx(RenderLineInBarChart, __assign({}, lineInBarChartProps)) : null,
|
|
109
|
+
// Only For Bar Charts-
|
|
110
|
+
showLine && (points2 === null || points2 === void 0 ? void 0 : points2.length) ? (_jsx(RenderLineInBarChart, __assign({}, lineInBarChartProps2))) : null,
|
|
111
|
+
// Only For Line Charts-
|
|
112
|
+
chartType === chartTypes.LINE &&
|
|
113
|
+
data.map(function (item, index) {
|
|
114
|
+
return showXAxisIndices || item.showXAxisIndex ? (_jsx(View, { style: {
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
height: xAxisIndicesHeight,
|
|
117
|
+
width: xAxisIndicesWidth,
|
|
118
|
+
backgroundColor: xAxisIndicesColor,
|
|
119
|
+
bottom: 60 - xAxisIndicesHeight / 2,
|
|
120
|
+
left: index * spacing +
|
|
121
|
+
(initialSpacing - xAxisIndicesWidth / 2) -
|
|
122
|
+
3,
|
|
123
|
+
} }, index + '' + item.value)) : null;
|
|
124
|
+
}), renderChartContent()] }) })), referenceLinesOverChartContent
|
|
125
|
+
? renderHorizSections(__assign(__assign({}, horizSectionProps), { onlyReferenceLines: true }))
|
|
126
|
+
: null] }));
|
|
127
|
+
};
|
|
128
|
+
export default BarAndLineChartsWrapper;
|