Changeset 2359 for trunk/sources/HeuristicLab.CEDMA.Charting
- Timestamp:
- 09/15/09 16:02:26 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs
r2325 r2359 137 137 } else if (matrix.MultiDimensionalCategoricalVariables.Contains(xDimension)) { 138 138 var path = xDimension.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); 139 IEnumerable<MatrixRow<string, object>> subRows = (IEnumerable<MatrixRow<string, object>>)r.Get(path.ElementAt(0));139 IEnumerable<MatrixRow<string, object>> subRows = (IEnumerable<MatrixRow<string, object>>)r.Get(path.ElementAt(0)); 140 140 foreach (MatrixRow<string, object> subRow in subRows) { 141 141 if (subRow.Get(path.ElementAt(1)) != null) { … … 147 147 var path = xDimension.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); 148 148 IEnumerable<MatrixRow<string, object>> subRows = (IEnumerable<MatrixRow<string, object>>)r.Get(path.ElementAt(0)); 149 foreach (MatrixRow<string, object> subRow in subRows) {149 foreach (MatrixRow<string, object> subRow in subRows) { 150 150 if (subRow.Get(path.ElementAt(1)) != null) { 151 151 xs.Add(Convert.ToDouble(subRow.Get(path.ElementAt(1))) + r.XJitter * xJitterFactor); … … 162 162 } else if (matrix.MultiDimensionalCategoricalVariables.Contains(yDimension)) { 163 163 var path = yDimension.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); 164 IEnumerable<MatrixRow<string, object>> subRows = (IEnumerable<MatrixRow<string,object>>)r.Get(path.ElementAt(0));165 foreach (MatrixRow<string, object> subRow in subRows) {164 IEnumerable<MatrixRow<string, object>> subRows = (IEnumerable<MatrixRow<string, object>>)r.Get(path.ElementAt(0)); 165 foreach (MatrixRow<string, object> subRow in subRows) { 166 166 if (subRow.Get(path.ElementAt(1)) != null) { 167 167 ys.Add(matrix.IndexOfCategoricalValue(yDimension, subRow.Get(path.ElementAt(1))) + r.YJitter * yJitterFactor); … … 172 172 var path = yDimension.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); 173 173 IEnumerable<MatrixRow<string, object>> subRows = (IEnumerable<MatrixRow<string, object>>)r.Get(path.ElementAt(0)); 174 foreach (MatrixRow<string, object> subRow in subRows) {174 foreach (MatrixRow<string, object> subRow in subRows) { 175 175 if (subRow.Get(path.ElementAt(1)) != null) { 176 176 ys.Add(Convert.ToDouble(subRow.Get(path.ElementAt(1))) + r.YJitter * yJitterFactor); … … 195 195 if (double.IsInfinity(x) || x == double.MaxValue || x == double.MinValue) x = double.NaN; 196 196 if (double.IsInfinity(y) || y == double.MaxValue || y == double.MinValue) y = double.NaN; 197 if (!double.IsNaN(x) && !double.IsNaN(y) && IsReasonablePoint(new PointD(x, y))) { 197 //if (!double.IsNaN(x) && !double.IsNaN(y) && IsReasonablePoint(new PointD(x, y))) { 198 if (!double.IsNaN(x) && !double.IsNaN(y)) { 198 199 string actualXValue = actualXValues[Math.Min(i, actualXValues.Count() - 1)].ToString(); 199 200 string actualYValue = actualYValues[Math.Min(i, actualYValues.Count() - 1)].ToString(); … … 216 217 } 217 218 218 private bool IsReasonablePoint(PointD pointD) { 219 return pointD.X > LowerLeft.X && pointD.X < UpperRight.X && pointD.Y > LowerLeft.Y && pointD.Y < UpperRight.Y; 220 } 219 //Mk 15.09.09 15:00 commented because it is not necessary any more and causes troubles with repainting 220 //private bool IsReasonablePoint(PointD pointD) { 221 // return pointD.X > LowerLeft.X && pointD.X < UpperRight.X && pointD.Y > LowerLeft.Y && pointD.Y < UpperRight.Y; 222 //} 221 223 222 224 private int CalculateSize(double size, double minSize, double maxSize) { … … 235 237 236 238 private void ZoomToViewSize() { 237 if (minX < maxX && minY < maxY) { 238 // enlarge view by 5% on each side 239 double width = maxX - minX; 240 double height = maxY - minY; 241 minX = minX - width * 0.05; 242 maxX = maxX + width * 0.05; 243 minY = minY - height * 0.05; 244 maxY = maxY + height * 0.05; 245 ZoomIn(minX, minY, maxX, maxY); 246 } 239 // enlarge view by 5% on each side 240 //if (minX < maxX && minY < maxY) { 241 // double width = maxX - minX; 242 // minX = minX - width * 0.05; 243 // maxX = maxX + width * 0.05; 244 //} 245 246 //if(minY < maxY) 247 //{ 248 // double height = maxY - minY; 249 // minY = minY - height * 0.05; 250 // maxY = maxY + height * 0.05; 251 //} 252 if (double.IsInfinity(minX) || double.IsNaN(minX) || 253 double.IsInfinity(maxX) || double.IsNaN(maxX) || 254 double.IsInfinity(minY) || double.IsNaN(minY) || 255 double.IsInfinity(maxY) || double.IsNaN(maxY)) 256 return; 257 258 double height = maxY - minY; 259 double width = maxX - minX; 260 if (height < 10) 261 height = 10; 262 if (width < 10) 263 width = 10; 264 265 minY = minY - height * 0.05; 266 maxY = maxY + height * 0.05; 267 minX = minX - width * 0.05; 268 maxX = maxX + width * 0.05; 269 ZoomIn(minX, minY, maxX, maxY); 247 270 } 248 271
Note: See TracChangeset
for help on using the changeset viewer.