-
Notifications
You must be signed in to change notification settings - Fork 95
/
FinancialHiLowSample.java
37 lines (32 loc) · 1.24 KB
/
FinancialHiLowSample.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package io.fair_acc.sample.financial;
import io.fair_acc.chartfx.XYChart;
import io.fair_acc.chartfx.renderer.ErrorStyle;
import io.fair_acc.chartfx.renderer.spi.ErrorDataSetRenderer;
import io.fair_acc.chartfx.renderer.spi.financial.HighLowRenderer;
import io.fair_acc.dataset.spi.DefaultDataSet;
import io.fair_acc.dataset.spi.financial.OhlcvDataSet;
/**
* OHLC (HiLo) Renderer Sample
*
* @author afischer
*/
public class FinancialHiLowSample extends AbstractBasicFinancialApplication {
protected void prepareRenderers(XYChart chart, OhlcvDataSet ohlcvDataSet, DefaultDataSet indiSet) {
// create and apply renderers
HighLowRenderer highLowRenderer = new HighLowRenderer();
highLowRenderer.getDatasets().addAll(ohlcvDataSet);
ErrorDataSetRenderer avgRenderer = new ErrorDataSetRenderer();
avgRenderer.setDrawMarker(false);
avgRenderer.setErrorStyle(ErrorStyle.NONE);
avgRenderer.getDatasets().addAll(indiSet);
chart.getRenderers().clear();
chart.getRenderers().add(highLowRenderer);
chart.getRenderers().add(avgRenderer);
}
/**
* @param args the command line arguments
*/
public static void main(final String[] args) {
launch(args);
}
}