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


How to create the order book depth chart with SciChart?

enter image description here

  • You must 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()
            .withStrokeStyle(0xFF00FF00, 1f, true)

    final FastMountainRenderableSeries rs1 = sciChartBuilder.newMountainSeries()
            .withStrokeStyle(0xFFFF0000, 1f, true)

    UpdateSuspender.using(surface, new Runnable() {
        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,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.