Changeset 5006


Ignore:
Timestamp:
12/01/10 10:30:49 (12 years ago)
Author:
mkommend
Message:

Reset zoom in LineChartView on double click (ticket #1306).

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.Designer.cs

    r4651 r5006  
    6363      this.chart.Size = new System.Drawing.Size(358, 225);
    6464      this.chart.TabIndex = 0;
     65      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
    6566      //
    66       // QualityLineChart
     67      // LineChartView
    6768      //
    6869      this.AllowDrop = true;
     
    7071      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    7172      this.Controls.Add(this.chart);
    72       this.Name = "QualityLineChart";
     73      this.Name = "LineChartView";
    7374      this.Size = new System.Drawing.Size(358, 225);
    7475      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs

    r4651 r5006  
    121121      }
    122122    }
     123
     124    private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) {
     125      HitTestResult result = chart.HitTest(e.X, e.Y);
     126      if (result.ChartArea != null && (result.ChartElementType == ChartElementType.PlottingArea ||
     127                                       result.ChartElementType == ChartElementType.Gridlines) ||
     128                                       result.ChartElementType == ChartElementType.StripLines) {
     129        foreach (var axis in result.ChartArea.Axes)
     130          axis.ScaleView.ZoomReset(int.MaxValue);
     131      }
     132    }
    123133    #endregion
    124134
Note: See TracChangeset for help on using the changeset viewer.