Skip to content
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

Line Chart: Always show tooltip and spot after a click #118

Closed
Nicolas-Bouvard opened this issue Nov 27, 2019 · 13 comments
Closed

Line Chart: Always show tooltip and spot after a click #118

Nicolas-Bouvard opened this issue Nov 27, 2019 · 13 comments
Labels
enhancement New feature or request

Comments

@Nicolas-Bouvard
Copy link

Nicolas-Bouvard commented Nov 27, 2019

Hello ! I'm using your package for my lines charts.
I would like tooltip and spot to keep beeing displayed after a click and release on the chart.
Currently I didn't find any way to do so...

Thank you for your package, it's very cool !

Edit:
By clicking on the chart, the tooltip and spot keep beeing displayed.
Here, the package's tool tip and spot have been removed to put my own widget. The problem is that it was very long to create, it is not optimized, that's not really relliable and it don't follow chart's animations.

SVID_20191127_163037_1

@imaNNeo
Copy link
Owner

imaNNeo commented Nov 30, 2019

Hello, great to hear that, enjoy it :)
All charts have a built-in handled interaction, but you can implement your own interaction.
In the 0.5.0 we've added Velocity to in FlPanEnd to determine the Tap event.
It means you can handle Tap events, and show/hide spots as you want.
We have a sample that handles tap to show or hide the tooltips in the ScatterChart, you can findout how to do that.
check it out:

Sample 2 (Source Code)

Let me know if it does make sense to you.

@imaNNeo imaNNeo added the enhancement New feature or request label Nov 30, 2019
@komputerboy
Copy link

komputerboy commented Dec 2, 2019

How to make a chart like that?
To have a feature to group by yearly, monthly, and weekly?

@imaNNeo
Copy link
Owner

imaNNeo commented Dec 2, 2019

I didn't get you.

@komputerboy
Copy link

I didn't get you.

I mean how to make a feature to group chart data by yearly, monthly, and weekly?
so, when user clicks yearly, then the chart shows yearly data, and when weekly then the shart show weekly data.

@Nicolas-Bouvard
Copy link
Author

Nicolas-Bouvard commented Dec 4, 2019

Hello, great to hear that, enjoy it :)
All charts have a built-in handled interaction, but you can implement your own interaction.
In the 0.5.0 we've added Velocity to in FlPanEnd to determine the Tap event.
It means you can handle Tap events, and show/hide spots as you want.
We have a sample that handles tap to show or hide the tooltips in the ScatterChart, you can findout how to do that.
check it out:

Sample 2 (Source Code)

Let me know if it does make sense to you.

After a few tests I didn't find any way to apply that to line charts.
I'm looking for a settings that allow us to keep displaying or not spot and tooltip.
Currently it doesn't seem to exist but it could be a cool enhancement =)

Anyway thanks for this package =)

Edit:
Woops I missed showingToolTipIndicator.
So yes now it make sense ! Thank you ! =)

@Nicolas-Bouvard
Copy link
Author

I didn't get you.

I mean how to make a feature to group chart data by yearly, monthly, and weekly?
so, when user clicks yearly, then the chart shows yearly data, and when weekly then the shart show weekly data.

That's not a package's feature. It's only a setState() which changes the list of FlSpots to show.

@imaNNeo
Copy link
Owner

imaNNeo commented Dec 4, 2019

I will make a sample in the LineChart ASAP.

@GOGJIAN
Copy link

GOGJIAN commented Dec 3, 2020

I will make a sample in the LineChart ASAP.

where is the sample?I can't find it,please help me

@GOGJIAN
Copy link

GOGJIAN commented Dec 3, 2020

I will make a sample in the LineChart ASAP.

where is the sample?I can't find it,please help me

I use showingTooltipIndicators and handleBuiltInTouches: true, because I need the line and dot

in this case ,when I touch ,this work fine,but when I longpress or move finger, this tip will be removed

OR I use showingTooltipIndicators and handleBuiltInTouches: false , but the getTouchedSpotIndicator params indicators always is []

@GOGJIAN
Copy link

GOGJIAN commented Dec 3, 2020

I will make a sample in the LineChart ASAP.

where is the sample?I can't find it,please help me

I use showingTooltipIndicators and handleBuiltInTouches: true, because I need the line and dot

in this case ,when I touch ,this work fine,but when I longpress or move finger, this tip will be removed

OR I use showingTooltipIndicators and handleBuiltInTouches: false , but the getTouchedSpotIndicator params indicators always is []

oh I sovled it, by showingIndicators ,alright,emmm ,this not comfortable

@Sharkaboi
Copy link

Sharkaboi commented Mar 11, 2021

Any way to do this with LineChart ? showingIndicators seems to be for bar charts.

@masterwok
Copy link

@imaNNeoFighT is there a LineChart sample for persistent tool tips with TouchedSpotIndicatorData somewhere? I was able to get a persistent tool tip on tap working using your bar chart sample but I wasn't able to get the TouchedSpotIndicatorData to render on the graph (dot and dashed line) when handleBuiltInTouches was set to false. Any help would be greatly appreciated! Thank you.

@imaNNeo
Copy link
Owner

imaNNeo commented Apr 15, 2023

So I have updated our LineChartSample5 to implement a toggle to show/hide the tooltip in LineChart.

You can check it out live in our web app at https://app.flchart.dev
There is a link to source-code in the example (top right)

toggle_tooltip_line_chart.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants