Changeset 2132 for trunk/sources/HeuristicLab.CEDMA.Charting
- Timestamp:
- 07/03/09 18:38:47 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.Charting/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs
r2131 r2132 67 67 records = new List<ResultsEntry>(); 68 68 primitiveToEntryDictionary = new Dictionary<IPrimitive, ResultsEntry>(); 69 // 69 //entryToPrimitivesDictionary = new Dictionary<ResultsEntry, IList<IPrimitive>>(); 70 70 this.results = results; 71 71 … … 133 133 Group.Clear(); 134 134 primitiveToEntryDictionary.Clear(); 135 // 135 //entryToPrimitivesDictionary.Clear(); 136 136 points = new Group(this); 137 137 Group.Add(new Axis(this, 0, 0, AxisType.Both)); … … 140 140 List<double> xs = new List<double>(); 141 141 List<double> ys = new List<double>(); 142 List<object> actualXValues = new List<object>(); 143 List<object> actualYValues = new List<object>(); 142 144 int size; 143 145 if (results.OrdinalVariables.Contains(xDimension)) { 144 146 xs.Add(Convert.ToDouble(r.Get(xDimension)) + (double)r.Get(X_JITTER) * xJitterFactor); 147 actualXValues.Add(r.Get(xDimension)); 145 148 } else if (results.CategoricalVariables.Contains(xDimension)) { 146 149 xs.Add(results.IndexOfCategoricalValue(xDimension, r.Get(xDimension)) + (double)r.Get(X_JITTER) * xJitterFactor); 150 actualXValues.Add(r.Get(xDimension)); 147 151 } else if (results.MultiDimensionalCategoricalVariables.Contains(xDimension)) { 148 152 var path = xDimension.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); … … 150 154 foreach (ResultsEntry subEntry in subEntries) { 151 155 xs.Add(results.IndexOfCategoricalValue(xDimension, subEntry.Get(path.ElementAt(1))) + (double)r.Get(X_JITTER) * xJitterFactor); 156 actualXValues.Add(subEntry.Get(path.ElementAt(1))); 152 157 } 153 158 } else if (results.MultiDimensionalOrdinalVariables.Contains(xDimension)) { … … 156 161 foreach (ResultsEntry subEntry in subEntries) { 157 162 xs.Add(Convert.ToDouble(subEntry.Get(path.ElementAt(1))) + (double)r.Get(X_JITTER) * xJitterFactor); 163 actualXValues.Add(subEntry.Get(path.ElementAt(1))); 158 164 } 159 165 } else { 160 166 xs.Add(double.NaN); 167 actualXValues.Add("NaN"); 161 168 } 162 169 if (results.OrdinalVariables.Contains(yDimension)) { 163 170 ys.Add(Convert.ToDouble(r.Get(yDimension)) + (double)r.Get(Y_JITTER) * yJitterFactor); 171 actualYValues.Add(r.Get(yDimension)); 164 172 } else if (results.CategoricalVariables.Contains(yDimension)) { 165 173 ys.Add(results.IndexOfCategoricalValue(yDimension, r.Get(yDimension)) + (double)r.Get(Y_JITTER) * yJitterFactor); 174 actualYValues.Add(r.Get(yDimension)); 166 175 } else if (results.MultiDimensionalCategoricalVariables.Contains(yDimension)) { 167 176 var path = yDimension.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); … … 169 178 foreach (ResultsEntry subEntry in subEntries) { 170 179 ys.Add(results.IndexOfCategoricalValue(yDimension, subEntry.Get(path.ElementAt(1))) + (double)r.Get(Y_JITTER) * yJitterFactor); 180 actualYValues.Add(subEntry.Get(path.ElementAt(1))); 171 181 } 172 182 } else if (results.MultiDimensionalOrdinalVariables.Contains(yDimension)) { … … 175 185 foreach (ResultsEntry subEntry in subEntries) { 176 186 ys.Add(Convert.ToDouble(subEntry.Get(path.ElementAt(1))) + (double)r.Get(Y_JITTER) * yJitterFactor); 187 actualYValues.Add(subEntry.Get(path.ElementAt(1))); 177 188 } 178 189 } else { 179 190 ys.Add(double.NaN); 191 actualYValues.Add("NaN"); 180 192 } 181 193 size = CalculateSize(Convert.ToDouble(r.Get(sizeDimension)), minSize, maxSize); … … 183 195 int n = Math.Max(xs.Count(), ys.Count()); 184 196 for (int i = 0; i < n; i++) { 185 double x = xs[Math.Min(i, xs.Count()-1)]; 186 double y = ys[Math.Min(i, ys.Count()-1)]; 197 double x = xs[Math.Min(i, xs.Count() - 1)]; 198 double y = ys[Math.Min(i, ys.Count() - 1)]; 199 string actualXValue = actualXValues[Math.Min(i, actualXValues.Count() - 1)].ToString(); 200 string actualYValue = actualYValues[Math.Min(i, actualYValues.Count() - 1)].ToString(); 187 201 if (double.IsInfinity(x) || x == double.MaxValue || x == double.MinValue) x = double.NaN; 188 202 if (double.IsInfinity(y) || y == double.MaxValue || y == double.MinValue) y = double.NaN; … … 193 207 Brush brush = pen.Brush; 194 208 FixedSizeCircle c = new FixedSizeCircle(this, x, y, size, pen, brush); 195 c.ToolTipText = r.GetToolTipText(); 209 c.ToolTipText = xDimension + " = " + actualXValue + Environment.NewLine + 210 yDimension + " = " + actualYValue + Environment.NewLine + 211 r.GetToolTipText(); 196 212 points.Add(c); 197 213 if (!r.Selected) c.IntoBackground(); -
trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.cs
r1529 r2132 36 36 private Point mousePosition; 37 37 private Point buttonDownPoint; 38 private IPrimitive primitiveUnderCursor; 38 39 39 40 private BubbleChart myChart; … … 107 108 } 108 109 private void pictureBox_MouseMove(object sender, MouseEventArgs e) { 109 toolTip.SetToolTip(pictureBox, Chart.GetToolTipText(e.Location)); 110 if (Chart.GetPrimitive(e.Location) != primitiveUnderCursor) { 111 primitiveUnderCursor = Chart.GetPrimitive(e.Location); 112 toolTip.SetToolTip(pictureBox, Chart.GetToolTipText(e.Location)); 113 } 110 114 if(e.Button != MouseButtons.None) { 111 115 if((Chart.Mode == ChartMode.Zoom || Chart.Mode == ChartMode.Select) && (e.Button == MouseButtons.Left)) {
Note: See TracChangeset
for help on using the changeset viewer.