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

Side by Side Diff: charted/lib/charts/chart_legend.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « charted/lib/charts/chart_events.dart ('k') | charted/lib/charts/chart_renderer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 //
2 // Copyright 2014 Google Inc. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 //
8
9 part of charted.charts;
10
11 ///
12 /// Interface that is implemented by classes that support
13 /// displaying legend.
14 ///
15 abstract class ChartLegend {
16 /// Title of the legend, dynamically updates the legend title when set.
17 String title;
18
19 /// Called by [ChartArea] to notify changes to legend.
20 update(Iterable<ChartLegendItem> legend, ChartArea chart);
21
22 /// Called by [ChartArea] to dispose selection listeners.
23 dispose();
24
25 /// Factory to create an instance of the default implementation.
26 factory ChartLegend(Element host,
27 {maxItems: 0, title: '', showValues: false}) =>
28 new DefaultChartLegendImpl(host, maxItems, showValues, title);
29 }
30
31 ///
32 /// Class representing an item in the legend.
33 ///
34 class ChartLegendItem {
35 /// Index of the row/column in [ChartData]. Legend uses column based coloring
36 /// in [CartesianArea] that has useRowColoring set to false and row based
37 /// coloring in all other cases.
38 int index;
39
40 /// HTML color used for the row/column in chart
41 String color;
42
43 /// The label of the item.
44 String label;
45
46 /// Description of the item.
47 String description;
48
49 /// Pre-formatted value to use as value.
50 String value;
51
52 /// List of series that this column is part of
53 Iterable<ChartSeries> series;
54
55 ChartLegendItem({this.index, this.color,
56 this.label, this.description, this.series, this.value});
57 }
OLDNEW
« no previous file with comments | « charted/lib/charts/chart_events.dart ('k') | charted/lib/charts/chart_renderer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698