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

Add range selection to line chart #131

Open
jamesblasco opened this issue Dec 10, 2019 · 2 comments
Open

Add range selection to line chart #131

jamesblasco opened this issue Dec 10, 2019 · 2 comments
Labels
enhancement New feature or request Line Chart

Comments

@jamesblasco
Copy link
Contributor

jamesblasco commented Dec 10, 2019

It would be an amazing option to be able to select a range in a line chart

ezgif-4-97bb98f3ddde

I have implemented it like this now:

touchCallback: (LineTouchResponse touchResponse) {
              if (touchResponse.lineBarSpots.first.x != minX) {
                setState(() {
                  startRange = 1.0 * touchResponse.lineBarSpots.first.x;
                  endRange = startRange + 1;
                });
              }
},

And change the gradient colors stops relative to startRange and endRange.

The only problem I have now is that the spot is at the left border of the range, so the touchSpotThreshold it is not relative to the center of the range so the touch is displaced.
I need to put the spot in the borders and not in the centers so I can add vertical border lines to the selected range

@imaNNeo
Copy link
Owner

imaNNeo commented Dec 11, 2019

Hi, got it.
Can you please share your code?
I need to reproduce it easily to resolve it.
Thanks!

@imaNNeo imaNNeo added the enhancement New feature or request label Dec 11, 2019
@jamesblasco
Copy link
Contributor Author

Sorry the code it is a bit mixed with some logic for the opening hours and they are several files. The best solution for now i think it if it were possible to draw extra horizontal lines in ExtraLinesData that goes from the bottom to the line of the graph. Now they can only go from the bottom to the top

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

Successfully merging a pull request may close this issue.

2 participants