Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3487 for trunk/sources


Ignore:
Timestamp:
04/22/10 15:42:36 (15 years ago)
Author:
mkommend
Message:

added tooltips to RunCollectionBubbleChart (ticket #970)

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

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs

    r3482 r3487  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    27       System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
     26      this.components = new System.ComponentModel.Container();
     27      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     28      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
    2829      this.yJitterLabel = new System.Windows.Forms.Label();
    2930      this.xJitterlabel = new System.Windows.Forms.Label();
     
    4243      this.colorButton = new System.Windows.Forms.Button();
    4344      this.colorDialog = new System.Windows.Forms.ColorDialog();
     45      this.tooltip = new System.Windows.Forms.ToolTip(this.components);
    4446      ((System.ComponentModel.ISupportInitialize)(this.xTrackBar)).BeginInit();
    4547      ((System.ComponentModel.ISupportInitialize)(this.yTrackBar)).BeginInit();
     
    157159                  | System.Windows.Forms.AnchorStyles.Left)
    158160                  | System.Windows.Forms.AnchorStyles.Right)));
    159       chartArea2.Name = "ChartArea1";
    160       this.chart.ChartAreas.Add(chartArea2);
     161      chartArea1.Name = "ChartArea1";
     162      this.chart.ChartAreas.Add(chartArea1);
    161163      this.chart.Location = new System.Drawing.Point(6, 30);
    162164      this.chart.Name = "chart";
    163       series2.ChartArea = "ChartArea1";
    164       series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bubble;
    165       series2.CustomProperties = "BubbleMaxSize=0";
    166       series2.IsVisibleInLegend = false;
    167       series2.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
    168       series2.Name = "Bubbles";
    169       series2.YValuesPerPoint = 2;
    170       this.chart.Series.Add(series2);
     165      series1.ChartArea = "ChartArea1";
     166      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bubble;
     167      series1.CustomProperties = "BubbleMaxSize=0";
     168      series1.IsVisibleInLegend = false;
     169      series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
     170      series1.Name = "Bubbles";
     171      series1.YValuesPerPoint = 2;
     172      this.chart.Series.Add(series1);
    171173      this.chart.Size = new System.Drawing.Size(554, 261);
    172174      this.chart.TabIndex = 16;
     
    279281    private System.Windows.Forms.Button colorButton;
    280282    private System.Windows.Forms.ColorDialog colorDialog;
     283    private System.Windows.Forms.ToolTip tooltip;
    281284  }
    282285}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs

    r3482 r3487  
    283283
    284284    private void chart_MouseMove(object sender, MouseEventArgs e) {
     285      HitTestResult h = this.chart.HitTest(e.X, e.Y);
    285286      if (!Locked) {
    286         HitTestResult h = this.chart.HitTest(e.X, e.Y);
    287287        if (this.draggedRun != null && h.ChartElementType != ChartElementType.DataPoint) {
    288288          DataObject data = new DataObject();
     
    301301        }
    302302      }
     303      string newTooltipText;
     304      string oldTooltipText;
     305      if (h.ChartElementType == ChartElementType.DataPoint) {
     306        IRun run = (IRun)((DataPoint)h.Object).Tag;
     307        newTooltipText = run.Name + System.Environment.NewLine;
     308        newTooltipText += xAxisComboBox.SelectedItem + " : " + Content.GetValue(run, xAxisComboBox.SelectedIndex).ToString() + Environment.NewLine;
     309        newTooltipText += yAxisComboBox.SelectedItem + " : " + Content.GetValue(run, yAxisComboBox.SelectedIndex).ToString() + Environment.NewLine; ;
     310      } else
     311        newTooltipText = string.Empty;
     312      oldTooltipText = this.tooltip.GetToolTip(chart);
     313      if (newTooltipText != oldTooltipText)
     314        this.tooltip.SetToolTip(chart, newTooltipText);
    303315    }
    304316    #endregion
Note: See TracChangeset for help on using the changeset viewer.