/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
OpenFlash/Charts/yaxis.cs
70 строк
2 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.ComponentModel; using OpenFlashChartLib.Json; namespace OpenFlashChartLib.Charts { public class YAxis : Axis { private int offset; private IList<string> _labels; public YAxis() { } [JsonProperty("tick-length")] [DefaultValue(0)] public int TickLength { get; set; } [JsonProperty("offset")] [DefaultValue(0)] public int Offset { get { return offset; } set { offset = value > 0 ? 1 : 0; } } [JsonProperty("labels")] public IList<string> Labels { get { if (_labels == null) _labels = new List<string>(); return _labels; } set { _labels = value; } } /// <summary> /// Tells serializer if the y labels should be serialized /// </summary> public bool LabelsSpecified { get { return _labels != null; } } public override bool IsSpecified() { return LabelsSpecified || Offset != 0 || TickLength != 0 || base.IsSpecified(); } public void SetRange(double min, double max) { Max = Math.Ceiling(max); Min = Math.Floor(min); } public void SetRange(double min, double max, int step) { Max = Math.Ceiling(max); Min = Math.Floor(min); Steps = step; } } }