private void SetAxisValue(StripChartXAxis axis, double max, double min) { if (max > axis.Minimum) { axis.Maximum = max; axis.Minimum = min; } else if (min < axis.Maximum) { axis.Minimum = min; axis.Maximum = max; } }
// TODO 新增属性需要在这里添加代码,后期可以考虑通过接口注解实现 internal void ApplyConfig(StripChartXAxis template) { this.Title = template.Title; this.TitleOrientation = template.TitleOrientation; this.TitlePosition = template.TitlePosition; this.AutoScale = template.AutoScale; this.AutoZoomReset = template.AutoZoomReset; this.InitWithScaleView = template.InitWithScaleView; this.IsLogarithmic = template.IsLogarithmic; this.LabelEnabled = template.LabelEnabled; this.LabelFormat = template.LabelFormat; this.LabelAngle = template.LabelAngle; this.MajorGridEnabled = template.MajorGridEnabled; this.MajorGridColor = template.MajorGridColor; this.MajorGridType = template.MajorGridType; this.MinorGridEnabled = template.MinorGridEnabled; this.MinorGridColor = template.MinorGridColor; this.MinorGridType = template.MinorGridType; this.TickWidth = template.TickWidth; this.IsReversed = template.IsReversed; // 需要判断赋值顺序 double max, min; template.GetSpecifiedRange(out max, out min); this._specifiedMax = max; this._specifiedMin = min; this.RefreshAxisRange(); RefreshGridsAndLabels(); template.GetViewRange(out max, out min); this._viewMax = max; this._viewMin = min; this.Color = template.Color; this.TickWidth = template.TickWidth; this.MajorGridCount = template.MajorGridCount; }