From: Keith Packard Date: Wed, 2 Jan 2013 00:57:31 +0000 (-0800) Subject: micropeak: Fix chart colors X-Git-Tag: 1.1.9.3~8^2~9^2~33 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=982b272920fcb444fd399941cabe613d8ac7104b micropeak: Fix chart colors Need to apply custom colors after setting the theme Signed-off-by: Keith Packard --- diff --git a/micropeak/MicroGraph.java b/micropeak/MicroGraph.java index b9b084f8..c5580634 100644 --- a/micropeak/MicroGraph.java +++ b/micropeak/MicroGraph.java @@ -72,9 +72,12 @@ public class MicroGraph implements AltosUnitsListener { MicroSeries speedSeries; MicroSeries accelSeries; - static final private Color red = new Color(194,31,31); - static final private Color green = new Color(31,194,31); - static final private Color blue = new Color(31,31,194); + static final private Color height_color = new Color(194,31,31); + static final private Color speed_color = new Color(31,194,31); + static final private Color accel_color = new Color(31,31,194); + static final private Color gridline_color = new Color(0, 0, 0); + static final private Color border_color = new Color(255, 255, 255); + static final private Color background_color = new Color(255, 255, 255); MicroData data; @@ -142,14 +145,22 @@ public class MicroGraph implements AltosUnitsListener { plot.setDomainPannable(true); plot.setRangePannable(true); - heightSeries = addSeries(0, "Height", AltosConvert.height.show_units(), red); - speedSeries = addSeries(1, "Speed", AltosConvert.speed.show_units(), green); - accelSeries = addSeries(2, "Acceleration", AltosConvert.accel.show_units(), blue); - chart = new JFreeChart("Flight", JFreeChart.DEFAULT_TITLE_FONT, plot, true); ChartUtilities.applyCurrentTheme(chart); + + heightSeries = addSeries(0, "Height", AltosConvert.height.show_units(), height_color); + speedSeries = addSeries(1, "Speed", AltosConvert.speed.show_units(), speed_color); + accelSeries = addSeries(2, "Acceleration", AltosConvert.accel.show_units(), accel_color); + + plot.setDomainGridlinePaint(gridline_color); + plot.setRangeGridlinePaint(gridline_color); + plot.setBackgroundPaint(background_color); + plot.setBackgroundAlpha((float) 1); + + chart.setBackgroundPaint(background_color); + chart.setBorderPaint(border_color); panel = new ChartPanel(chart); panel.setMouseWheelEnabled(true); panel.setPreferredSize(new java.awt.Dimension(800, 500));