2016-10-17 13 views
1

X軸でズームしてパンする必要があるグラフがあります。これにはラベル付きのデータポイントがあり、ズームするとグラフを水平方向に拡大して移動することができます。 私はこれを達成するためにPinchZoomModifierとTouchPanModifierを使用していますが、ほとんどの場合正しく動作します。 しかし、グラフをズームアウトして自分のデータポイントの範囲外にあるものを表示することはできません。なぜなら、私の状況では意味をなさないからです。どうすればこれを達成できますか?SciChartでのズームアウトの制限

答えて

0

対象プラットフォームはわかりませんが、以前の質問履歴に基づいてWPFを想定しています。

Clipping the Axis.VisibleRange on Zoom and Panのテクニックの1つを使用してズームを制限することができます。

すべてのSciChartプラットフォームには、VisibleRangeをクリップまたは制限する同様の方法があります。たとえば、SciChart iOS has the VisibleRangeLimit APISciChart Android has the MinimalZoomConstrain API

開示:私はscichartのハイテクリードは

+1

私が解決し、このために申し訳ありませんこんにちは、私はこの質問を閉じるのを忘れていました。 – Shaggydog

0

プロジェクトあなたはSCIPinchZoomModifierをオーバーライドして、この問題を解決することができます。

class CustomZoomModifier: SCIPinchZoomModifier { 

    var maxValue = 3.0 
    var minValue = -1.0 
    var currentXZoom = 0.0 
    var currentYZoom = 0.0 

    override func performZoom(at mousePoint: CGPoint, xValue: Double, yValue: Double) { 
    var newXValue = 0.0 
    var newYvalue = 0.0 
    if xValue + currentXZoom <= maxValue && xValue + currentXZoom >= minValue { 
     newXValue = xValue 
     currentXZoom += xValue 
    } 
    if yValue + currentYZoom <= maxValue && yValue + currentYZoom >= minValue { 
     newYvalue = yValue 
     currentYZoom += yValue 
    } 

    if newXValue != 0.0 || newYvalue != 0.0 { 
     super.performZoom(at: mousePoint, xValue: newXValue, yValue: newYvalue) 
    } 
    } 
}