fluttercandies / flutter-interactive-chart

A candlestick chart that supports pinch-to-zoom and panning.
https://pub.dev/packages/interactive_chart
MIT License
209 stars 66 forks source link

onTap function #8

Closed MeshariA closed 2 years ago

MeshariA commented 2 years ago

Thanks for the great package.

Just having an issue getting a call back from the onTap function.

InteractiveChart( initialVisibleCandleCount: 40, candles: _data, style: ChartStyle(), onTap: (candle) => print("Tapped"),

Tapped never prints when I click on the candle sticks.

kcoms555 commented 2 years ago

I've got the same problem as you. Codes below should be changed. So I fixed it and, now, it works well as I expected.

https://github.com/fluttercandies/flutter-interactive-chart/blob/8bce5d633379995685b4a2351d8a5f9f81955997/lib/src/interactive_chart.dart#L208-L224

@h65wang Is there any rule for pull requests? I will request a pull.

cc @MeshariA

MeshariA commented 2 years ago

I've got the same problem as you. Codes below should be changed. So I fixed it and, now, it works well as I expected.

https://github.com/fluttercandies/flutter-interactive-chart/blob/8bce5d633379995685b4a2351d8a5f9f81955997/lib/src/interactive_chart.dart#L208-L224

@h65wang Is there any rule for pull requests? I will request a pull.

cc @MeshariA

Can you please share the change you made?

kcoms555 commented 2 years ago

Hi @MeshariA https://github.com/fluttercandies/flutter-interactive-chart/pull/10/files I give a pull request. See the link above

cc. @h65wang

h65wang commented 2 years ago

@kcoms555 Thank you, I've merged your PR, and will release a new build soon.