How to create the order book depth chart with SciChart?
- Nizzle Bizzle asked 5 years ago
- last edited 5 years ago
-
Funds are safu
- You must login to post comments
Hi Nizzle Bizzle,
Well I don’t see any problems with this. You just need to add 2 FastMountainRenderableSeries in same chart and provide data for both series. I’ve modified one of our examples to show it:
final IAxis xBottomAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).build();
final IAxis yRightAxis = sciChartBuilder.newNumericAxis().withGrowBy(0.1d, 0.1d).build();
final IXyDataSeries<Double, Double> ds0 = sciChartBuilder.newXyDataSeries(Double.class, Double.class).build();
final IXyDataSeries<Double, Double> ds1 = sciChartBuilder.newXyDataSeries(Double.class, Double.class).build();
ds0.append(0d, 10d);
ds0.append(10d, 0d);
ds1.append(10d, 0d);
ds1.append(20d, 10d);
final FastMountainRenderableSeries rs0 = sciChartBuilder.newMountainSeries()
.withDataSeries(ds0)
.withStrokeStyle(0xFF00FF00, 1f, true)
.withAreaFillColor(0x7700FF00)
.build();
final FastMountainRenderableSeries rs1 = sciChartBuilder.newMountainSeries()
.withDataSeries(ds1)
.withStrokeStyle(0xFFFF0000, 1f, true)
.withAreaFillColor(0x77FF0000)
.build();
UpdateSuspender.using(surface, new Runnable() {
@Override
public void run() {
Collections.addAll(surface.getXAxes(), xBottomAxis);
Collections.addAll(surface.getYAxes(), yRightAxis);
Collections.addAll(surface.getRenderableSeries(), rs0, rs1);
Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build());
}
});
Is this suitable for your needs?
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
Please login first to submit.