-
-
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
Gauge Chart #1424
base: main
Are you sure you want to change the base?
Gauge Chart #1424
Conversation
To view this pull requests documentation preview, visit the following URL: docs.page/imanneo/fl_chart~1424 Documentation is deployed and generated using docs.page. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1424 +/- ##
==========================================
+ Coverage 86.48% 87.02% +0.54%
==========================================
Files 45 49 +4
Lines 2982 3245 +263
==========================================
+ Hits 2579 2824 +245
- Misses 403 421 +18 ☔ View full report in Codecov by Sentry. |
61c300f
to
c4d5647
Compare
final bool showChangingColorTicks; | ||
|
||
static GaugeTicks? lerp(GaugeTicks? a, GaugeTicks? b, double t) { | ||
// TODO(FlorianArnould): if showChangingColorTicks are different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to do necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes if we want a smooth transition on the color ticks
But would be deleted if we go for another approach like discussed here
#1424 (comment)
double gaugeRadius(Size size) => size.shortestSide / 2; | ||
} | ||
|
||
class GaugePosition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this class private (as we need this object only here)
} | ||
} | ||
|
||
class Range { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this one
} | ||
} | ||
|
||
class DegreeAngleRange { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
List<Object?> get props => [color]; | ||
} | ||
|
||
class VariableGaugeColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a confusing approach in this project. Because we didn't use this approach on the other charts.
I would prefer to have a callback to get the progress and return a color (what we do in other charts).
Or a list of colors if you want to handle the gradient.
By the way, I can add these kinds of improvements if you allow me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to be able to display some colored ticks at the angle the color changes.
If you work with a callback, you cannot get this angle precisely and moreover your will need to call it a lot of times with values between 0 and 1 to scan when the color changes.
height: 250, | ||
child: GaugeChart( | ||
GaugeChartData( | ||
value: _value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update your branch, please? And reply to the other discussions? |
Any updates to adding the Gauge Chart? Thank you. |
@FlorianArnould & @imaNNeo Thank you for your work on this topic. How can I help to push the Gauge Chart to the library? |
The implementation of the gauge chart (discussed here #199)