Changeset 9068
- Timestamp:
- 12/17/12 16:54:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r8962 r9068 261 261 xTrackBar.Value = 0; 262 262 yTrackBar.Value = 0; 263 264 //needed to set axis back to automatic and refresh them, otherwise their values may remain NaN 265 var xAxis = chart.ChartAreas[0].AxisX; 266 var yAxis = chart.ChartAreas[0].AxisY; 267 SetAutomaticUpdateOfAxis(xAxis, true); 268 SetAutomaticUpdateOfAxis(yAxis, true); 269 chart.Refresh(); 263 270 } 264 271 … … 284 291 var yAxis = this.chart.ChartAreas[0].AxisY; 285 292 293 SetAutomaticUpdateOfAxis(xAxis, false); 294 SetAutomaticUpdateOfAxis(yAxis, false); 295 286 296 double xAxisRange = xAxis.Maximum - xAxis.Minimum; 287 297 double yAxisRange = yAxis.Maximum - yAxis.Minimum; … … 301 311 } 302 312 313 } 314 315 // sets an axis to automatic or restrains it to its current values 316 // this is used that none of the set values is changed when jitter is applied, so that the chart stays the same 317 private void SetAutomaticUpdateOfAxis(Axis axis, bool enabled) { 318 if (enabled) { 319 axis.Maximum = double.NaN; 320 axis.Minimum = double.NaN; 321 axis.MajorGrid.Interval = double.NaN; 322 axis.MajorTickMark.Interval = double.NaN; 323 axis.LabelStyle.Interval = double.NaN; 324 } else { 325 axis.Minimum = axis.Minimum; 326 axis.Maximum = axis.Maximum; 327 axis.MajorGrid.Interval = axis.MajorGrid.Interval; 328 axis.MajorTickMark.Interval = axis.MajorTickMark.Interval; 329 axis.LabelStyle.Interval = axis.LabelStyle.Interval; 330 } 303 331 } 304 332
Note: See TracChangeset
for help on using the changeset viewer.