public void Update(DataRange axisRange, int axisLength) { UnitLenght = axisLength / axisRange.Range; FirstScaleRange = new DataRange { Min = Convert.ToSingle( Math.Floor(Convert.ToDecimal(axisRange.Min) / axisRange.Weight) * axisRange.Weight), Max = Convert.ToSingle( Math.Ceiling(Convert.ToDecimal(axisRange.Max) / axisRange.Weight) * axisRange.Weight) }; NumOfFirstScalePerWeight = GetScaleNum( axisLength * (float)axisRange.Weight / axisRange.Range, GraphProperties.FIRST_SCALE_MIN_INTERVAL); SumOfFirstScale = (int)(FirstScaleRange.Range * NumOfFirstScalePerWeight / (float)axisRange.Weight); FirstScaleInterval = axisLength * (float)axisRange.Weight / (axisRange.Range * NumOfFirstScalePerWeight); NumOfSecondScalePerFirstScale = GetScaleNum( FirstScaleInterval, GraphProperties.SECOND_SCALE_MIN_INTERVAL); SecondScaleInterval = FirstScaleInterval / NumOfSecondScalePerFirstScale; }
public DataRect(float xMin, float xMax, float yMin, float yMax) { XAxisRange = new DataRange(xMin, xMax); YAxisRange = new DataRange(yMin, yMax); }