Skip to content

Commit

Permalink
Merge pull request #837 from Abhinandan-Kushwaha/development
Browse files Browse the repository at this point in the history
v1.4.39 Fixed onPress in Pie & handled empty data in Line
  • Loading branch information
Abhinandan-Kushwaha authored Sep 15, 2024
2 parents 3088160 + c4c6dab commit f86607e
Show file tree
Hide file tree
Showing 5 changed files with 363 additions and 334 deletions.
4 changes: 2 additions & 2 deletions docs/PieChart/PieChartProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions release-notes/release-notes.md
Original file line number Diff line number Diff line change
@@ -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 <br/>
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"
Expand Down
2 changes: 1 addition & 1 deletion src/PieChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Loading

0 comments on commit f86607e

Please sign in to comment.