Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4648


Ignore:
Timestamp:
10/28/10 00:38:56 (13 years ago)
Author:
swagner
Message:

Worked on flexible coloring of data rows and on changing the initial index from 1 to 0 (#925)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.Designer.cs

    r4637 r4648  
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    49       System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
    50       System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
    51       System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
     48      System.Windows.Forms.DataVisualization.Charting.ChartArea defaultChartArea = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     49      System.Windows.Forms.DataVisualization.Charting.Legend defaultLegend = new System.Windows.Forms.DataVisualization.Charting.Legend();
     50      System.Windows.Forms.DataVisualization.Charting.Series defaultSeries = new System.Windows.Forms.DataVisualization.Charting.Series();
     51      System.Windows.Forms.DataVisualization.Charting.Title defaultTitle = new System.Windows.Forms.DataVisualization.Charting.Title();
    5252      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    5353      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
     
    7676      this.chart.BorderlineColor = System.Drawing.Color.Black;
    7777      this.chart.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
    78       chartArea1.CursorX.IsUserEnabled = true;
    79       chartArea1.CursorX.IsUserSelectionEnabled = true;
    80       chartArea1.CursorY.IsUserEnabled = true;
    81       chartArea1.CursorY.IsUserSelectionEnabled = true;
    82       chartArea1.Name = "ChartArea1";
    83       this.chart.ChartAreas.Add(chartArea1);
     78      defaultChartArea.CursorX.IsUserEnabled = true;
     79      defaultChartArea.CursorX.IsUserSelectionEnabled = true;
     80      defaultChartArea.CursorY.IsUserEnabled = true;
     81      defaultChartArea.CursorY.IsUserSelectionEnabled = true;
     82      defaultChartArea.Name = "Default";
     83      this.chart.ChartAreas.Add(defaultChartArea);
    8484      this.chart.ContextMenuStrip = this.contextMenuStrip;
    85       legend1.Alignment = System.Drawing.StringAlignment.Center;
    86       legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
    87       legend1.Name = "Legend1";
    88       this.chart.Legends.Add(legend1);
     85      defaultLegend.Alignment = System.Drawing.StringAlignment.Center;
     86      defaultLegend.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
     87      defaultLegend.Name = "Default";
     88      this.chart.Legends.Add(defaultLegend);
    8989      this.chart.Location = new System.Drawing.Point(0, 52);
    9090      this.chart.Name = "chart";
    91       series1.ChartArea = "ChartArea1";
    92       series1.Legend = "Legend1";
    93       series1.Name = "Series1";
    94       this.chart.Series.Add(series1);
     91      defaultSeries.ChartArea = "Default";
     92      defaultSeries.Legend = "Default";
     93      defaultSeries.Name = "Default";
     94      this.chart.Series.Add(defaultSeries);
    9595      this.chart.Size = new System.Drawing.Size(359, 222);
    9696      this.chart.TabIndex = 4;
    97       this.chart.Text = "chart1";
    98       title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    99       title1.Name = "Default";
    100       title1.Text = "Title";
    101       this.chart.Titles.Add(title1);
     97      this.chart.Text = "chart";
     98      defaultTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     99      defaultTitle.Name = "Default";
     100      defaultTitle.Text = "Title";
     101      this.chart.Titles.Add(defaultTitle);
    102102      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
    103103      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r4644 r4648  
    125125      }
    126126      series.YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary;
     127      if (row.VisualProperties.Color != Color.Empty) series.Color = row.VisualProperties.Color;
    127128      series.ToolTip = row.Name + " X = #INDEX, Y = #VAL";
    128129      FillSeriesWithRowValues(series, row);
     
    256257        }
    257258        chart.Series[row.Name].YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary;
     259        if (row.VisualProperties.Color != Color.Empty) chart.Series[row.Name].Color = row.VisualProperties.Color;
    258260      }
    259261    }
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs

    r4645 r4648  
    164164          visualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Line;
    165165          visualProperties.SecondYAxis = true;
     166          visualProperties.StartIndexZero = true;
    166167          allelesTable.Rows.Add(new DataRow("Unique Alleles of Best Known Solution", null, visualProperties));
    167168          allelesTable.Rows.Add(new DataRow("Fixed Alleles", null, visualProperties));
  • trunk/sources/HeuristicLab.Analysis/3.3/DataRowVisualProperties.cs

    r4644 r4648  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using System.Drawing;
    2526
    2627namespace HeuristicLab.Analysis {
     
    3940    #endregion
    4041
    41     [Storable(DefaultValue = DataRowChartType.Line)]
    4242    private DataRowChartType chartType;
    4343    public DataRowChartType ChartType {
     
    5050      }
    5151    }
    52     [Storable(DefaultValue = false)]
    5352    private bool secondYAxis;
    5453    public bool SecondYAxis {
     
    6160      }
    6261    }
     62    private Color color;
     63    public Color Color {
     64      get { return color; }
     65      set {
     66        if (color != value) {
     67          color = value;
     68          OnPropertyChanged("Color");
     69        }
     70      }
     71    }
     72    private bool startIndexZero;
     73    public bool StartIndexZero {
     74      get { return startIndexZero; }
     75      set {
     76        if (startIndexZero != value) {
     77          startIndexZero = value;
     78          OnPropertyChanged("StartIndexZero");
     79        }
     80      }
     81    }
     82
     83    #region Persistence Properties
     84    [Storable(Name = "ChartType")]
     85    private DataRowChartType StorableChartType {
     86      get { return chartType; }
     87      set { chartType = value; }
     88    }
     89    [Storable(Name = "SecondYAxis")]
     90    private bool StorableSecondYAxis {
     91      get { return secondYAxis; }
     92      set { secondYAxis = value; }
     93    }
     94    [Storable(Name = "Color")]
     95    private Color StorableColor {
     96      get { return color; }
     97      set { color = value; }
     98    }
     99    [Storable(Name = "StartIndexZero")]
     100    private bool StorableStartIndexZero {
     101      get { return startIndexZero; }
     102      set { startIndexZero = value; }
     103    }
     104    #endregion
    63105
    64106    public DataRowVisualProperties() {
    65107      chartType = DataRowChartType.Line;
    66108      secondYAxis = false;
     109      color = Color.Empty;
     110      startIndexZero = false;
    67111    }
    68     public DataRowVisualProperties(DataRowChartType chartType, bool secondYAxis) {
     112    public DataRowVisualProperties(DataRowChartType chartType, bool secondYAxis, Color color, bool startIndexZero) {
    69113      this.chartType = chartType;
    70114      this.secondYAxis = secondYAxis;
     115      this.color = color;
     116      this.startIndexZero = startIndexZero;
    71117    }
    72118    [StorableConstructor]
     
    77123      clone.chartType = chartType;
    78124      clone.secondYAxis = secondYAxis;
     125      clone.color = color;
     126      clone.startIndexZero = startIndexZero;
    79127      return clone;
    80128    }
Note: See TracChangeset for help on using the changeset viewer.