List of usage examples for org.jfree.chart.renderer.xy XYArrowRenderer setSeriesPaint
public void setSeriesPaint(int series, Paint paint)
From source file:no.met.jtimeseries.chart.ChartPlotter.java
/** * Add arrow symobl to the chart. Specify height to follow value curve. * Plot in the middle of chart if height is null. * //w w w . ja v a 2 s.co m * @param direction * The direction of arrow * @param height * The followed height * @param offset * The offset value to follow the height, value is between * [-1,1] */ public void addArrowDirectionPlot(NumberPhenomenon direction, NumberPhenomenon height, double offset, PlotStyle plotStyle) { XYArrowRenderer arrowRender = new XYArrowRenderer(); arrowRender.setSeriesVisibleInLegend(0, false); arrowRender.setSeriesPaint(0, plotStyle.getSeriesColor()); ArrowDataset dataset = Utility.toChartArrowDataset(direction, height, offset); XYPlot arrowPlot = new XYPlot(dataset, plot.getDomainAxis(0), plotStyle.getNumberAxis(), arrowRender); arrowPlot.setRangeGridlinesVisible(false); arrowPlot.setOutlineVisible(false); plot.mapDatasetToRangeAxis(plotIndex, rangeAxisIndex); plot.setDataset(plotIndex, dataset); plot.setRenderer(plotIndex, arrowRender); plotIndex++; rangeAxisIndex++; }