Changeset 926 for trunk/sources
- Timestamp:
- 12/09/08 14:17:56 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Logging/LinechartView.cs
r362 r926 34 34 namespace HeuristicLab.Logging { 35 35 public partial class LinechartView : ViewBase { 36 private double maxY = double.MinValue, minY = double.MaxValue; 36 37 private static int[] colors = new int[] { 37 38 182,182,255, … … 86 87 datachart.Group.Clear(); 87 88 datachart.Group.Add(new Axis(datachart, 0, 0, AxisType.Both)); 88 double maxY = double.MinValue, minY = double.MaxValue;89 89 if(Linechart != null) { 90 90 datachart.UpdateEnabled = false; … … 100 100 ItemList list = (ItemList)Linechart.Values[i]; 101 101 for(int j = 0; j < list.Count; j++) { 102 double value = ((DoubleData)list[j]).Data; 102 double value = 0.0; 103 if (list[j] is IntData) value = (double)((IntData)list[j]).Data; 104 else value = ((DoubleData)list[j]).Data; 103 105 if(!double.IsInfinity(value) && !double.IsNaN(value)) { 104 106 if(value < minY) minY = value; … … 130 132 ItemList list = (ItemList)e.Item; 131 133 datachart.UpdateEnabled = false; 132 for(int i = 0; i < list.Count; i++) 133 datachart.AddDataPoint(i, e.Index, ((DoubleData)list[i]).Data); 134 for (int i = 0; i < list.Count; i++) { 135 double value = 0.0; 136 if (list[i] is IntData) value = (double)((IntData)list[i]).Data; 137 else value = ((DoubleData)list[i]).Data; 138 datachart.AddDataPoint(i, e.Index, value); 139 if (value < minY) minY = value; 140 if (value > maxY) maxY = value; 141 } 142 datachart.ZoomIn(-Linechart.Values.Count * 0.05, minY - (minY * 0.1), Linechart.Values.Count * 1.05, maxY * 1.05); 134 143 datachart.UpdateEnabled = true; 135 144 datachart.EnforceUpdate();
Note: See TracChangeset
for help on using the changeset viewer.