- public void addSeries(int index, String label, int fetch, AltosUnits units, Color color) {
- AltosUISeries series = new AltosUISeries(label, fetch, units, color);
- XYSeriesCollection dataset = new XYSeriesCollection(series);
+ public AltosUIAxis newAxis(String label, AltosUnits units, AltosUILineStyle line_style, int flags) {
+ AltosUIAxis axis = new AltosUIAxis(label, units, line_style, axis_index++, flags);
+ plot.setRangeAxis(axis.index, axis);
+ return axis;
+ }
+
+ public AltosUIAxis newAxis(String label, AltosUnits units, AltosUILineStyle line_style) {
+ return newAxis(label, units, line_style, AltosUIAxis.axis_default);
+ }
+
+ void addAxis(AltosUIAxis axis) {
+ if (!axes_added.containsKey(axis.index)) {
+ axes_added.put(axis.index, true);
+ plot.setRangeAxis(axis.index, axis);
+ }
+ }
+
+ public void addSeries(AltosUITimeSeries series) {
+ XYSeriesCollection dataset = new XYSeriesCollection(series.xy_series());
+
+ addAxis(series.axis);