Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart
diff --git a/packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart b/packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart
index 92ccbd6bb185e0989c7479263c3b620cdb919597..1d682db8e29d2c6cd2e8e2bd1f02d0d29ff6928d 100644
--- a/packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart
+++ b/packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart
@@ -79,10 +79,9 @@ abstract class CartesianRendererBase implements CartesianRenderer {
@override
Extent get extent {
assert(series != null && area != null);
- var rows = area.data.rows,
- measures = series.measures,
- max = SMALL_INT_MIN,
- min = SMALL_INT_MAX;
+ var rows = area.data.rows, measures = series.measures;
+ num max = SMALL_INT_MIN;
+ num min = SMALL_INT_MAX;
for (int i = 0, len = rows.length; i < len; ++i) {
var row = rows.elementAt(i);
@@ -97,6 +96,12 @@ abstract class CartesianRendererBase implements CartesianRenderer {
}
}
}
+
+ // If all values are null or non finite, set the extent to be 0.
+ if (max == SMALL_INT_MIN && min == SMALL_INT_MAX) {
+ max = 0;
+ min = 0;
+ }
return new Extent(min, max);
}

Powered by Google App Engine
This is Rietveld 408576698