Pre loader

Whether the chart is enlarged or reduced, the coordinate display position on the X axis can be fixed all the time.

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

How to achieve this effect?

Version
2.1.0.2210
Images
  • You must to post comments
0
0

Hi Huang,

Have you tried to set direction for PinchZoomModifier to disable zoom in X direction?

    // when create modifier directly in code
    final PinchZoomModifier pinchZoomModifier = new PinchZoomModifier();
    pinchZoomModifier.setDirection(Direction2D.YDirection);

    // or when using builders
    final ModifierGroup modifierGroup = sciChartBuilder.newModifierGroup()
            .withPinchZoomModifier().withXyDirection(Direction2D.YDirection).build().build();

Hope this will help you!

Best regards,
Yura

  • You must to post comments
0
0

Please look at the two Attachments below, scichart.zip and otherchart.zip.
Please pay attention to the location of the display of the coordinate label.
In otherchart.zip,Whether the chart is enlarged or reduced, the location of the display of the coordinate label can be fixed all the time.
How to achieve this effect like otherchart?

  • You must to post comments
0
0

Hi Huang,

To achieve behavior from that video ( when tick labels are drawn at same postion ) you need to create custom TickProvider for your xAxis:

 class CustomTickProvider extends TickProvider {
    private final int tickCount;

    public CustomTickProvider(int tickCount) {
        this.tickCount = tickCount;
    }

    @Override
    protected void updateTicks(DoubleValues minorTicks, DoubleValues majorTicks) {
        final IRange visibleRange = axis.getVisibleRange();
        final double min = visibleRange.getMinAsDouble();
        final double max = visibleRange.getMaxAsDouble();

        final double step = (max - min)/(tickCount - 1);
        double current = min;
        while (current <= max) {
            majorTicks.add(current);
            current += step;
        }
    }
}

xAxis.setTickProvider(new CustomTickProvider(4));

Is this suitable for your needs?

Best regards,
Yura

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies