var temps = HistoryManager.getHistoriesByPrifileId(selected_Profile.id);
foreach (var temp in temps)
{
histories.Add(temp);
}
if (histories.Count <= 0)
{
ClearAllLabels();
return;
}
// 首先 按照 Sys排序
histories.Sort(new ComparableHistorySys());
int sys_min = histories[0].systolic;
int sys_max = histories[histories.Count - 1].systolic;
// 排序方法,默认从小到大排序
public class ComparableHistorySys : IComparer<tb_History>
{
public int Compare(tb_History x, tb_History y)
{
return x.systolic.CompareTo(y.systolic);
}
}
List histories;histories = new List();var temps = HistoryManager.getHistoriesByPrifileId(selected_Profile.id);foreach (var temp in temps) { histories.Add(temp);