Changeset 987 for trunk/sources/HeuristicLab.Visualization/LineChart.cs
- Timestamp:
- 12/14/08 18:48:35 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/LineChart.cs
r985 r987 51 51 minDataValue = Double.PositiveInfinity; 52 52 maxDataValue = Double.NegativeInfinity; 53 54 53 } 55 54 … … 88 87 maxDataRowCount = row.Count; 89 88 90 InitShapes(row); 89 InitLineShapes(row); 90 InitXAxis(); 91 } 92 93 private void InitXAxis() { 94 int numLabels = 0; 95 96 foreach (IDataRow row in model.Rows) { 97 numLabels = Math.Max(numLabels, row.Count); 98 } 99 100 xAxis.ClearLabels(); 101 102 for (int i = 0; i < numLabels; i++) { 103 xAxis.SetLabel(i, i.ToString()); 104 } 91 105 } 92 106 … … 101 115 } 102 116 103 private void InitShapes(IDataRow row) { 104 105 117 private void InitLineShapes(IDataRow row) { 106 118 List<LineShape> lineShapes = new List<LineShape>(); 107 119 if (row.Count > 0) { … … 132 144 // TODO use action parameter 133 145 private void OnRowValueChanged(IDataRow row, double value, int index, Action action) { 146 xAxis.SetLabel(index, index.ToString()); 147 134 148 List<LineShape> lineShapes = rowToLineShapes[row]; 135 149 maxDataValue = Math.Max(value, maxDataValue); … … 142 156 // new value was added 143 157 if (index > 0 && index == lineShapes.Count + 1) { 144 145 158 if (maxDataRowCount < row.Count) 146 159 maxDataRowCount = row.Count; … … 148 161 lineShapes.Add(lineShape); 149 162 // TODO each DataRow needs its own WorldShape so Y Axes can be zoomed independently. 150 canvasUI1.MainCanvas.WorldShape.AddShape(lineShape);163 root.AddShape(lineShape); 151 164 } 152 165 … … 171 184 } 172 185 173 private void OnModelChanged() {} 186 private void OnModelChanged() { 187 InitXAxis(); 188 } 174 189 175 190 #endregion
Note: See TracChangeset
for help on using the changeset viewer.