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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.