react-native-gifted-charts 1.4.5 → 1.4.6
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 +2 -2
- package/src/PieChart/index.tsx +2 -0
- package/src/PieChart/main.tsx +6 -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.6",
|
|
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": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"registry": "https://registry.npmjs.org/"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"gifted-charts-core": "^0.0.
|
|
27
|
+
"gifted-charts-core": "^0.0.18"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/core": "^7.22.5",
|
package/src/PieChart/index.tsx
CHANGED
|
@@ -135,6 +135,8 @@ export const PieChart = (props: PieChartPropsType) => {
|
|
|
135
135
|
props.data[selectedIndex].strokeWidth || undefined,
|
|
136
136
|
gradientCenterColor:
|
|
137
137
|
props.data[selectedIndex].gradientCenterColor || undefined,
|
|
138
|
+
shiftTextX: props.data[selectedIndex].shiftTextX || undefined,
|
|
139
|
+
shiftTextY: props.data[selectedIndex].shiftTextY || undefined,
|
|
138
140
|
},
|
|
139
141
|
{
|
|
140
142
|
value: total - props.data[selectedIndex].value,
|
package/src/PieChart/main.tsx
CHANGED
|
@@ -264,8 +264,12 @@ export const PieChartMain = (props: PieChartMainProps) => {
|
|
|
264
264
|
{/* <Line x1={mx} x2={cx} y1={my} y2={cy} stroke="black" /> */}
|
|
265
265
|
{showTextBackground ? (
|
|
266
266
|
<Circle
|
|
267
|
-
cx={x}
|
|
268
|
-
cy={
|
|
267
|
+
cx={x + (item.shiftTextBackgroundX ?? item.shiftTextX ?? 0)}
|
|
268
|
+
cy={
|
|
269
|
+
y +
|
|
270
|
+
(item.shiftTextBackgroundY ?? item.shiftTextY ?? 0) -
|
|
271
|
+
(item.textSize || textSize) / 4
|
|
272
|
+
}
|
|
269
273
|
r={
|
|
270
274
|
item.textBackgroundRadius ||
|
|
271
275
|
props.textBackgroundRadius ||
|