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
- Yura Khariton answered 6 years ago
- You must login to post comments
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?
- Huang haiyan answered 6 years ago
- You must login to post comments
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
- Yura Khariton answered 6 years ago
- You must login to post comments
Please login first to submit.