Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9068


Ignore:
Timestamp:
12/17/12 16:54:27 (11 years ago)
Author:
sforsten
Message:

#1993:

  • added code again which was deleted in r8835 and r8832 (SetAutomaticUpdateOfAxis())
  • added call chart.Refresh() in UpdateDataPoints to make sure that everything is recalculated, also the axis. So the fields of the axis don't stay double.NaN and HitTest doesn't throw an exception.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs

    r8962 r9068  
    261261      xTrackBar.Value = 0;
    262262      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();
    263270    }
    264271
     
    284291      var yAxis = this.chart.ChartAreas[0].AxisY;
    285292
     293      SetAutomaticUpdateOfAxis(xAxis, false);
     294      SetAutomaticUpdateOfAxis(yAxis, false);
     295
    286296      double xAxisRange = xAxis.Maximum - xAxis.Minimum;
    287297      double yAxisRange = yAxis.Maximum - yAxis.Minimum;
     
    301311      }
    302312
     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      }
    303331    }
    304332
Note: See TracChangeset for help on using the changeset viewer.