diff --git a/docs/PieChart/PieChartProps.md b/docs/PieChart/PieChartProps.md
index 0cd9f732..0cdee159 100644
--- a/docs/PieChart/PieChartProps.md
+++ b/docs/PieChart/PieChartProps.md
@@ -15,7 +15,7 @@
| inwardExtraLengthForFocused | number | Extra length of focused Pie section towards the center (only for donut charts) | 0 |
| sectionAutoFocus | boolean | In case you don't want focusOnPress but want a particular section to autofocus, this prop will be needed | false |
| focusedPieIndex | number | index of the initially focused Pie, works only when focusOnPress is true | -1 |
-| onLabelPress | Function | Callback function called on press of a Label (takes item and index as parameter) | onPress OR null |
+| onLabelPress (removed) | Function | Callback function called on press of a Label (takes item and index as parameter) | onPress OR null |
| tiltAngle | Angle in deg | The angle by which the chart should be tilted | '55deg' for 3D charts, otherwise 0 |
| shadow | boolean | Shadow to the Pie chart, when set to true, it enhances the 3D effect | false |
| shadowColor | ColorValue | Color of the shadow | lightgray |
@@ -117,7 +117,7 @@ type LabelLineConfig = {
| textBackgroundRadius | number | Radius for the background of the text label |
| labelPosition | string | Tells where inside the Pie sections should the labels be shown- 'onBorder', 'outward', 'inward' or 'mid' |
| onPress | Function | Callback function called on press of Pie sections (takes item and index as parameter) |
-| onLabelPress | Function | Callback function called on press of a Label (takes item and index as parameter) |
+| onLabelPress (removed) | Function | Callback function called on press of a Label (takes item and index as parameter) |
| strokeWidth | number | Stroke (line) width for the Pie chart and its section |
| strokeColor | ColorValue | Stroke (line) color |
| focused | boolean | When set to true, the section for that item is focused, sectionAutoFocus must be set true in order to use this property |
diff --git a/package.json b/package.json
index 10c04f37..dcec647a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-gifted-charts",
- "version": "1.4.38",
+ "version": "1.4.39",
"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.",
"main": "dist/index.js",
"files": [
@@ -25,7 +25,7 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
- "gifted-charts-core": "0.1.38"
+ "gifted-charts-core": "0.1.40"
},
"devDependencies": {
"@babel/cli": "^7.24.8",
diff --git a/release-notes/release-notes.md b/release-notes/release-notes.md
index 402ad99c..11a104d8 100644
--- a/release-notes/release-notes.md
+++ b/release-notes/release-notes.md
@@ -1,3 +1,21 @@
+# 🎉 1.4.39
+
+## 🐛 Bug fixes
+
+1. Fixed the issue- "onPress pressing/focusing wrong Pie section". It fixes these issues-
+ 1. https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/832
+ 2. https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/297
+ 3. https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/812
+ As a part of this fix, removed `onLabelPress` which is still there in types, but will not be functional. Will try to restore it in future.
+
+2. Fixed the issue- "Line charts crash if data is an empty array." See https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/707
+
+---
+
+---
+
+---
+
# 🎉 1.4.38
Fixed the issue- "Line chart inside Bar chart misaligned if data contains -ve values"
diff --git a/src/PieChart/index.tsx b/src/PieChart/index.tsx
index 765c9b8e..602a551e 100644
--- a/src/PieChart/index.tsx
+++ b/src/PieChart/index.tsx
@@ -143,7 +143,7 @@ export const PieChart = (props: PieChartPropsType) => {
},
{
value: total - props.data[selectedIndex].value,
- onPress: () => alert('black'),
+ // onPress: () => alert('black'),
peripheral: true,
strokeWidth: 0,
},
diff --git a/src/PieChart/main.tsx b/src/PieChart/main.tsx
index 57da6767..c3316cb9 100644
--- a/src/PieChart/main.tsx
+++ b/src/PieChart/main.tsx
@@ -1,5 +1,9 @@
import React from 'react';
-import {View} from 'react-native';
+import {
+ GestureResponderEvent,
+ TouchableWithoutFeedback,
+ View,
+} from 'react-native';
import Svg, {
Path,
Circle,
@@ -62,358 +66,365 @@ export const PieChartMain = (props: PieChartMainProps) => {
extraRadius,
showExternalLabels,
getExternaLabelProperties,
+ coordinates,
+ onPressed,
} = getPieChartMainProps(props);
let prevSide = 'right';
let prevLabelComponentX = 0;
let wasFirstItemOnPole = false;
- return (
-
-
+ {isThreeD && shadow && !semiCircle ? (
+
+ ) : null}
+
+
);
};