react-native-gifted-charts 1.4.27 → 1.4.29
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.
|
@@ -68,7 +68,7 @@ var RenderStackBars = function (props) {
|
|
|
68
68
|
setTimeout(function () { return elevate(); }, Platform.OS == 'ios' ? 10 : 100);
|
|
69
69
|
};
|
|
70
70
|
var static2DSimple = function () {
|
|
71
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
71
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
72
72
|
return (_jsxs(_Fragment, { children: [_jsxs(TouchableOpacity, { disabled: disablePress, activeOpacity: activeOpacity, onPress: function () {
|
|
73
73
|
setSelectedIndex(index);
|
|
74
74
|
if (item.onPress) {
|
|
@@ -133,7 +133,7 @@ var RenderStackBars = function (props) {
|
|
|
133
133
|
horizontal &&
|
|
134
134
|
!props.intactTopLabel && { transform: [{ rotate: '270deg' }] },
|
|
135
135
|
item.topLabelContainerStyle,
|
|
136
|
-
], children: showValuesAsTopLabel ? (_jsx(Text, { style: item.topLabelTextStyle, children: item.stacks.reduce(function (acc, stack) { return acc + stack.value; }, 0) })) : ((
|
|
136
|
+
], children: showValuesAsTopLabel ? (_jsx(Text, { style: (_j = item.topLabelTextStyle) !== null && _j !== void 0 ? _j : props.topLabelTextStyle, children: item.stacks.reduce(function (acc, stack) { return acc + stack.value; }, 0) })) : ((_k = item.topLabelComponent) === null || _k === void 0 ? void 0 : _k.call(item)) }))] }));
|
|
137
137
|
};
|
|
138
138
|
var barWrapper = function () {
|
|
139
139
|
return noAnimation ? (static2DSimple()) : (_jsx(View, { style: {
|
|
@@ -121,7 +121,7 @@ var BarAndLineChartsWrapper = function (props) {
|
|
|
121
121
|
(initialSpacing - xAxisIndicesWidth / 2) -
|
|
122
122
|
3,
|
|
123
123
|
} }, index + '' + item.value)) : null;
|
|
124
|
-
}), renderChartContent()] }) })), referenceLinesOverChartContent
|
|
124
|
+
}), renderChartContent(containerHeightIncludingBelowXAxis)] }) })), referenceLinesOverChartContent
|
|
125
125
|
? renderHorizSections(__assign(__assign({}, horizSectionProps), { onlyReferenceLines: true }))
|
|
126
126
|
: null] }));
|
|
127
127
|
};
|
|
@@ -4,8 +4,10 @@ import Rule from '../lineSvg';
|
|
|
4
4
|
import { styles } from '../../LineChart/styles';
|
|
5
5
|
import { getHorizSectionVals, yAxisSides, chartTypes, } from 'gifted-charts-core';
|
|
6
6
|
export var renderHorizSections = function (props) {
|
|
7
|
+
var _a, _b;
|
|
7
8
|
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;
|
|
8
|
-
var
|
|
9
|
+
var _c = getHorizSectionVals(props), secondaryYAxisConfig = _c.secondaryYAxisConfig, horizSections = _c.horizSections, yAxisExtraHeightAtTop = _c.yAxisExtraHeightAtTop, secondaryHorizSections = _c.secondaryHorizSections, showReferenceLine1 = _c.showReferenceLine1, referenceLine1Config = _c.referenceLine1Config, referenceLine1Position = _c.referenceLine1Position, showReferenceLine2 = _c.showReferenceLine2, referenceLine2Config = _c.referenceLine2Config, referenceLine2Position = _c.referenceLine2Position, showReferenceLine3 = _c.showReferenceLine3, referenceLine3Config = _c.referenceLine3Config, referenceLine3Position = _c.referenceLine3Position, horizSectionsBelow = _c.horizSectionsBelow, secondaryHorizSectionsBelow = _c.secondaryHorizSectionsBelow, getLabelTexts = _c.getLabelTexts, getLabelTextsForSecondaryYAxis = _c.getLabelTextsForSecondaryYAxis;
|
|
10
|
+
var secondaryYAxisExtraHeightAtBottom = 10;
|
|
9
11
|
var renderAxesAndRules = function (index) {
|
|
10
12
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
11
13
|
var invertedIndex = horizSections.length - index - 1;
|
|
@@ -79,7 +81,7 @@ export var renderHorizSections = function (props) {
|
|
|
79
81
|
borderRightColor: yAxisColor,
|
|
80
82
|
borderTopColor: (_a = secondaryXAxis === null || secondaryXAxis === void 0 ? void 0 : secondaryXAxis.color) !== null && _a !== void 0 ? _a : xAxisColor,
|
|
81
83
|
borderTopWidth: secondaryXAxis
|
|
82
|
-
? (_b = secondaryXAxis.thickness) !== null && _b !== void 0 ? _b : xAxisThickness
|
|
84
|
+
? ((_b = secondaryXAxis.thickness) !== null && _b !== void 0 ? _b : xAxisThickness)
|
|
83
85
|
: 0,
|
|
84
86
|
backgroundColor: backgroundColor,
|
|
85
87
|
width: (props.width || totalWidth - spacing) + endSpacing,
|
|
@@ -91,7 +93,7 @@ export var renderHorizSections = function (props) {
|
|
|
91
93
|
};
|
|
92
94
|
var renderSecondaryYaxisLabels = function (horizSections, isBelow) {
|
|
93
95
|
return horizSections.map(function (sectionItems, index) {
|
|
94
|
-
var _a, _b, _c;
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
95
97
|
var label = getLabelTextsForSecondaryYAxis(sectionItems.value, index);
|
|
96
98
|
if (secondaryYAxisConfig.hideOrigin && index === 0) {
|
|
97
99
|
label = '';
|
|
@@ -102,19 +104,22 @@ export var renderHorizSections = function (props) {
|
|
|
102
104
|
{
|
|
103
105
|
position: 'absolute',
|
|
104
106
|
zIndex: 1,
|
|
105
|
-
bottom: (
|
|
106
|
-
(
|
|
107
|
-
|
|
108
|
-
(
|
|
107
|
+
bottom: (index - 0.5) *
|
|
108
|
+
(isBelow
|
|
109
|
+
? ((_b = (_a = secondaryYAxisConfig.negativeStepHeight) !== null && _a !== void 0 ? _a : secondaryYAxisConfig.stepHeight) !== null && _b !== void 0 ? _b : 0)
|
|
110
|
+
: ((_c = secondaryYAxisConfig.stepHeight) !== null && _c !== void 0 ? _c : 0)) +
|
|
111
|
+
(isBelow ? secondaryYAxisExtraHeightAtBottom : 0),
|
|
109
112
|
width: secondaryYAxisConfig.yAxisLabelWidth,
|
|
110
|
-
height:
|
|
113
|
+
height: isBelow
|
|
114
|
+
? ((_e = (_d = secondaryYAxisConfig.negativeStepHeight) !== null && _d !== void 0 ? _d : secondaryYAxisConfig.stepHeight) !== null && _e !== void 0 ? _e : 0)
|
|
115
|
+
: ((_f = secondaryYAxisConfig.stepHeight) !== null && _f !== void 0 ? _f : 0),
|
|
111
116
|
},
|
|
112
117
|
yAxisLabelContainerStyle,
|
|
113
|
-
], children: [secondaryYAxisConfig.showYAxisIndices && index !== 0 ? (_jsx(View, { style: {
|
|
118
|
+
], children: [secondaryYAxisConfig.showYAxisIndices && (index !== 0 || isBelow) ? (_jsx(View, { style: {
|
|
114
119
|
height: secondaryYAxisConfig.yAxisIndicesHeight,
|
|
115
120
|
width: secondaryYAxisConfig.yAxisIndicesWidth,
|
|
116
121
|
position: 'absolute',
|
|
117
|
-
left: ((
|
|
122
|
+
left: ((_g = secondaryYAxisConfig.yAxisIndicesWidth) !== null && _g !== void 0 ? _g : 0) / -2,
|
|
118
123
|
backgroundColor: secondaryYAxisConfig.yAxisIndicesColor,
|
|
119
124
|
} })) : null, _jsx(Text, { numberOfLines: secondaryYAxisConfig.yAxisTextNumberOfLines, ellipsizeMode: 'clip', style: [secondaryYAxisConfig.yAxisTextStyle], children: label })] }, index));
|
|
120
125
|
});
|
|
@@ -307,16 +312,31 @@ export var renderHorizSections = function (props) {
|
|
|
307
312
|
/***********************************************************************************************/
|
|
308
313
|
/************************* Render the secondary Y Axis *********************/
|
|
309
314
|
/***********************************************************************************************/
|
|
310
|
-
secondaryYAxis ? (
|
|
315
|
+
secondaryYAxis ? (_jsx(View, { style: {
|
|
311
316
|
width: secondaryYAxisConfig.yAxisLabelWidth,
|
|
312
317
|
left: width ? yAxisLabelWidth : yAxisLabelWidth - spacing,
|
|
313
318
|
borderColor: secondaryYAxisConfig.yAxisColor,
|
|
314
319
|
borderLeftWidth: secondaryYAxisConfig.yAxisThickness,
|
|
315
320
|
height: containerHeight + yAxisExtraHeightAtTop,
|
|
316
321
|
bottom: stepHeight / -2,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
+
// backgroundColor:'red'
|
|
323
|
+
}, children: !secondaryYAxisConfig.hideYAxisText
|
|
324
|
+
? renderSecondaryYaxisLabels(secondaryHorizSections, false)
|
|
325
|
+
: null })) : null,
|
|
326
|
+
/***********************************************************************************************/
|
|
327
|
+
/************************* Render the secondary Y Axis below origin *********************/
|
|
328
|
+
/***********************************************************************************************/
|
|
329
|
+
secondaryYAxisConfig.noOfSectionsBelowXAxis ? (_jsx(View, { style: {
|
|
330
|
+
width: secondaryYAxisConfig.yAxisLabelWidth,
|
|
331
|
+
left: (width ? yAxisLabelWidth : yAxisLabelWidth - spacing) -
|
|
332
|
+
yAxisLabelWidth,
|
|
333
|
+
borderColor: secondaryYAxisConfig.yAxisColor,
|
|
334
|
+
borderLeftWidth: secondaryYAxisConfig.yAxisThickness,
|
|
335
|
+
height: ((_b = (_a = secondaryYAxisConfig.negativeStepHeight) !== null && _a !== void 0 ? _a : secondaryYAxisConfig.stepHeight) !== null && _b !== void 0 ? _b : stepHeight) *
|
|
336
|
+
secondaryHorizSectionsBelow.length +
|
|
337
|
+
secondaryYAxisExtraHeightAtBottom,
|
|
338
|
+
bottom: -containerHeight - stepHeight * 0.84,
|
|
339
|
+
}, children: !secondaryYAxisConfig.hideYAxisText
|
|
340
|
+
? renderSecondaryYaxisLabels(secondaryHorizSectionsBelow, true)
|
|
341
|
+
: null })) : null] })) }));
|
|
322
342
|
};
|
package/dist/LineChart/index.js
CHANGED
|
@@ -46,7 +46,7 @@ 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, _c
|
|
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,7 @@ 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
|
|
58
|
+
var _d = useLineChart(__assign(__assign({}, props), { parentWidth: (_b = props.parentWidth) !== null && _b !== void 0 ? _b : screenWidth })), 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, 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, activatePointersDelay = _d.activatePointersDelay, persistPointer = _d.persistPointer, hidePointers = _d.hidePointers, hidePointer1 = _d.hidePointer1, hidePointer2 = _d.hidePointer2, hidePointer3 = _d.hidePointer3, hidePointer4 = _d.hidePointer4, hidePointer5 = _d.hidePointer5, hideSecondaryPointer = _d.hideSecondaryPointer, pointerEvents = _d.pointerEvents, focusEnabled = _d.focusEnabled, showDataPointOnFocus = _d.showDataPointOnFocus, showStripOnFocus = _d.showStripOnFocus, 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, lineGradient = _d.lineGradient, lineGradientDirection = _d.lineGradientDirection, lineGradientStartColor = _d.lineGradientStartColor, lineGradientEndColor = _d.lineGradientEndColor, barAndLineChartsWrapperProps = _d.barAndLineChartsWrapperProps, areaChart = _d.areaChart;
|
|
59
59
|
var secondaryXAxis = props.secondaryXAxis, intersectionAreaConfig = props.intersectionAreaConfig;
|
|
60
60
|
var widthValuesFromSet = useMemo(function () { return dataSet === null || dataSet === void 0 ? void 0 : dataSet.map(function (set) { return new Animated.Value(0); }); }, []);
|
|
61
61
|
var animatedPoints = new Animated.Value(0);
|
|
@@ -108,7 +108,7 @@ export var LineChart = function (props) {
|
|
|
108
108
|
var decreaseWidth = useCallback(function () {
|
|
109
109
|
widthValue.setValue(0);
|
|
110
110
|
Animated.timing(widthValue, {
|
|
111
|
-
toValue:
|
|
111
|
+
toValue: totalWidth,
|
|
112
112
|
duration: animationDuration,
|
|
113
113
|
easing: Easing.linear,
|
|
114
114
|
useNativeDriver: false,
|
|
@@ -117,7 +117,7 @@ export var LineChart = function (props) {
|
|
|
117
117
|
var decreaseWidth2 = useCallback(function () {
|
|
118
118
|
widthValue2.setValue(0);
|
|
119
119
|
Animated.timing(widthValue2, {
|
|
120
|
-
toValue:
|
|
120
|
+
toValue: totalWidth,
|
|
121
121
|
duration: animationDuration,
|
|
122
122
|
easing: Easing.linear,
|
|
123
123
|
useNativeDriver: false,
|
|
@@ -126,7 +126,7 @@ export var LineChart = function (props) {
|
|
|
126
126
|
var decreaseWidth3 = useCallback(function () {
|
|
127
127
|
widthValue3.setValue(0);
|
|
128
128
|
Animated.timing(widthValue3, {
|
|
129
|
-
toValue:
|
|
129
|
+
toValue: totalWidth,
|
|
130
130
|
duration: animationDuration,
|
|
131
131
|
easing: Easing.linear,
|
|
132
132
|
useNativeDriver: false,
|
|
@@ -135,7 +135,7 @@ export var LineChart = function (props) {
|
|
|
135
135
|
var decreaseWidth4 = useCallback(function () {
|
|
136
136
|
widthValue4.setValue(0);
|
|
137
137
|
Animated.timing(widthValue4, {
|
|
138
|
-
toValue:
|
|
138
|
+
toValue: totalWidth,
|
|
139
139
|
duration: animationDuration,
|
|
140
140
|
easing: Easing.linear,
|
|
141
141
|
useNativeDriver: false,
|
|
@@ -144,7 +144,7 @@ export var LineChart = function (props) {
|
|
|
144
144
|
var decreaseWidth5 = useCallback(function () {
|
|
145
145
|
widthValue5.setValue(0);
|
|
146
146
|
Animated.timing(widthValue5, {
|
|
147
|
-
toValue:
|
|
147
|
+
toValue: totalWidth,
|
|
148
148
|
duration: animationDuration,
|
|
149
149
|
easing: Easing.linear,
|
|
150
150
|
useNativeDriver: false,
|
|
@@ -156,7 +156,7 @@ export var LineChart = function (props) {
|
|
|
156
156
|
(_a = widthValuesFromSet === null || widthValuesFromSet === void 0 ? void 0 : widthValuesFromSet[index]) === null || _a === void 0 ? void 0 : _a.setValue(0);
|
|
157
157
|
if (widthValuesFromSet === null || widthValuesFromSet === void 0 ? void 0 : widthValuesFromSet[index]) {
|
|
158
158
|
Animated.timing(widthValuesFromSet === null || widthValuesFromSet === void 0 ? void 0 : widthValuesFromSet[index], {
|
|
159
|
-
toValue:
|
|
159
|
+
toValue: totalWidth,
|
|
160
160
|
duration: animationDuration,
|
|
161
161
|
easing: Easing.linear,
|
|
162
162
|
useNativeDriver: false,
|
|
@@ -196,13 +196,11 @@ export var LineChart = function (props) {
|
|
|
196
196
|
]);
|
|
197
197
|
var svgWrapperViewStyle = {
|
|
198
198
|
position: 'absolute',
|
|
199
|
-
|
|
200
|
-
((_c = props.overflowBottom) !== null && _c !== void 0 ? _c : dataPointsRadius1),
|
|
201
|
-
bottom: 60 +
|
|
199
|
+
bottom: 62 +
|
|
202
200
|
xAxisLabelsVerticalShift +
|
|
203
201
|
labelsExtraHeight -
|
|
204
202
|
xAxisThickness -
|
|
205
|
-
((
|
|
203
|
+
((_c = props.overflowBottom) !== null && _c !== void 0 ? _c : dataPointsRadius1),
|
|
206
204
|
zIndex: 1,
|
|
207
205
|
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
|
|
208
206
|
};
|
|
@@ -251,26 +249,6 @@ export var LineChart = function (props) {
|
|
|
251
249
|
rotateLabel && { transform: [{ rotate: '60deg' }] },
|
|
252
250
|
], children: labelComponent ? (labelComponent()) : (_jsx(Text, { style: [{ textAlign: 'center' }, labelTextStyle], numberOfLines: xAxisTextNumberOfLines, children: label })) }));
|
|
253
251
|
};
|
|
254
|
-
var animatedWidth = widthValue.interpolate({
|
|
255
|
-
inputRange: [0, 1],
|
|
256
|
-
outputRange: [0, totalWidth],
|
|
257
|
-
});
|
|
258
|
-
var animatedWidth2 = widthValue2.interpolate({
|
|
259
|
-
inputRange: [0, 1],
|
|
260
|
-
outputRange: [0, totalWidth],
|
|
261
|
-
});
|
|
262
|
-
var animatedWidth3 = widthValue3.interpolate({
|
|
263
|
-
inputRange: [0, 1],
|
|
264
|
-
outputRange: [0, totalWidth],
|
|
265
|
-
});
|
|
266
|
-
var animatedWidth4 = widthValue4.interpolate({
|
|
267
|
-
inputRange: [0, 1],
|
|
268
|
-
outputRange: [0, totalWidth],
|
|
269
|
-
});
|
|
270
|
-
var animatedWidth5 = widthValue5.interpolate({
|
|
271
|
-
inputRange: [0, 1],
|
|
272
|
-
outputRange: [0, totalWidth],
|
|
273
|
-
});
|
|
274
252
|
var onStripPress = function (item, index) {
|
|
275
253
|
if (props.focusedDataPointIndex === undefined || !props.onFocus) {
|
|
276
254
|
setSelectedIndex(index);
|
|
@@ -751,7 +729,7 @@ export var LineChart = function (props) {
|
|
|
751
729
|
setPointerYsForDataSet(ysForDataSet);
|
|
752
730
|
}
|
|
753
731
|
};
|
|
754
|
-
var renderLine = function (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, key) {
|
|
732
|
+
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, key) {
|
|
755
733
|
return (_jsx(View, { onMoveShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onResponderGrant: function (evt) {
|
|
756
734
|
if (!pointerConfig)
|
|
757
735
|
return;
|
|
@@ -796,9 +774,12 @@ export var LineChart = function (props) {
|
|
|
796
774
|
// setResponderActive(false);
|
|
797
775
|
// setTimeout(() => setPointerX(0), pointerVanishDelay);
|
|
798
776
|
// }}
|
|
799
|
-
style: [
|
|
777
|
+
style: [
|
|
778
|
+
svgWrapperViewStyle,
|
|
779
|
+
{ width: totalWidth, height: containerHeightIncludingBelowXAxis },
|
|
780
|
+
], 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) }, key !== null && key !== void 0 ? key : 0));
|
|
800
781
|
};
|
|
801
|
-
var renderAnimatedLine = function (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, key) {
|
|
782
|
+
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, key) {
|
|
802
783
|
return (_jsx(Animated.View, { onStartShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onMoveShouldSetResponder: function (evt) { return (pointerConfig ? true : false); }, onResponderGrant: function (evt) {
|
|
803
784
|
if (!pointerConfig)
|
|
804
785
|
return;
|
|
@@ -843,7 +824,10 @@ export var LineChart = function (props) {
|
|
|
843
824
|
// setResponderActive(false);
|
|
844
825
|
// setTimeout(() => setPointerX(0), pointerVanishDelay);
|
|
845
826
|
// }}
|
|
846
|
-
style: [
|
|
827
|
+
style: [
|
|
828
|
+
svgWrapperViewStyle,
|
|
829
|
+
{ width: animatedWidth, height: containerHeightIncludingBelowXAxis },
|
|
830
|
+
], children: lineSvgComponent(points, currentLineThickness, color, fillPoints, startFillColor, endFillColor, startOpacity, endOpacity, strokeDashArray, showArrow, arrowPoints, arrowStrokeWidth, arrowStrokeColor, arrowFillColor, key, hideDataPoints, paramsData, propsData, dataPointsShape, dataPointsWidth, dataPointsHeight, dataPointsColor, dataPointsRadius, textColor, textFontSize, startIndex, endIndex, isSecondary, showValuesAsDataPointsText) }, key !== null && key !== void 0 ? key : 0));
|
|
847
831
|
};
|
|
848
832
|
var remainingScrollViewProps = {
|
|
849
833
|
onScroll: function (ev) {
|
|
@@ -856,44 +840,44 @@ export var LineChart = function (props) {
|
|
|
856
840
|
}
|
|
857
841
|
},
|
|
858
842
|
};
|
|
859
|
-
var renderChartContent = function () {
|
|
843
|
+
var renderChartContent = function (containerHeightIncludingBelowXAxis) {
|
|
860
844
|
var _a, _b, _c, _d, _e, _f;
|
|
861
845
|
return (_jsxs(_Fragment, { children: [dataSet
|
|
862
846
|
? pointsFromSet.length
|
|
863
847
|
? dataSet.map(function (set, index) {
|
|
864
848
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
|
865
849
|
if (isAnimated) {
|
|
866
|
-
return renderAnimatedLine((_a = set.zIndex) !== null && _a !== void 0 ? _a : zIndex1, pointsFromSet[index],
|
|
850
|
+
return renderAnimatedLine(containerHeightIncludingBelowXAxis, (_a = set.zIndex) !== null && _a !== void 0 ? _a : zIndex1, pointsFromSet[index], widthValue, (_b = set.thickness) !== null && _b !== void 0 ? _b : thickness1, (_c = set.color) !== null && _c !== void 0 ? _c : color1, fillPointsFromSet[index], (_d = set.startFillColor) !== null && _d !== void 0 ? _d : startFillColor1, (_e = set.endFillColor) !== null && _e !== void 0 ? _e : endFillColor1, (_f = set.startOpacity) !== null && _f !== void 0 ? _f : startOpacity1, (_g = set.endOpacity) !== null && _g !== void 0 ? _g : endOpacity1, (_h = set.strokeDashArray) !== null && _h !== void 0 ? _h : strokeDashArray1, set.showArrow || props.showArrows, arrowPointsFromSet[index], arrowStrokeWidthsFromSet === null || arrowStrokeWidthsFromSet === void 0 ? void 0 : arrowStrokeWidthsFromSet[index], arrowStrokeColorsFromSet === null || arrowStrokeColorsFromSet === void 0 ? void 0 : arrowStrokeColorsFromSet[index], arrowFillColorsFromSet === null || arrowFillColorsFromSet === void 0 ? void 0 : arrowFillColorsFromSet[index], (_j = set.hideDataPoints) !== null && _j !== void 0 ? _j : hideDataPoints1, set.data, adjustToOffset(set.data, -((_k = props.yAxisOffset) !== null && _k !== void 0 ? _k : 0)), // need the actual values passed by user
|
|
867
851
|
(_l = set.dataPointsShape) !== null && _l !== void 0 ? _l : dataPointsShape1, (_m = set.dataPointsWidth) !== null && _m !== void 0 ? _m : dataPointsWidth1, (_o = set.dataPointsHeight) !== null && _o !== void 0 ? _o : dataPointsHeight1, (_p = set.dataPointsColor) !== null && _p !== void 0 ? _p : dataPointsColor1, (_q = set.dataPointsRadius) !== null && _q !== void 0 ? _q : dataPointsRadius1, (_r = set.textColor) !== null && _r !== void 0 ? _r : textColor1, (_s = set.textFontSize) !== null && _s !== void 0 ? _s : textFontSize1, (_t = set.startIndex) !== null && _t !== void 0 ? _t : 0, (_u = set.endIndex) !== null && _u !== void 0 ? _u : set.data.length - 1, set.isSecondary, showValuesAsDataPointsText, index);
|
|
868
852
|
}
|
|
869
853
|
else {
|
|
870
|
-
return renderLine((_v = set.zIndex) !== null && _v !== void 0 ? _v : zIndex1, pointsFromSet[index], (_w = set.thickness) !== null && _w !== void 0 ? _w : thickness1, (_x = set.color) !== null && _x !== void 0 ? _x : color1, fillPointsFromSet[index], (_y = set.startFillColor) !== null && _y !== void 0 ? _y : startFillColor1, (_z = set.endFillColor) !== null && _z !== void 0 ? _z : endFillColor1, (_0 = set.startOpacity) !== null && _0 !== void 0 ? _0 : startOpacity1, (_1 = set.endOpacity) !== null && _1 !== void 0 ? _1 : endOpacity1, (_2 = set.strokeDashArray) !== null && _2 !== void 0 ? _2 : strokeDashArray1, set.showArrow || props.showArrows, arrowPointsFromSet[index], arrowStrokeWidthsFromSet === null || arrowStrokeWidthsFromSet === void 0 ? void 0 : arrowStrokeWidthsFromSet[index], arrowStrokeColorsFromSet === null || arrowStrokeColorsFromSet === void 0 ? void 0 : arrowStrokeColorsFromSet[index], arrowFillColorsFromSet === null || arrowFillColorsFromSet === void 0 ? void 0 : arrowFillColorsFromSet[index], (_3 = set.hideDataPoints) !== null && _3 !== void 0 ? _3 : hideDataPoints1, set.data, adjustToOffset(set.data, -((_4 = props.yAxisOffset) !== null && _4 !== void 0 ? _4 : 0)), // need the actual values passed by user
|
|
854
|
+
return renderLine(containerHeightIncludingBelowXAxis, (_v = set.zIndex) !== null && _v !== void 0 ? _v : zIndex1, pointsFromSet[index], (_w = set.thickness) !== null && _w !== void 0 ? _w : thickness1, (_x = set.color) !== null && _x !== void 0 ? _x : color1, fillPointsFromSet[index], (_y = set.startFillColor) !== null && _y !== void 0 ? _y : startFillColor1, (_z = set.endFillColor) !== null && _z !== void 0 ? _z : endFillColor1, (_0 = set.startOpacity) !== null && _0 !== void 0 ? _0 : startOpacity1, (_1 = set.endOpacity) !== null && _1 !== void 0 ? _1 : endOpacity1, (_2 = set.strokeDashArray) !== null && _2 !== void 0 ? _2 : strokeDashArray1, set.showArrow || props.showArrows, arrowPointsFromSet[index], arrowStrokeWidthsFromSet === null || arrowStrokeWidthsFromSet === void 0 ? void 0 : arrowStrokeWidthsFromSet[index], arrowStrokeColorsFromSet === null || arrowStrokeColorsFromSet === void 0 ? void 0 : arrowStrokeColorsFromSet[index], arrowFillColorsFromSet === null || arrowFillColorsFromSet === void 0 ? void 0 : arrowFillColorsFromSet[index], (_3 = set.hideDataPoints) !== null && _3 !== void 0 ? _3 : hideDataPoints1, set.data, adjustToOffset(set.data, -((_4 = props.yAxisOffset) !== null && _4 !== void 0 ? _4 : 0)), // need the actual values passed by user
|
|
871
855
|
(_5 = set.dataPointsShape) !== null && _5 !== void 0 ? _5 : dataPointsShape1, (_6 = set.dataPointsWidth) !== null && _6 !== void 0 ? _6 : dataPointsWidth1, (_7 = set.dataPointsHeight) !== null && _7 !== void 0 ? _7 : dataPointsHeight1, (_8 = set.dataPointsColor) !== null && _8 !== void 0 ? _8 : dataPointsColor1, (_9 = set.dataPointsRadius) !== null && _9 !== void 0 ? _9 : dataPointsRadius1, (_10 = set.textColor) !== null && _10 !== void 0 ? _10 : textColor1, (_11 = set.textFontSize) !== null && _11 !== void 0 ? _11 : textFontSize1, (_12 = set.startIndex) !== null && _12 !== void 0 ? _12 : 0, (_13 = set.endIndex) !== null && _13 !== void 0 ? _13 : set.data.length - 1, set.isSecondary, showValuesAsDataPointsText, index);
|
|
872
856
|
}
|
|
873
857
|
})
|
|
874
858
|
: null
|
|
875
859
|
: isAnimated
|
|
876
|
-
? renderAnimatedLine(zIndex1, points,
|
|
877
|
-
: renderLine(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, 0), secondaryPoints
|
|
860
|
+
? 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, 0)
|
|
861
|
+
: 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, 0), secondaryPoints
|
|
878
862
|
? isAnimated
|
|
879
|
-
? renderAnimatedLine(secondaryLineConfig.zIndex, secondaryPoints,
|
|
880
|
-
: renderLine(secondaryLineConfig.zIndex, secondaryPoints, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_d = secondaryLineConfig.arrowConfig) === null || _d === void 0 ? void 0 : _d.strokeWidth, (_e = secondaryLineConfig.arrowConfig) === null || _e === void 0 ? void 0 : _e.strokeColor, (_f = secondaryLineConfig.arrowConfig) === null || _f === void 0 ? void 0 : _f.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, 6)
|
|
863
|
+
? renderAnimatedLine(containerHeightIncludingBelowXAxis, secondaryLineConfig.zIndex, secondaryPoints, widthValue, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_a = secondaryLineConfig.arrowConfig) === null || _a === void 0 ? void 0 : _a.strokeWidth, (_b = secondaryLineConfig.arrowConfig) === null || _b === void 0 ? void 0 : _b.strokeColor, (_c = secondaryLineConfig.arrowConfig) === null || _c === void 0 ? void 0 : _c.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, 6)
|
|
864
|
+
: renderLine(containerHeightIncludingBelowXAxis, secondaryLineConfig.zIndex, secondaryPoints, secondaryLineConfig.thickness, secondaryLineConfig.color, secondaryFillPoints, secondaryLineConfig.startFillColor, secondaryLineConfig.endFillColor, secondaryLineConfig.startOpacity, secondaryLineConfig.endOpacity, secondaryLineConfig.strokeDashArray, secondaryLineConfig.showArrow, secondaryArrowPoints, (_d = secondaryLineConfig.arrowConfig) === null || _d === void 0 ? void 0 : _d.strokeWidth, (_e = secondaryLineConfig.arrowConfig) === null || _e === void 0 ? void 0 : _e.strokeColor, (_f = secondaryLineConfig.arrowConfig) === null || _f === void 0 ? void 0 : _f.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, 6)
|
|
881
865
|
: null, points2
|
|
882
866
|
? isAnimated
|
|
883
|
-
? renderAnimatedLine(zIndex2, points2,
|
|
884
|
-
: renderLine(zIndex2, points2, 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, 1)
|
|
867
|
+
? 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, 1)
|
|
868
|
+
: renderLine(containerHeightIncludingBelowXAxis, zIndex2, points2, 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, 1)
|
|
885
869
|
: null, points3
|
|
886
870
|
? isAnimated
|
|
887
|
-
? renderAnimatedLine(zIndex3, points3,
|
|
888
|
-
: renderLine(zIndex3, points3, thickness3, color3, fillPoints3, startFillColor3, endFillColor3, startOpacity3, endOpacity3, strokeDashArray3, props.showArrow3 || props.showArrows, arrow3Points, arrowStrokeWidth3, arrowStrokeColor3, arrowFillColor3, hideDataPoints3, data3, props.data3, dataPointsShape3, dataPointsWidth3, dataPointsHeight3, dataPointsColor3, dataPointsRadius3, textColor3, textFontSize3, startIndex3, endIndex3, false, showValuesAsDataPointsText, 2)
|
|
871
|
+
? renderAnimatedLine(containerHeightIncludingBelowXAxis, zIndex3, points3, widthValue3, thickness3, color3, fillPoints3, startFillColor3, endFillColor3, startOpacity3, endOpacity3, strokeDashArray3, props.showArrow3 || props.showArrows, arrow3Points, arrowStrokeWidth3, arrowStrokeColor3, arrowFillColor3, hideDataPoints3, data3, props.data3, dataPointsShape3, dataPointsWidth3, dataPointsHeight3, dataPointsColor3, dataPointsRadius3, textColor3, textFontSize3, startIndex3, endIndex3, false, showValuesAsDataPointsText, 2)
|
|
872
|
+
: renderLine(containerHeightIncludingBelowXAxis, zIndex3, points3, thickness3, color3, fillPoints3, startFillColor3, endFillColor3, startOpacity3, endOpacity3, strokeDashArray3, props.showArrow3 || props.showArrows, arrow3Points, arrowStrokeWidth3, arrowStrokeColor3, arrowFillColor3, hideDataPoints3, data3, props.data3, dataPointsShape3, dataPointsWidth3, dataPointsHeight3, dataPointsColor3, dataPointsRadius3, textColor3, textFontSize3, startIndex3, endIndex3, false, showValuesAsDataPointsText, 2)
|
|
889
873
|
: null, points4
|
|
890
874
|
? isAnimated
|
|
891
|
-
? renderAnimatedLine(zIndex4, points4,
|
|
892
|
-
: renderLine(zIndex4, points4, thickness4, color4, fillPoints4, startFillColor4, endFillColor4, startOpacity4, endOpacity4, strokeDashArray4, props.showArrow4 || props.showArrows, arrow4Points, arrowStrokeWidth4, arrowStrokeColor4, arrowFillColor4, hideDataPoints4, data4, props.data4, dataPointsShape4, dataPointsWidth4, dataPointsHeight4, dataPointsColor4, dataPointsRadius4, textColor4, textFontSize4, startIndex4, endIndex4, false, showValuesAsDataPointsText, 3)
|
|
875
|
+
? renderAnimatedLine(containerHeightIncludingBelowXAxis, zIndex4, points4, widthValue4, thickness4, color4, fillPoints4, startFillColor4, endFillColor4, startOpacity4, endOpacity4, strokeDashArray4, props.showArrow4 || props.showArrows, arrow4Points, arrowStrokeWidth4, arrowStrokeColor4, arrowFillColor4, hideDataPoints4, data4, props.data4, dataPointsShape4, dataPointsWidth4, dataPointsHeight4, dataPointsColor4, dataPointsRadius4, textColor4, textFontSize4, startIndex4, endIndex4, false, showValuesAsDataPointsText, 3)
|
|
876
|
+
: renderLine(containerHeightIncludingBelowXAxis, zIndex4, points4, thickness4, color4, fillPoints4, startFillColor4, endFillColor4, startOpacity4, endOpacity4, strokeDashArray4, props.showArrow4 || props.showArrows, arrow4Points, arrowStrokeWidth4, arrowStrokeColor4, arrowFillColor4, hideDataPoints4, data4, props.data4, dataPointsShape4, dataPointsWidth4, dataPointsHeight4, dataPointsColor4, dataPointsRadius4, textColor4, textFontSize4, startIndex4, endIndex4, false, showValuesAsDataPointsText, 3)
|
|
893
877
|
: null, points5
|
|
894
878
|
? isAnimated
|
|
895
|
-
? renderAnimatedLine(zIndex5, points5,
|
|
896
|
-
: renderLine(zIndex5, points5, thickness5, color5, fillPoints5, startFillColor5, endFillColor5, startOpacity5, endOpacity5, strokeDashArray5, props.showArrow5 || props.showArrows, arrow5Points, arrowStrokeWidth5, arrowStrokeColor5, arrowFillColor5, hideDataPoints5, data5, props.data5, dataPointsShape5, dataPointsWidth5, dataPointsHeight5, dataPointsColor5, dataPointsRadius5, textColor5, textFontSize5, startIndex5, endIndex5, false, showValuesAsDataPointsText, 4)
|
|
879
|
+
? renderAnimatedLine(containerHeightIncludingBelowXAxis, zIndex5, points5, widthValue5, thickness5, color5, fillPoints5, startFillColor5, endFillColor5, startOpacity5, endOpacity5, strokeDashArray5, props.showArrow5 || props.showArrows, arrow5Points, arrowStrokeWidth5, arrowStrokeColor5, arrowFillColor5, hideDataPoints5, data5, props.data5, dataPointsShape5, dataPointsWidth5, dataPointsHeight5, dataPointsColor5, dataPointsRadius5, textColor5, textFontSize5, startIndex5, endIndex5, false, showValuesAsDataPointsText, 4)
|
|
880
|
+
: renderLine(containerHeightIncludingBelowXAxis, zIndex5, points5, thickness5, color5, fillPoints5, startFillColor5, endFillColor5, startOpacity5, endOpacity5, strokeDashArray5, props.showArrow5 || props.showArrows, arrow5Points, arrowStrokeWidth5, arrowStrokeColor5, arrowFillColor5, hideDataPoints5, data5, props.data5, dataPointsShape5, dataPointsWidth5, dataPointsHeight5, dataPointsColor5, dataPointsRadius5, textColor5, textFontSize5, startIndex5, endIndex5, false, showValuesAsDataPointsText, 4)
|
|
897
881
|
: null, intersectionAreaConfig &&
|
|
898
882
|
(props.areaChart || (props.areaChart1 && props.areaChart2))
|
|
899
883
|
? renderIntersection()
|
|
@@ -924,5 +908,5 @@ export var LineChart = function (props) {
|
|
|
924
908
|
: null] }, index));
|
|
925
909
|
})] }));
|
|
926
910
|
};
|
|
927
|
-
return (_jsx(BarAndLineChartsWrapper, __assign({}, barAndLineChartsWrapperProps, { scrollRef: scrollRef, animatedWidth:
|
|
911
|
+
return (_jsx(BarAndLineChartsWrapper, __assign({}, barAndLineChartsWrapperProps, { dataSet: props.dataSet, scrollRef: scrollRef, animatedWidth: widthValue, renderChartContent: renderChartContent, remainingScrollViewProps: remainingScrollViewProps })));
|
|
928
912
|
};
|
package/dist/PieChart/main.js
CHANGED
|
@@ -144,7 +144,7 @@ export var PieChartMain = function (props) {
|
|
|
144
144
|
props.setSelectedIndex(index);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
} })) : null, _jsx(SvgText, { fill: item.textColor || textColor || pieColors[(index + 2) % 9], fontSize: item.textSize || textSize, fontFamily: item.font || props.font, fontWeight: item.fontWeight || props.fontWeight, fontStyle: item.fontStyle || props.fontStyle || 'normal', x: x +
|
|
147
|
+
} })) : null, showText && (_jsx(SvgText, { fill: item.textColor || textColor || pieColors[(index + 2) % 9], fontSize: item.textSize || textSize, fontFamily: item.font || props.font, fontWeight: item.fontWeight || props.fontWeight, fontStyle: item.fontStyle || props.fontStyle || 'normal', x: x +
|
|
148
148
|
(item.shiftTextX || 0) -
|
|
149
149
|
(item.textSize || textSize) / 1.8, y: y + (item.shiftTextY || 0), onPress: function () {
|
|
150
150
|
item.onLabelPress
|
|
@@ -166,7 +166,7 @@ export var PieChartMain = function (props) {
|
|
|
166
166
|
props.setSelectedIndex(index);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
}, children: item.text || (showValuesAsLabels ? item.value + '' : '') }), localPieInnerComponent ? (_jsx(G, { x: x, y: y, children: (_g = localPieInnerComponent === null || localPieInnerComponent === void 0 ? void 0 : localPieInnerComponent(item, index)) !== null && _g !== void 0 ? _g : null })) : null] }, index));
|
|
169
|
+
}, children: item.text || (showValuesAsLabels ? item.value + '' : '') })), localPieInnerComponent ? (_jsx(G, { x: x, y: y, children: (_g = localPieInnerComponent === null || localPieInnerComponent === void 0 ? void 0 : localPieInnerComponent(item, index)) !== null && _g !== void 0 ? _g : null })) : null] }, index));
|
|
170
170
|
})] }), isThreeD && shadow && !semiCircle ? (_jsx(View, { style: {
|
|
171
171
|
width: radius * 2,
|
|
172
172
|
height: radius * 2,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-charts",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.29",
|
|
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": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"registry": "https://registry.npmjs.org/"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"gifted-charts-core": "^0.1.
|
|
28
|
+
"gifted-charts-core": "^0.1.30"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/cli": "^7.24.8",
|