예제 #1
0
        /// <summary>
        /// Checks if the provided entry object is in bounds for drawing considering the current animation phase.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="set"></param>
        /// <returns></returns>
        protected bool IsInBoundsX(Entry e, IBarLineScatterCandleBubbleDataSet set)
        {
            if (e == null)
            {
                return(false);
            }

            float entryIndex = set.EntryIndex(e);

            return(e != null && entryIndex < set.EntryCount * Animator.PhaseX);
        }
예제 #2
0
            public void Set(IBarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet, Animator animator)
            {
                var phaseX = Math.Max(0.0, Math.Min(1.0, animator.PhaseX));

                var low  = chart.LowestVisibleX;
                var high = chart.HighestVisibleX;

                var   entryFrom = dataSet.EntryForXValue(low, float.NaN, DataSetRounding.Down);
                Entry entryTo   = dataSet.EntryForXValue(high, float.NaN, DataSetRounding.Up);

                Min   = entryFrom == null ? 0 : dataSet.EntryIndex(entryFrom);
                Max   = entryTo == null ? 0 : dataSet.EntryIndex(entryTo);
                Range = (int)((Max - Min) * phaseX);
            }
예제 #3
0
 public Bounds(IBarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet, Animator animator)
 {
     Set(chart, dataSet, animator);
 }