final Marker start = new ValueMarker(3400000.0); start.setPaint(Color.red); start.setLabel("Current Value"); start.setLabelAnchor(RectangleAnchor.BOTTOM_LEFT); start.setLabelTextAnchor(TextAnchor.TOP_LEFT); plot.addRangeMarker(start);
Marker threshold = new ValueMarker(80.0); Hour hour1 = new Hour(18, 30, 6, 2005); Hour hour2 = new Hour(20, 30, 6, 2005); double millis1 = hour1.getFirstMillisecond(); double millis2 = hour2.getFirstMillisecond(); Marker cooling = new IntervalMarker(millis1, millis2); cooling.setLabelOffsetType(LengthAdjustmentType.EXPAND); cooling.setPaint(new Color(150, 150, 255)); cooling.setLabel("Automatic Cooling"); cooling.setLabelFont(new Font("SansSerif", Font.PLAIN, 11)); cooling.setLabelPaint(Color.blue); cooling.setLabelAnchor(RectangleAnchor.TOP_LEFT); cooling.setLabelTextAnchor(TextAnchor.TOP_RIGHT); plot.addDomainMarker(cooling, Layer.BACKGROUND);
lsl.setLabel("LSL"); if (range) { lsl.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT); lsl.setLabelTextAnchor(TextAnchor.TOP_RIGHT); plot.addRangeMarker(lsl); } else { lsl.setLabelAnchor(RectangleAnchor.TOP_LEFT); lsl.setLabelTextAnchor(TextAnchor.TOP_RIGHT); plot.addDomainMarker(lsl); usl.setLabel("USL"); if (range) { usl.setLabelAnchor(RectangleAnchor.TOP_RIGHT); usl.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); plot.addRangeMarker(usl); } else { usl.setLabelAnchor(RectangleAnchor.TOP_RIGHT); usl.setLabelTextAnchor(TextAnchor.TOP_LEFT); plot.addDomainMarker(usl);