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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // 1 //
2 // Copyright 2014 Google Inc. All rights reserved. 2 // Copyright 2014 Google Inc. All rights reserved.
3 // 3 //
4 // Use of this source code is governed by a BSD-style 4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at 5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd 6 // https://developers.google.com/open-source/licenses/bsd
7 // 7 //
8 8
9 part of charted.charts; 9 part of charted.charts;
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 _tooltipRoot.append('div') 85 _tooltipRoot.append('div')
86 ..classed('tooltip-total') 86 ..classed('tooltip-total')
87 ..text((formatter != null) ? formatter(total) : total.toString()); 87 ..text((formatter != null) ? formatter(total) : total.toString());
88 } 88 }
89 89
90 // Find the currently selectedMeasures and hoveredMeasures and show 90 // Find the currently selectedMeasures and hoveredMeasures and show
91 // tooltip for them, if none is selected/hovered, show all. 91 // tooltip for them, if none is selected/hovered, show all.
92 var activeMeasures = []; 92 var activeMeasures = [];
93 if (showSelectedMeasure) { 93 if (showSelectedMeasure) {
94 activeMeasures.addAll(_state.selection); 94 if(_state != null) {
95 activeMeasures 95 activeMeasures.addAll(_state.selection);
96 .add(_state.preview != null ? _state.preview : _state.hovered.first); 96 activeMeasures
97 .add(_state.preview != null
98 ? _state.preview
99 : _state.hovered.first);
100 } else {
101
102 // If state is null, chart tooltip will not capture selection, but only
103 // display for the currently hovered measure column.
104 activeMeasures.add(e.column);
105 }
97 if (activeMeasures.isEmpty) { 106 if (activeMeasures.isEmpty) {
98 for (var series in _area.config.series) { 107 for (var series in _area.config.series) {
99 activeMeasures.addAll(series.measures); 108 activeMeasures.addAll(series.measures);
100 } 109 }
101 } 110 }
102 activeMeasures.sort(); 111 activeMeasures.sort();
103 } 112 }
104 113
105 var data = (showSelectedMeasure) ? activeMeasures : e.series.measures; 114 var data = (showSelectedMeasure) ? activeMeasures : e.series.measures;
106 115
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 195 }
187 196
188 FormatFunction _getFormatterForColumn(int column) => 197 FormatFunction _getFormatterForColumn(int column) =>
189 _area.data.columns.elementAt(column).formatter; 198 _area.data.columns.elementAt(column).formatter;
190 199
191 hide(ChartEvent e) { 200 hide(ChartEvent e) {
192 if (_tooltipRoot == null) return; 201 if (_tooltipRoot == null) return;
193 _tooltipRoot.style('opacity', '0'); 202 _tooltipRoot.style('opacity', '0');
194 } 203 }
195 } 204 }
OLDNEW
« 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