react-native-gifted-charts 1.4.18 → 1.4.19
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-gifted-charts",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.19",
|
|
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": "src/index.tsx",
|
|
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.18"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/core": "^7.22.5",
|
package/src/LineChart/index.tsx
CHANGED
|
@@ -299,6 +299,7 @@ export const LineChart = (props: LineChartPropsType) => {
|
|
|
299
299
|
stripWidth,
|
|
300
300
|
stripColor,
|
|
301
301
|
stripOpacity,
|
|
302
|
+
stripStrokeDashArray,
|
|
302
303
|
unFocusOnPressOut,
|
|
303
304
|
delayBeforeUnFocus,
|
|
304
305
|
containerHeightIncludingBelowXAxis,
|
|
@@ -661,9 +662,22 @@ export const LineChart = (props: LineChartPropsType) => {
|
|
|
661
662
|
const currentStripHeight = item.stripHeight ?? stripHeight;
|
|
662
663
|
const currentStripWidth = item.stripWidth ?? stripWidth;
|
|
663
664
|
const currentStripOpacity = item.stripOpacity ?? stripOpacity;
|
|
665
|
+
const currentStripStrokeDashArray =
|
|
666
|
+
item.stripStrokeDashArray ?? stripStrokeDashArray ?? '';
|
|
664
667
|
const currentStripColor = item.stripColor || stripColor;
|
|
665
668
|
const position = I18nManager.isRTL ? 'right' : 'left';
|
|
666
669
|
|
|
670
|
+
const y1 = currentStripHeight
|
|
671
|
+
? containerHeight - currentStripHeight + 8
|
|
672
|
+
: containerHeight -
|
|
673
|
+
dataPointsHeight / 2 +
|
|
674
|
+
14 -
|
|
675
|
+
(item.value * containerHeight) / maxValue;
|
|
676
|
+
|
|
677
|
+
const actualStripHeight =
|
|
678
|
+
currentStripHeight ||
|
|
679
|
+
(item.value * containerHeight) / maxValue - 2 + overflowTop;
|
|
680
|
+
|
|
667
681
|
return (
|
|
668
682
|
<Fragment key={index}>
|
|
669
683
|
{focusEnabled ? (
|
|
@@ -694,23 +708,15 @@ export const LineChart = (props: LineChartPropsType) => {
|
|
|
694
708
|
) : null}
|
|
695
709
|
{item.showStrip ||
|
|
696
710
|
(focusEnabled && index === selectedIndex && showStripOnFocus) ? (
|
|
697
|
-
<
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
(item.value * containerHeight) / maxValue
|
|
706
|
-
}
|
|
707
|
-
width={currentStripWidth}
|
|
708
|
-
height={
|
|
709
|
-
currentStripHeight ||
|
|
710
|
-
(item.value * containerHeight) / maxValue - 2 + overflowTop
|
|
711
|
-
}
|
|
711
|
+
<Line
|
|
712
|
+
x1={initialSpacing + spacing * index - currentStripWidth / 2 - 1}
|
|
713
|
+
y1={y1}
|
|
714
|
+
x2={initialSpacing + spacing * index - currentStripWidth / 2 - 1}
|
|
715
|
+
y2={y1 + actualStripHeight}
|
|
716
|
+
strokeWidth={currentStripWidth}
|
|
717
|
+
stroke={currentStripColor}
|
|
718
|
+
strokeDasharray={currentStripStrokeDashArray}
|
|
712
719
|
opacity={currentStripOpacity}
|
|
713
|
-
fill={currentStripColor}
|
|
714
720
|
/>
|
|
715
721
|
) : null}
|
|
716
722
|
{hideDataPoints ? null : (
|