Changeset 14131
- Timestamp:
- 07/20/16 15:56:56 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.Designer.cs
r14118 r14131 31 31 System.Windows.Forms.DataVisualization.Charting.StripLine stripLine2 = new System.Windows.Forms.DataVisualization.Charting.StripLine(); 32 32 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(); 33 34 this.calculationPendingLabel = new System.Windows.Forms.Label(); 34 35 this.calculationPendingTimer = new System.Windows.Forms.Timer(this.components); … … 74 75 chartArea1.Name = "ChartArea"; 75 76 chartArea1.Position.Auto = false; 76 chartArea1.Position.Height = 100F;77 chartArea1.Position.Height = 90F; 77 78 chartArea1.Position.Width = 100F; 79 chartArea1.Position.Y = 10F; 78 80 this.chart.ChartAreas.Add(chartArea1); 79 81 this.chart.Dock = System.Windows.Forms.DockStyle.Fill; … … 88 90 this.chart.Size = new System.Drawing.Size(453, 308); 89 91 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); 90 99 this.chart.SelectionRangeChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CursorEventArgs>(this.chart_SelectionRangeChanged); 91 100 this.chart.AnnotationPositionChanged += new System.EventHandler(this.chart_AnnotationPositionChanged); … … 94 103 this.chart.DragEnter += new System.Windows.Forms.DragEventHandler(this.chart_DragEnter); 95 104 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 105 this.chart.Resize += new System.EventHandler(this.chart_Resize); 96 106 // 97 107 // configurationButton -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs
r14118 r14131 66 66 set { 67 67 chart.Annotations[0].Visible = value; 68 if (!value) chart. ChartAreas[0].AxisX.Title= string.Empty;68 if (!value) chart.Titles[0].Text = string.Empty; 69 69 } 70 70 } … … 281 281 282 282 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); 284 284 285 285 ResizeAllSeriesData(); … … 323 323 throw; 324 324 } 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); 325 334 } 326 335 … … 627 636 628 637 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); 630 639 chart.Update(); 631 640 } … … 639 648 } 640 649 641 private void chart_DragDrop(object sender, DragEventArgs e) {650 private async void chart_DragDrop(object sender, DragEventArgs e) { 642 651 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 643 652 if (data != null) { 644 653 var solution = data as IRegressionSolution; 645 654 if (!solutions.Contains(solution)) 646 AddSolutionAsync(solution);655 await AddSolutionAsync(solution); 647 656 } 648 657 } … … 670 679 OnZoomChanged(this, EventArgs.Empty); 671 680 } 681 682 private void chart_Resize(object sender, EventArgs e) { 683 UpdateTitlePosition(); 684 } 672 685 #endregion 673 686 } 674 687 } 688 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionGradientView.cs
r14095 r14131 162 162 } 163 163 164 private void trackbar_CheckedChanged(object sender, EventArgs e) {164 private async void trackbar_CheckedChanged(object sender, EventArgs e) { 165 165 var trackBar = sender as DensityTrackbar; 166 166 if (trackBar == null || !trackBar.Checked) return; … … 169 169 tb.Checked = false; 170 170 gradientChart.FreeVariable = variableNames[trackbars.IndexOf(trackBar)]; 171 gradientChart.RecalculateAsync();172 } 173 174 private void trackbar_LimitsChanged(object sender, EventArgs e) {171 await gradientChart.RecalculateAsync(); 172 } 173 174 private async void trackbar_LimitsChanged(object sender, EventArgs e) { 175 175 var trackBar = sender as DensityTrackbar; 176 176 if (trackBar == null || !trackBar.Checked) return; 177 177 gradientChart.FixedXAxisMin = trackBar.Limits.Lower; 178 178 gradientChart.FixedXAxisMax = trackBar.Limits.Upper; 179 gradientChart.RecalculateAsync();180 } 181 182 private void trackbar_ValueChanged(object sender, EventArgs e) {179 await gradientChart.RecalculateAsync(); 180 } 181 182 private async void trackbar_ValueChanged(object sender, EventArgs e) { 183 183 var trackBar = sender as DensityTrackbar; 184 184 if (trackBar == null) return; 185 185 sharedFixedVariables.SetVariableValue((double)trackBar.Value, variableNames[trackbars.IndexOf(trackBar)], 0); 186 gradientChart.RecalculateAsync();186 await gradientChart.RecalculateAsync(); 187 187 } 188 188 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs
r14095 r14131 127 127 Margin = Padding.Empty, 128 128 Height = 12, 129 Visible = false 129 Visible = false, 130 Top = (int)(gradientChart.Height * 0.1), 130 131 }; 131 132 densityCharts.Add(variableName, densityChart); … … 137 138 if (density.Visible) 138 139 UpdateDensityChart(density, gradient.FreeVariable); 140 }; 141 gradientChart.SizeChanged += (o, e) => { 142 var gradient = (GradientChart)o; 143 var density = densityCharts[gradient.FreeVariable]; 144 density.Top = (int)(gradient.Height * 0.1); 139 145 }; 140 146 … … 372 378 densityChart.Visible = true; 373 379 } 380 381 gradientChart.UpdateTitlePosition(); 374 382 } 375 383
Note: See TracChangeset
for help on using the changeset viewer.