Comments (9)
It should be very simple, you just need to keep a list of showingLines and update the list when a new data comes.
You can find the source code here
CleanShot.2024-06-21.at.00.14.22.mp4
from fl_chart.
Amazing! Thank you!
One other question: is there a way to specify a the axis step? I found the grid size control, but cannot figure out how to adjust the numbers on the axis to match.
from fl_chart.
Also, it there a way to keep the grid lines showing when there is no data?
from fl_chart.
s step? I found the grid size control, but cannot figure out how to adjust the numbers on the axis to match.
You can use interval
property in the SideTitles or FlGridData
from fl_chart.
Also, it there a way to keep the grid lines showing when there is no data?
It is a bug and should be fixed in the next version. Stay tuned! 😊
from fl_chart.
s step? I found the grid size control, but cannot figure out how to adjust the numbers on the axis to match.
You can use
interval
property in the SideTitles or FlGridData
The FLGridData intervals only seems to control the grid and not the text on the axis.
I got the FLTitlesData to adjust the text on the axis, but it seems quite complicated for such a simple thing. I had to add a widget or I was getting errors. It's such a basic thing, seems like there should be something that works like the minX/maxX/etc... of at the very most like the FLGridData intervals. Am I missing something?
from fl_chart.
It's very simple, you just need to change the interval property in the SideTitles class. (no need to update other things)
Take a look at the below sample:
(source code is here)
CleanShot.2024-06-21.at.17.48.54.mp4
from fl_chart.
Your support for this package is incredible! Thank you!
I'm not clear though, why this works:
double verticalInterval = 1.0;
.
.
.
sideTitles: SideTitles(
reservedSize: 26,
showTitles: true,
interval: verticalInterval,
),
But, this does not:
sideTitles: SideTitles(
reservedSize: 26,
showTitles: true,
interval: 1.0, // as int (1) doesn't work either
),
from fl_chart.
Ok, I figured it out, a 'const' goes in front of AxisTitles
. This doesn't follow the same patten as the other parameters like minX, reservedSize, etc..., so it was a bit confusing.
bottomTitles: const AxisTitles(
sideTitles: SideTitles(
reservedSize: 26,
showTitles: true,
interval: 1.0,
),
),
FYI, in your example, the verticalInterval and horizontalInterval variables are assigned to the wrong axis.
from fl_chart.
Related Issues (20)
- Adding Option to add Custom Shadow to Charts
- Add or subtract from minX, miny, maxX and maxY HOT 1
- Dithering bug HOT 4
- more a question: Show titles before / beyond meta.min / max?
- extra line with some additional details HOT 2
- fixedLeftColumns is not reflecting using DataTable2 (Tested on web) HOT 3
- Scatter plot with different marker ? HOT 1
- displaying LineTooltipItem when clicking on SideTitleWidget HOT 2
- Side titles issue HOT 1
- Build failure with Flutter 3.22.2 HOT 2
- Hacky solution for zooming and displaying extra data / titles across the chart HOT 3
- BarChart Side Title Widget HOT 1
- Border Radius for each corner in BarTouchTooltipData
- PieChartData incorrect center color for one PieChartSectionData with opacity color in sections
- Member not found: 'MediaQuery.boldTextOverride' HOT 6
- Feature Request - add support for scale gesture recognition for LineTouchData.touchCallback HOT 2
- preventCurveOverShooting is difficult to limit overshoot in the x-axis direction HOT 1
- Tooltip margin problem HOT 1
- Add spot drag function for LineChart & spot custom indicator widget
- LineChartBarData - key property
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.