30
31 import javafx.animation.*;
32 import javafx.application.Platform;
33 import javafx.beans.NamedArg;
34 import javafx.beans.property.DoubleProperty;
35 import javafx.beans.value.WritableValue;
36 import javafx.collections.FXCollections;
37 import javafx.collections.ObservableList;
38 import javafx.geometry.Orientation;
39 import javafx.scene.AccessibleRole;
40 import javafx.scene.Node;
41 import javafx.scene.layout.StackPane;
42 import javafx.util.Duration;
43
44 import com.sun.javafx.charts.Legend;
45
46 import javafx.css.StyleableDoubleProperty;
47 import javafx.css.CssMetaData;
48 import javafx.css.PseudoClass;
49
50 import com.sun.javafx.css.converters.SizeConverter;
51
52 import javafx.collections.ListChangeListener;
53 import javafx.css.Styleable;
54 import javafx.css.StyleableProperty;
55
56
57 /**
58 * StackedBarChart is a variation of {@link BarChart} that plots bars indicating
59 * data values for a category. The bars can be vertical or horizontal depending
60 * on which axis is a category axis.
61 * The bar for each series is stacked on top of the previous series.
62 * @since JavaFX 2.1
63 */
64 public class StackedBarChart<X, Y> extends XYChart<X, Y> {
65
66 // -------------- PRIVATE FIELDS -------------------------------------------
67 private Map<Series, Map<String, List<Data<X, Y>>>> seriesCategoryMap =
68 new HashMap<Series, Map<String, List<Data<X, Y>>>>();
69 private Legend legend = new Legend();
70 private final Orientation orientation;
|
30
31 import javafx.animation.*;
32 import javafx.application.Platform;
33 import javafx.beans.NamedArg;
34 import javafx.beans.property.DoubleProperty;
35 import javafx.beans.value.WritableValue;
36 import javafx.collections.FXCollections;
37 import javafx.collections.ObservableList;
38 import javafx.geometry.Orientation;
39 import javafx.scene.AccessibleRole;
40 import javafx.scene.Node;
41 import javafx.scene.layout.StackPane;
42 import javafx.util.Duration;
43
44 import com.sun.javafx.charts.Legend;
45
46 import javafx.css.StyleableDoubleProperty;
47 import javafx.css.CssMetaData;
48 import javafx.css.PseudoClass;
49
50 import javafx.css.converter.SizeConverter;
51
52 import javafx.collections.ListChangeListener;
53 import javafx.css.Styleable;
54 import javafx.css.StyleableProperty;
55
56
57 /**
58 * StackedBarChart is a variation of {@link BarChart} that plots bars indicating
59 * data values for a category. The bars can be vertical or horizontal depending
60 * on which axis is a category axis.
61 * The bar for each series is stacked on top of the previous series.
62 * @since JavaFX 2.1
63 */
64 public class StackedBarChart<X, Y> extends XYChart<X, Y> {
65
66 // -------------- PRIVATE FIELDS -------------------------------------------
67 private Map<Series, Map<String, List<Data<X, Y>>>> seriesCategoryMap =
68 new HashMap<Series, Map<String, List<Data<X, Y>>>>();
69 private Legend legend = new Legend();
70 private final Orientation orientation;
|