Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14267


Ignore:
Timestamp:
08/30/16 16:45:14 (8 years ago)
Author:
pfleck
Message:

#2662

  • Show the current y value on the y-axis label.
  • Changed format of the x- and y-value to fixed significant digits ("G") instead of fixed decimal digits ("N").
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs

    r14158 r14267  
    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      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs

    r14158 r14267  
    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.