Changeset 14570


Ignore:
Timestamp:
01/14/17 19:19:33 (3 years ago)
Author:
gkronber
Message:

#2662: merged r14267 and r14307 from trunk to stable

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs

    r14166 r14570  
    283283
    284284      if (ShowCursor)
    285         chart.Titles[0].Text = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture);
     285        chart.Titles[0].Text = FreeVariable + " : " + defaultValue.ToString("G5", CultureInfo.CurrentCulture);
    286286
    287287      ResizeAllSeriesData();
     
    640640
    641641      if (ShowCursor) {
    642         chart.Titles[0].Text = FreeVariable + " : " + x.ToString("N3", CultureInfo.CurrentCulture);
     642        chart.Titles[0].Text = FreeVariable + " : " + x.ToString("G5", CultureInfo.CurrentCulture);
    643643        chart.Update();
    644644      }
  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs

    r14166 r14570  
    2323using System.Collections.Generic;
    2424using System.Drawing;
     25using System.Globalization;
    2526using System.Linq;
    2627using System.Threading.Tasks;
     
    3738    private readonly Dictionary<string, DensityChart> densityCharts;
    3839    private readonly Dictionary<string, Panel> groupingPanels;
     40    private ModifiableDataset sharedFixedVariables;
    3941
    4042    private const int Points = 200;
     
    113115      var allowedInputVariables = Content.ProblemData.AllowedInputVariables;
    114116      var variableValues = allowedInputVariables.Select(x => new List<double> { problemData.Dataset.GetDoubleValues(x, problemData.TrainingIndices).Median() });
    115       var sharedFixedVariables = new ModifiableDataset(allowedInputVariables, variableValues);
     117      if (sharedFixedVariables != null)
     118        sharedFixedVariables.ItemChanged -= SharedFixedVariables_ItemChanged;
     119      sharedFixedVariables = new ModifiableDataset(allowedInputVariables, variableValues);
     120      // ItemChanged eventhandler is registered later, after creating the gradient charts
    116121
    117122      // create controls
     
    170175      variableListView.ItemChecked += variableListView_ItemChecked;
    171176
     177      sharedFixedVariables.ItemChanged += SharedFixedVariables_ItemChanged;
     178
    172179      RecalculateAndRelayoutCharts();
     180    }
     181
     182    private void SharedFixedVariables_ItemChanged(object sender, EventArgs<int, int> e) {
     183      double yValue = Content.Model.GetEstimatedValues(sharedFixedVariables, new[] { 0 }).Single();
     184      string title = Content.ProblemData.TargetVariable + ": " + yValue.ToString("G5", CultureInfo.CurrentCulture);
     185      foreach (var chart in gradientCharts.Values) {
     186        if (!string.IsNullOrEmpty(chart.YAxisTitle)) { // only show title for first column in grid
     187          chart.YAxisTitle = title;
     188        }
     189      }
    173190    }
    174191
     
    257274      tl.Controls.Clear();
    258275      int row = 0, column = 0;
     276      double yValue = Content.Model.GetEstimatedValues(sharedFixedVariables, new[] { 0 }).Single();
     277      string title = Content.ProblemData.TargetVariable + ": " + yValue.ToString("G5", CultureInfo.CurrentCulture);
     278
    259279      foreach (var v in VisibleVariables) {
    260280        var chartsPanel = groupingPanels[v];
     
    262282
    263283        var chart = gradientCharts[v];
    264         chart.YAxisTitle = column == 0 ? Content.ProblemData.TargetVariable : string.Empty;
     284        chart.YAxisTitle = column == 0 ? title : string.Empty;
    265285        column++;
    266286
Note: See TracChangeset for help on using the changeset viewer.