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

Unified Diff: packages/charted/lib/charts/behaviors/chart_tooltip.dart

Issue 2213693002: Updated charted DEP to 0.4.X (Closed) Base URL: https://github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 4 years, 4 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/behaviors/chart_tooltip.dart
diff --git a/packages/charted/lib/charts/behaviors/chart_tooltip.dart b/packages/charted/lib/charts/behaviors/chart_tooltip.dart
index 083d0f811767be8391d5d338810ec84bddf2f8e2..85d4b552c0110211babae2fab372b5d934ca9e7d 100644
--- a/packages/charted/lib/charts/behaviors/chart_tooltip.dart
+++ b/packages/charted/lib/charts/behaviors/chart_tooltip.dart
@@ -91,9 +91,18 @@ class ChartTooltip implements ChartBehavior {
// tooltip for them, if none is selected/hovered, show all.
var activeMeasures = [];
if (showSelectedMeasure) {
- activeMeasures.addAll(_state.selection);
- activeMeasures
- .add(_state.preview != null ? _state.preview : _state.hovered.first);
+ if(_state != null) {
+ activeMeasures.addAll(_state.selection);
+ activeMeasures
+ .add(_state.preview != null
+ ? _state.preview
+ : _state.hovered.first);
+ } else {
+
+ // If state is null, chart tooltip will not capture selection, but only
+ // display for the currently hovered measure column.
+ activeMeasures.add(e.column);
+ }
if (activeMeasures.isEmpty) {
for (var series in _area.config.series) {
activeMeasures.addAll(series.measures);
« no previous file with comments | « packages/charted/lib/charts/behaviors/axis_label_tooltip.dart ('k') | packages/charted/lib/charts/behaviors/hovercard.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698