SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

1
0

How to create the order book depth chart with SciChart?

enter image description here

Version
2.2.2.2410
Images
  • Andrew
    Funds are safu
  • You must to post comments
1
0

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

Images
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.