-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listen to normal tap on Tooltip instead of longpress #37
Comments
Yes, I also want the same thing. Please provide that functionality. |
Would be great, I don't know if users will realise they can long press to show tip. Normal press would be better. |
Also please keep in mind that chart should maintain selected state on rebuild. For example, if some data point is selected and then rebuild occurs, that selection should be preserved. |
I think it should handle out of the chart, |
Also sounds good |
To take this one further, I am wanting to use this on desktop. Is there a way to make it so that if a mouse is hovering over it, it shows all the time and follows the mouse as if you are holding down a press? |
Yes, for sure we will add the Desktop compatibility, |
Hi, |
I've done this enhancement. Replace your fl_chart.dart with attached file (Remove .txt). |
Are you getting shut down?
…On Wed, 31 Jul. 2019, 8:51 pm Dipendra Sharma, ***@***.***> wrote:
Replace your fl_chart.dart with attached file (Remove .txt).
fl_chart.dart.txt
<https://github.com/imaNNeoFighT/fl_chart/files/3451322/fl_chart.dart.txt>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#37>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK43TTTMUURSMORI4FRVOMLQCFVCTANCNFSM4H66OOPQ>
.
|
@dipendra-sharma Thank you, works as expected ;) |
I am having a go at this to see what I can come up with. I tried adding/changing this below. It works, but the position available for Listeners vs Gesture is only d.position and d.localPosition, so it kind of acts weird and some of the points jump to another spot on the graph with 3 lines when you get close to them slowly, lol. I want to try a few things first to see if there is a way to fix the position before I do a PR. class FlChart extends StatefulWidget {
final BaseChart chart;
var enableTap;
var enablePointer;
FlChart({
Key key,
@required this.chart,
this.enableTap = true,
this.enablePointer = true,
}) : super(key: key) {
if (chart == null) {
throw Exception('chart should not be null');
}
} @override
Widget build(BuildContext context) {
return widget.enablePointer ? _withPointerInput() : widget.enableTap ? _widgetWithTap() : _widgetWithLongPress();
} Widget _withPointerInput() {
return Listener(
onPointerEnter: (d) {
_touchInputNotifier.value = FlLongPressStart(
_globalToLocal(context, d.localPosition),
);
},
onPointerHover: (d) {
_touchInputNotifier.value = FlLongPressMoveUpdate(
_globalToLocal(context, d.localPosition),
);
},
onPointerExit: (d) {
_touchInputNotifier.value = FlLongPressEnd(
_globalToLocal(context, d.localPosition),
);
},
child: CustomPaint(
painter: widget.chart.painter(
touchInputNotifier: _touchInputNotifier,
touchResponseSink: widget.chart.getData().touchData.touchResponseSink,
),
),
);
}
|
No, I will not shut down this repo, I just need some free times to improve it |
Hi, @imaNNeoFighT Please add me in contributors. I've already done it, will create a PR. Both the features will be there Long press & Tap. |
You can make a PR already, |
@MostHated Have you tested it? it is not working on iPhone 7. |
Remote: Permission to imaNNeoFighT/fl_chart.git denied to dipendra-sharma. unable to access 'https://github.com/imaNNeoFighT/fl_chart.git/': The requested URL returned error: 403 |
Sorry you have to firstly fork it in your profile, |
I would assume that is because iPhone does not have a pointer. It uses touch/gesture. Pointer is for desktop platforms. I don't think anything with "pointer" in the event callback will work with Android or iPhone unless you attach a mouse to it. I tested and it works for me on both go-flutter and flutter-desktop-embedded. |
@MostHated Pointer was not working on the iPhone device. |
Yes, did you read my explanation above? Pointer only works I believe if you are running on a platform which is using the |
Hi, thanks all for your patience, |
@imaNNeoFighT was the MouseOver on desktop that was mentioned by @MostHated ever implemented? thanks! |
Hi @jlubeck |
Also, feel free to make an issue about it, |
Ok, I was asking mainly because @MostHated seemed to had it working... I'll create the new ticket. Thank you |
First of all, thank you for this amazing library <3
Please provide
onTap
option with some sort ofMoveUpdate
to show Tooltip on chart as an alternative toonLongPress
Looking forward for this library
The text was updated successfully, but these errors were encountered: