io.fair_acc.sample.financial.FinancialFootprintSample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of samples Show documentation
Show all versions of samples Show documentation
Small sample applications to showcase the features of the chart-fx library.
The newest version!
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.CandleStickRenderer;
import io.fair_acc.dataset.spi.DefaultDataSet;
import io.fair_acc.dataset.spi.financial.OhlcvDataSet;
/**
* Footprint Renderer Sample
*
* @author afischer
*/
public class FinancialFootprintSample extends AbstractBasicFinancialApplication {
protected void prepareRenderers(XYChart chart, OhlcvDataSet ohlcvDataSet, DefaultDataSet indiSet) {
// create and apply renderers
CandleStickRenderer candleStickRenderer = new CandleStickRenderer();
candleStickRenderer.getDatasets().addAll(ohlcvDataSet);
ErrorDataSetRenderer avgRenderer = new ErrorDataSetRenderer();
avgRenderer.setDrawMarker(false);
avgRenderer.setErrorStyle(ErrorStyle.NONE);
avgRenderer.getDatasets().addAll(indiSet);
chart.getRenderers().clear();
chart.getRenderers().add(candleStickRenderer);
chart.getRenderers().add(avgRenderer);
}
/**
* @param args the command line arguments
*/
public static void main(final String[] args) {
launch(args);
}
}