/// <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); }
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); }
public Bounds(IBarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet dataSet, Animator animator) { Set(chart, dataSet, animator); }