Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/16 15:56:56 (9 years ago)
Author:
pfleck
Message:

#2597:

  • Moved variable name + cursor value to the top.
  • Fixed some warnings (missing async await).
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls
Files:
2 edited

Legend:

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

    r14118 r14131  
    3131      System.Windows.Forms.DataVisualization.Charting.StripLine stripLine2 = new System.Windows.Forms.DataVisualization.Charting.StripLine();
    3232      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
     33      System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
    3334      this.calculationPendingLabel = new System.Windows.Forms.Label();
    3435      this.calculationPendingTimer = new System.Windows.Forms.Timer(this.components);
     
    7475      chartArea1.Name = "ChartArea";
    7576      chartArea1.Position.Auto = false;
    76       chartArea1.Position.Height = 100F;
     77      chartArea1.Position.Height = 90F;
    7778      chartArea1.Position.Width = 100F;
     79      chartArea1.Position.Y = 10F;
    7880      this.chart.ChartAreas.Add(chartArea1);
    7981      this.chart.Dock = System.Windows.Forms.DockStyle.Fill;
     
    8890      this.chart.Size = new System.Drawing.Size(453, 308);
    8991      this.chart.TabIndex = 0;
     92      title1.Alignment = System.Drawing.ContentAlignment.TopCenter;
     93      title1.DockedToChartArea = "ChartArea";
     94      title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     95      title1.IsDockedInsideChartArea = false;
     96      title1.Name = "Title";
     97      title1.Text = "[Title]";
     98      this.chart.Titles.Add(title1);
    9099      this.chart.SelectionRangeChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CursorEventArgs>(this.chart_SelectionRangeChanged);
    91100      this.chart.AnnotationPositionChanged += new System.EventHandler(this.chart_AnnotationPositionChanged);
     
    94103      this.chart.DragEnter += new System.Windows.Forms.DragEventHandler(this.chart_DragEnter);
    95104      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
     105      this.chart.Resize += new System.EventHandler(this.chart_Resize);
    96106      //
    97107      // configurationButton
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs

    r14118 r14131  
    6666      set {
    6767        chart.Annotations[0].Visible = value;
    68         if (!value) chart.ChartAreas[0].AxisX.Title = string.Empty;
     68        if (!value) chart.Titles[0].Text = string.Empty;
    6969      }
    7070    }
     
    281281
    282282      if (ShowCursor)
    283         chart.ChartAreas[0].AxisX.Title = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture);
     283        chart.Titles[0].Text = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture);
    284284
    285285      ResizeAllSeriesData();
     
    323323          throw;
    324324      }
     325    }
     326
     327    public void UpdateTitlePosition() {
     328      var title = chart.Titles[0];
     329      var plotArea = InnerPlotPosition;
     330
     331      title.Visible = plotArea.Width != 0;
     332
     333      title.Position.X = plotArea.X + (plotArea.Width / 2);
    325334    }
    326335
     
    627636
    628637      if (ShowCursor) {
    629         chart.ChartAreas[0].AxisX.Title = FreeVariable + " : " + x.ToString("N3", CultureInfo.CurrentCulture);
     638        chart.Titles[0].Text = FreeVariable + " : " + x.ToString("N3", CultureInfo.CurrentCulture);
    630639        chart.Update();
    631640      }
     
    639648    }
    640649
    641     private void chart_DragDrop(object sender, DragEventArgs e) {
     650    private async void chart_DragDrop(object sender, DragEventArgs e) {
    642651      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    643652      if (data != null) {
    644653        var solution = data as IRegressionSolution;
    645654        if (!solutions.Contains(solution))
    646           AddSolutionAsync(solution);
     655          await AddSolutionAsync(solution);
    647656      }
    648657    }
     
    670679      OnZoomChanged(this, EventArgs.Empty);
    671680    }
     681
     682    private void chart_Resize(object sender, EventArgs e) {
     683      UpdateTitlePosition();
     684    }
    672685    #endregion
    673686  }
    674687}
     688
Note: See TracChangeset for help on using the changeset viewer.