Open mykelcodes opened 1 year ago
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch react-native-chart-kit@6.12.0 for the project I'm working on.
react-native-chart-kit@6.12.0
Using this library in an Expo project that requires a chart. On web, I ran into an issue where onDataPointClick was not working for LineChart.
onDataPointClick
LineChart
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-chart-kit/dist/line-chart/LineChart.js b/node_modules/react-native-chart-kit/dist/line-chart/LineChart.js index 1ac4227..0aeda86 100644 --- a/node_modules/react-native-chart-kit/dist/line-chart/LineChart.js +++ b/node_modules/react-native-chart-kit/dist/line-chart/LineChart.js @@ -94,7 +94,7 @@ var LineChart = /** @class */ (function (_super) { }; output.push(<Circle key={Math.random()} cx={cx} cy={cy} fill={typeof getDotColor === "function" ? getDotColor(x, i) - : _this.getColor(dataset, 0.9)} onPress={onPress} {..._this.getPropsForDots(x, i)}/>, <Circle key={Math.random()} cx={cx} cy={cy} r="14" fill="#fff" fillOpacity={0} onPress={onPress}/>, renderDotContent({ x: cx, y: cy, index: i, indexData: x })); + : _this.getColor(dataset, 0.9)} onPress={onPress} onClick={onPress} {..._this.getPropsForDots(x, i)}/>, <Circle key={Math.random()} cx={cx} cy={cy} r="14" fill="#fff" fillOpacity={0} onPress={onPress} onClick={onPress}/>, renderDotContent({ x: cx, y: cy, index: i, indexData: x })); }); }); return output;
I have the same issue on Web. Please make a patch with the proposed solution. I love your library, but I can't move forward with adapting it to work on Web.... Any estimates when this can be released?
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch
react-native-chart-kit@6.12.0
for the project I'm working on.Using this library in an Expo project that requires a chart. On web, I ran into an issue where
onDataPointClick
was not working forLineChart
.Here is the diff that solved my problem: