Source/NFX.WinForms/Controls/ChartKit/Temporal/TimeSeriesChart.cs
/// <summary>
/// Maps X coordinate to primary series sample
/// </summary>
Maps X coordinate to primary series sample
Maps X coordinate to primary series sample
public ITimeSeriesSample MapXToSample(int xcoord)
    {
      if (m_Series == null) return null;
      var maxSampleWidth = m_Series.GetMaxSampleWidth();
      var data = m_Series.Data.Skip(m_HScrollPosition);
      var x = VRulerPosition == VRulerPosition.Left ? VRulerWidth + 1 : 1;
      if (m_Zoom != 1.0f)
      {
        x = (int)(x/m_Zoom);
        xcoord = (int)(xcoord/m_Zoom);
      }
      ITimeSeriesSample prior = null;
      foreach (var sample in data)
      {
        if (xcoord < x)
        {
          return prior;
        }
        x += maxSampleWidth;
        x++; 
        prior = sample;
      }
      return prior;
    }
public ITimeSeriesSample MapXToSample ( int xcoord ) { if ( m_Series == null ) return null ; var maxSampleWidth = m_Series . GetMaxSampleWidth ( ) ; var data = m_Series . Data . Skip ( m_HScrollPosition ) ; var x = VRulerPosition == VRulerPosition . Left ? VRulerWidth + 1 : 1 ; if ( m_Zoom != 1.0f ) { x = ( int ) ( x / m_Zoom ) ; xcoord = ( int ) ( xcoord / m_Zoom ) ; } ITimeSeriesSample prior = null ; foreach ( var sample in data ) { if ( xcoord < x ) { return prior ; } x += maxSampleWidth ; x ++ ; prior = sample ; } return prior ; }
Maps X coordinate to primary series sample
Maps X coordinate to primary series sample
/*
      var xcutof = VRulerPosition == VRulerPosition.Right
                 ? Width - 1 - VRulerWidth
                 : Width;
      */ //margin
xcoord
int