diff options
author | Keith Packard <keithp@keithp.com> | 2013-02-10 00:29:29 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-02-10 00:30:32 -0800 |
commit | 2efd3ad80d4fefa8ccc1b80a2e657dbf9ba0c60f (patch) | |
tree | 02fdd0be077d082702da5f150670437e080318e2 /altosuilib/AltosUISeries.java | |
parent | 0169e56ad030c0096b1068d00f06957990dfb31f (diff) |
altosui/altoslib/altosuilib: Switch altosui to shared graph code
This adds a configuration tab to the graph window to enable/disable
various plotted values.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosuilib/AltosUISeries.java')
-rw-r--r-- | altosuilib/AltosUISeries.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/altosuilib/AltosUISeries.java b/altosuilib/AltosUISeries.java index 26679471..ac09a3cc 100644 --- a/altosuilib/AltosUISeries.java +++ b/altosuilib/AltosUISeries.java @@ -65,7 +65,10 @@ public class AltosUISeries extends XYSeries implements AltosUIGrapher { } public void add(AltosUIDataPoint dataPoint) { - super.add(dataPoint.x(), dataPoint.y(fetch)); + try { + super.add(dataPoint.x(), units.value(dataPoint.y(fetch))); + } catch (AltosUIDataMissing dm) { + } } public AltosUISeries (String label, int fetch, AltosUnits units, Color color, @@ -82,18 +85,7 @@ public class AltosUISeries extends XYSeries implements AltosUIGrapher { renderer = new XYLineAndShapeRenderer(true, false); renderer.setSeriesPaint(0, color); + renderer.setSeriesVisible(0, enable); set_units(); } - - public AltosUISeries (String label, int fetch, AltosUnits units, Color color, boolean enable) { - this(label, fetch, units, color, - enable, - new AltosUIAxis(label, units, color)); - } - - public AltosUISeries (String label, int fetch, AltosUnits units, Color color) { - this(label, fetch, units, color, - true, - new AltosUIAxis(label, units, color)); - } } |