List of usage examples for org.jfree.chart.annotations XYPointerAnnotation setAngle
public void setAngle(double angle)
From source file:org.trade.ui.chart.CandlestickChart.java
/** * Method addBuySellTradeArrow./* www. j ava 2 s .c o m*/ * * @param action * String * @param price * Money * @param time * Date * @param quantity * Integer * @throws ValueTypeException */ public void addBuySellTradeArrow(String action, Money price, Date time, Integer quantity) throws ValueTypeException { String label = Action.newInstance(action) + " " + quantity + "@" + price; XYPointerAnnotation arrow = new XYPointerAnnotation(label, time.getTime(), price.doubleValue(), 90d); arrow.setLabelOffset(5.0); arrow.setBackgroundPaint(Color.GREEN); if (action.equals(Action.SELL)) { arrow.setAngle(-90d); arrow.setBackgroundPaint(Color.RED); } CombinedDomainXYPlot combinedXYplot = (CombinedDomainXYPlot) this.chart.getPlot(); @SuppressWarnings("unchecked") List<XYPlot> subplots = combinedXYplot.getSubplots(); XYPlot xyplot = subplots.get(0); xyplot.addAnnotation(arrow); this.chart.fireChartChanged(); }