Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4635


Ignore:
Timestamp:
10/21/10 11:37:51 (14 years ago)
Author:
mkommend
Message:

Minor changes to EnhancedChart and the adapation of the RunCollectionBubbleChart (ticket #1237).

Location:
trunk/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r4104 r4635  
    289289      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    290290    </ProjectReference>
     291    <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
     292      <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project>
     293      <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
     294    </ProjectReference>
    291295  </ItemGroup>
    292296  <ItemGroup>
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLabOptimizationViewsPlugin.cs.frame

    r4633 r4635  
    3838  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
    3939  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     40  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions","3.3")]
    4041  public class HeuristicLabOptimizationViewsPlugin : PluginBase {
    4142  }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs

    r4094 r4635  
    5858      this.sizeComboBox = new System.Windows.Forms.ComboBox();
    5959      this.sizeLabel = new System.Windows.Forms.Label();
    60       this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
     60      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    6161      this.zoomButton = new System.Windows.Forms.RadioButton();
    6262      this.selectButton = new System.Windows.Forms.RadioButton();
     
    309309    private System.Windows.Forms.ComboBox sizeComboBox;
    310310    private System.Windows.Forms.Label sizeLabel;
    311     private System.Windows.Forms.DataVisualization.Charting.Chart chart;
     311    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
    312312    private System.Windows.Forms.RadioButton zoomButton;
    313313    private System.Windows.Forms.RadioButton selectButton;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs

    r4212 r4635  
    5454      InitializeComponent();
    5555
    56       this.categoricalMapping = new Dictionary<int, Dictionary<object, double>>();
    57       this.xJitter = new Dictionary<IRun, double>();
    58       this.yJitter = new Dictionary<IRun, double>();
    59       this.random = new Random();
    60       this.colorDialog.Color = Color.Black;
    61       this.colorButton.Image = this.GenerateImage(16, 16, this.colorDialog.Color);
    62       this.isSelecting = false;
    63 
    64       this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
    65       this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
    66       this.chart.ChartAreas[0].CursorX.Interval = 1;
    67       this.chart.ChartAreas[0].CursorY.Interval = 1;
    68       this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !this.isSelecting;
    69       this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !this.isSelecting;
     56      categoricalMapping = new Dictionary<int, Dictionary<object, double>>();
     57      xJitter = new Dictionary<IRun, double>();
     58      yJitter = new Dictionary<IRun, double>();
     59      random = new Random();
     60      colorDialog.Color = Color.Black;
     61      colorButton.Image = this.GenerateImage(16, 16, this.colorDialog.Color);
     62      isSelecting = false;
     63
     64      chart.CustomizeChartAreas();
     65      chart.EnableMiddleClickPanning = false;
     66      chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
     67      chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
     68      chart.ChartAreas[0].CursorX.Interval = 1;
     69      chart.ChartAreas[0].CursorY.Interval = 1;
     70      chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !this.isSelecting;
     71      chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !this.isSelecting;
    7072    }
    7173
     
    506508      SetCustomAxisLabels(xAxis, xAxisComboBox.SelectedIndex - axisDimensionCount);
    507509      SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount);
     510      if (xAxisComboBox.SelectedItem != null)
     511        xAxis.Title = xAxisComboBox.SelectedItem.ToString();
     512      if (yAxisComboBox.SelectedItem != null)
     513        yAxis.Title = yAxisComboBox.SelectedItem.ToString();
    508514    }
    509515
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.cs

    r4630 r4635  
    3131      EnableDoubleClickResetsZoom = true;
    3232      EnableMiddleClickPanning = true;
     33      CustomizeChartAreas();
    3334    }
    3435
    3536    [DefaultValue(true)]
    3637    public bool EnableDoubleClickResetsZoom { get; set; }
    37 
    3838    [DefaultValue(true)]
    3939    public bool EnableMiddleClickPanning { get; set; }
    4040
    41     public void InitializeChartAreas() {
    42       ChartAreas.Clear();
    43       ChartAreas.Add(CreateDefaultChartArea("ChartArea1"));
    44     }
     41    public void CustomizeChartAreas() {
     42      foreach (ChartArea chartArea in ChartAreas) {
     43        foreach (Axis axis in chartArea.Axes) {
     44          axis.MajorGrid.LineColor = SystemColors.GradientInactiveCaption;
     45          axis.MajorTickMark.TickMarkStyle = TickMarkStyle.AcrossAxis;
     46          axis.ScrollBar.BackColor = Color.Transparent;
     47          axis.ScrollBar.LineColor = Color.Transparent;
     48          axis.ScrollBar.ButtonColor = SystemColors.GradientInactiveCaption;
     49          axis.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll;
     50          axis.ScrollBar.Size = 12;
     51          axis.TitleFont = new Font(axis.TitleFont.FontFamily, 12);
     52        }
    4553
    46     public static ChartArea CreateDefaultChartArea(string name) {
    47       ChartArea chartArea = new ChartArea(name);
    48       chartArea.AxisX.MajorGrid.LineColor = SystemColors.GradientInactiveCaption;
    49       chartArea.AxisY.MajorGrid.LineColor = SystemColors.GradientInactiveCaption;
    50       chartArea.AxisX.MajorTickMark.TickMarkStyle = TickMarkStyle.AcrossAxis;
    51       chartArea.AxisY.MajorTickMark.TickMarkStyle = TickMarkStyle.AcrossAxis;
    52       chartArea.AxisX.ScrollBar.BackColor = Color.Transparent;
    53       chartArea.AxisY.ScrollBar.BackColor = Color.Transparent;
    54       chartArea.AxisX.ScrollBar.LineColor = Color.Transparent;
    55       chartArea.AxisY.ScrollBar.LineColor = Color.Transparent;
    56       chartArea.AxisX.ScrollBar.ButtonColor = SystemColors.GradientInactiveCaption;
    57       chartArea.AxisY.ScrollBar.ButtonColor = SystemColors.GradientInactiveCaption;
    58       chartArea.AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll;
    59       chartArea.AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll;
    60       chartArea.AxisX.ScrollBar.Size = 12;
    61       chartArea.AxisY.ScrollBar.Size = 12;
    62       chartArea.CursorX.Interval = 0;
    63       chartArea.CursorY.Interval = 0;
    64       chartArea.CursorX.IsUserSelectionEnabled = true;
    65       chartArea.CursorY.IsUserSelectionEnabled = true;
    66       chartArea.CursorX.SelectionColor = SystemColors.GradientActiveCaption;
    67       chartArea.CursorY.SelectionColor = SystemColors.GradientActiveCaption;
    68       return chartArea;
     54        chartArea.CursorX.Interval = 0;
     55        chartArea.CursorY.Interval = 0;
     56        chartArea.CursorX.IsUserSelectionEnabled = true;
     57        chartArea.CursorY.IsUserSelectionEnabled = true;
     58        chartArea.CursorX.SelectionColor = SystemColors.GradientActiveCaption;
     59        chartArea.CursorY.SelectionColor = SystemColors.GradientActiveCaption;
     60      }
    6961    }
    7062
     
    8375
    8476    #region panning
    85 
    8677    private class PanningSupport {
    8778      public ChartArea ChartArea { get; private set; }
     
    10798        return ChartStartPosition.X - (pixelX - PixelStartPosition.X) * Pixel2ChartScale.Width;
    10899      }
    109 
    110100      public double ChartY(double pixelY) {
    111101        return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) * Pixel2ChartScale.Height;
     
    137127      base.OnMouseMove(e);
    138128    }
    139 
    140129    #endregion
    141130
Note: See TracChangeset for help on using the changeset viewer.