Comments (1)
Yes, you can. The default behaviour only considers the xAxis distance to find the touched points.
You can override the LineTouchData.distanceCalculator method to consider both xAxis and yAxis (or any custom logic that you can think about).
Take a look at the below code:
lineTouchData: LineTouchData(
distanceCalculator: (Offset touchPoint, Offset spotPixelCoordinates) {
final diffX = (touchPoint.dx - spotPixelCoordinates.dx).abs(); // This is the default calculation
final diffY = (touchPoint.dy - spotPixelCoordinates.dy).abs(); // We add diffY to add with diffX and return it
return diffX + diffY;
},
),
from fl_chart.
Related Issues (20)
- Add Segment Selection to LineChart
- how to draw step line? Lack of Support for StepLine Drawing and User Confusion in fl_chart
- Landscape style Allowed Configures whether to allow
- Issue with Aligning BarChart and LineChart on Same X-Axis in fl_chart
- PieTouchData.enabled doesn't work
- VerticalLineLabel position has changed when migrating to new versions
- dublicated x-axis titles
- maxY value title color is not apply true with opacity color. HOT 2
- LineChart visual error HOT 1
- Rounded corner radius for PieChart
- RangeError (length): Invalid value: Not in inclusive range 0..3: 4. Error thrown HOT 1
- How can I display both bar charts and line charts in the same chart? HOT 1
- Line chart is not rendered properly on iOS HOT 2
- Adding more lines to the same chart panel in realtime? HOT 9
- Improve performance on calculating minX, maxX, minY and maxY in axis-based charts
- Please, add gradient colours for the line depending on Y value for the LineChart (for example if y > 10 I need to set one color for the line, if y > 100 it should be another color)
- Is it possible to scroll? HOT 2
- Get Rounded Cap at the End of a Donut Chart.
- Adding Option to add Custom Shadow to Charts
- Add or subtract from minX, miny, maxX and maxY
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fl_chart.