- Timestamp:
- 10/22/12 18:53:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r8738 r8832 263 263 xTrackBar.Value = 0; 264 264 yTrackBar.Value = 0; 265 SetAutomaticUpdateOfAxis(xAxis, true);266 SetAutomaticUpdateOfAxis(yAxis, true);267 265 } 268 266 … … 284 282 } 285 283 284 285 private class AxisParameters { 286 public double min, max, majorGridInterval, majorTickMarkInterval, labelStyleInterval; 287 } 286 288 private void UpdateDataPointJitter() { 287 289 var xAxis = this.chart.ChartAreas[0].AxisX; 288 290 var yAxis = this.chart.ChartAreas[0].AxisY; 289 SetAutomaticUpdateOfAxis(xAxis, false); 290 SetAutomaticUpdateOfAxis(yAxis, false); 291 292 293 // disable automatic update of axis 294 var disabledParameters = new AxisParameters(); 295 disabledParameters.min = disabledParameters.max = disabledParameters.majorGridInterval = disabledParameters.majorTickMarkInterval = disabledParameters.labelStyleInterval = double.NaN; 296 297 AxisParameters savedXParameters, savedYParameters; 298 savedXParameters = SetAxisParameters(xAxis, disabledParameters); 299 savedYParameters = SetAxisParameters(yAxis, disabledParameters); 291 300 292 301 foreach (DataPoint point in chart.Series[0].Points) { … … 296 305 297 306 if (!xJitterFactor.IsAlmost(0.0)) 298 xValue += 0.1 * GetXJitter(run) * xJitterFactor * ( xAxis.Maximum - xAxis.Minimum);307 xValue += 0.1 * GetXJitter(run) * xJitterFactor * (savedXParameters.max - savedXParameters.min); 299 308 if (!yJitterFactor.IsAlmost(0.0)) 300 yValue += 0.1 * GetYJitter(run) * yJitterFactor * ( yAxis.Maximum - yAxis.Minimum);309 yValue += 0.1 * GetYJitter(run) * yJitterFactor * (savedYParameters.max - savedYParameters.min); 301 310 302 311 point.XValue = xValue; 303 312 point.YValues[0] = yValue; 304 313 } 305 } 306 307 private void SetAutomaticUpdateOfAxis(Axis axis, bool enabled) { 308 if (enabled) { 309 axis.Maximum = double.NaN; 310 axis.Minimum = double.NaN; 311 axis.MajorGrid.Interval = double.NaN; 312 axis.MajorTickMark.Interval = double.NaN; 313 axis.LabelStyle.Interval = double.NaN; 314 } else { 315 axis.Minimum = axis.Minimum; 316 axis.Maximum = axis.Maximum; 317 axis.MajorGrid.Interval = axis.MajorGrid.Interval; 318 axis.MajorTickMark.Interval = axis.MajorTickMark.Interval; 319 axis.LabelStyle.Interval = axis.LabelStyle.Interval; 320 } 321 314 SetAxisParameters(xAxis, savedXParameters); 315 SetAxisParameters(yAxis, savedYParameters); 316 } 317 318 private AxisParameters SetAxisParameters(Axis axis, AxisParameters @new) { 319 var old = new AxisParameters(); 320 old.min = axis.Minimum; 321 old.max = axis.Maximum; 322 old.majorGridInterval = axis.MajorGrid.Interval; 323 old.majorTickMarkInterval = axis.MajorTickMark.Interval; 324 old.labelStyleInterval = axis.LabelStyle.Interval; 325 326 axis.Maximum = @new.max; 327 axis.Minimum = @new.min; 328 axis.MajorGrid.Interval = @new.majorGridInterval; 329 axis.MajorTickMark.Interval = @new.majorTickMarkInterval; 330 axis.LabelStyle.Interval = @new.labelStyleInterval; 331 return old; 322 332 } 323 333
Note: See TracChangeset
for help on using the changeset viewer.