46 import javafx.beans.value.WritableValue;
47 import javafx.collections.FXCollections;
48 import javafx.collections.ListChangeListener;
49 import javafx.collections.ObservableList;
50 import javafx.scene.AccessibleRole;
51 import javafx.scene.Node;
52 import javafx.scene.layout.StackPane;
53 import javafx.scene.shape.LineTo;
54 import javafx.scene.shape.MoveTo;
55 import javafx.scene.shape.Path;
56 import javafx.scene.shape.PathElement;
57 import javafx.scene.shape.StrokeLineJoin;
58 import javafx.util.Duration;
59
60 import com.sun.javafx.charts.Legend;
61 import com.sun.javafx.charts.Legend.LegendItem;
62
63 import javafx.css.StyleableBooleanProperty;
64 import javafx.css.CssMetaData;
65
66 import com.sun.javafx.css.converters.BooleanConverter;
67
68 import java.util.*;
69
70 import javafx.css.Styleable;
71 import javafx.css.StyleableProperty;
72
73 /**
74 * Line Chart plots a line connecting the data points in a series. The data points
75 * themselves can be represented by symbols optionally. Line charts are usually used
76 * to view data trends over time or category.
77 * @since JavaFX 2.0
78 */
79 public class LineChart<X,Y> extends XYChart<X,Y> {
80
81 // -------------- PRIVATE FIELDS ------------------------------------------
82
83 /** A multiplier for the Y values that we store for each series, it is used to animate in a new series */
84 private Map<Series<X,Y>, DoubleProperty> seriesYMultiplierMap = new HashMap<>();
85 private Legend legend = new Legend();
86 private Timeline dataRemoveTimeline;
|
46 import javafx.beans.value.WritableValue;
47 import javafx.collections.FXCollections;
48 import javafx.collections.ListChangeListener;
49 import javafx.collections.ObservableList;
50 import javafx.scene.AccessibleRole;
51 import javafx.scene.Node;
52 import javafx.scene.layout.StackPane;
53 import javafx.scene.shape.LineTo;
54 import javafx.scene.shape.MoveTo;
55 import javafx.scene.shape.Path;
56 import javafx.scene.shape.PathElement;
57 import javafx.scene.shape.StrokeLineJoin;
58 import javafx.util.Duration;
59
60 import com.sun.javafx.charts.Legend;
61 import com.sun.javafx.charts.Legend.LegendItem;
62
63 import javafx.css.StyleableBooleanProperty;
64 import javafx.css.CssMetaData;
65
66 import javafx.css.converter.BooleanConverter;
67
68 import java.util.*;
69
70 import javafx.css.Styleable;
71 import javafx.css.StyleableProperty;
72
73 /**
74 * Line Chart plots a line connecting the data points in a series. The data points
75 * themselves can be represented by symbols optionally. Line charts are usually used
76 * to view data trends over time or category.
77 * @since JavaFX 2.0
78 */
79 public class LineChart<X,Y> extends XYChart<X,Y> {
80
81 // -------------- PRIVATE FIELDS ------------------------------------------
82
83 /** A multiplier for the Y values that we store for each series, it is used to animate in a new series */
84 private Map<Series<X,Y>, DoubleProperty> seriesYMultiplierMap = new HashMap<>();
85 private Legend legend = new Legend();
86 private Timeline dataRemoveTimeline;
|