Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/14 15:56:14 (11 years ago)
Author:
aesterer
Message:

Added line chart and basic logic for line chart

Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10370 r10377  
    157157  </ItemGroup>
    158158  <ItemGroup>
     159    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
     160      <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project>
     161      <Name>HeuristicLab.Analysis-3.3</Name>
     162    </ProjectReference>
    159163    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    160164      <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/LineChartLogic.cs

    r10303 r10377  
    33using System.Linq;
    44using System.Text;
     5using HeuristicLab.Analysis;
    56
    67namespace HeuristicLab.DataPreprocessing
     
    89  public class LineChartLogic:ILineChartLogic
    910  {
     11    private IPreprocessingData preprocessingData;
     12
     13    public LineChartLogic(IPreprocessingData preprocessingData) {
     14      this.preprocessingData = preprocessingData;
     15 
     16    }
     17
     18    public void FillDataTable(DataTable dataTable) {
     19      IEnumerable<string> variableNames = preprocessingData.VariableNames;
     20
     21      foreach(string variableName in variableNames)
     22      {
     23        IList<double> values = preprocessingData.GetValues<double>(variableName);
     24        DataRow row = new DataRow(variableName, "", values);
     25        dataTable.Rows.Add(row);
     26      }
     27 
     28    }
    1029  }
    1130}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ILineChartLogic.cs

    r10252 r10377  
    33using System.Linq;
    44using System.Text;
     5using HeuristicLab.Analysis;
    56
    67namespace HeuristicLab.DataPreprocessing
     
    89  public interface ILineChartLogic
    910  {
     11    void FillDataTable(DataTable dataTable);
    1012  }
    1113}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataPreprocessingView.cs

    r10372 r10377  
    5050      filterContent = new FilterContent(new FilterLogic());
    5151      tranformationContent = new TransformationContent(new TransformationLogic());
    52       lineChartContent = new LineChartContent(new LineChartLogic());
     52      lineChartContent = new LineChartContent(new LineChartLogic(data));
    5353      histogramContent = new HistogramContent(new HistogramLogic());
    5454
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/LineChartView.Designer.cs

    r10303 r10377  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       components = new System.ComponentModel.Container();
     26      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     27      this.variablesListBox = new System.Windows.Forms.CheckedListBox();
     28      this.SuspendLayout();
     29      //
     30      // viewHost
     31      //
     32      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     33            | System.Windows.Forms.AnchorStyles.Left)
     34            | System.Windows.Forms.AnchorStyles.Right)));
     35      this.viewHost.Caption = "View";
     36      this.viewHost.Content = null;
     37      this.viewHost.Enabled = false;
     38      this.viewHost.Location = new System.Drawing.Point(155, 3);
     39      this.viewHost.Name = "viewHost";
     40      this.viewHost.ReadOnly = false;
     41      this.viewHost.Size = new System.Drawing.Size(922, 576);
     42      this.viewHost.TabIndex = 0;
     43      this.viewHost.ViewsLabelVisible = true;
     44      this.viewHost.ViewType = null;
     45      //
     46      // variablesListBox
     47      //
     48      this.variablesListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     49            | System.Windows.Forms.AnchorStyles.Left)));
     50      this.variablesListBox.FormattingEnabled = true;
     51      this.variablesListBox.Location = new System.Drawing.Point(4, 4);
     52      this.variablesListBox.Name = "variablesListBox";
     53      this.variablesListBox.Size = new System.Drawing.Size(145, 574);
     54      this.variablesListBox.TabIndex = 1;
     55      this.variablesListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.variablesListBox_ItemCheck);
     56      //
     57      // LineChartView
     58      //
     59      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    2760      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     61      this.Controls.Add(this.variablesListBox);
     62      this.Controls.Add(this.viewHost);
     63      this.Name = "LineChartView";
     64      this.Size = new System.Drawing.Size(1080, 582);
     65      this.ResumeLayout(false);
     66
    2867    }
    2968
    3069    #endregion
     70
     71    private MainForm.WindowsForms.ViewHost viewHost;
     72    private System.Windows.Forms.CheckedListBox variablesListBox;
    3173  }
    3274}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/LineChartView.cs

    r10303 r10377  
    33using System.ComponentModel;
    44using System.Drawing;
    5 using System.Data;
    65using System.Linq;
    76using System.Text;
     
    1211using HeuristicLab.Problems.DataAnalysis;
    1312using HeuristicLab.Data.Views;
     13using HeuristicLab.Analysis;
    1414
    1515namespace HeuristicLab.DataPreprocessing.Views {
     
    1818  [Content(typeof(LineChartContent), false)]
    1919  public partial class LineChartView : ItemView {
     20
     21    private DataTable dataTable;
     22
    2023    public LineChartView() {
    2124      InitializeComponent();
     25    }
     26
     27    private void InitDataTable() {
     28      dataTable = new DataTable("LineChart");
     29      ILineChartLogic logic = Content.LineChartLogic;
     30      logic.FillDataTable(dataTable);
    2231    }
    2332
     
    2938    protected override void OnContentChanged() {
    3039      base.OnContentChanged();
     40      if (Content != null) {
     41        InitDataTable();
     42        InitVariablesListBox();
     43        viewHost.Content = dataTable;
     44
     45      }
     46    }
     47
     48    private void InitVariablesListBox() {
     49      ILineChartLogic logic = Content.LineChartLogic;
     50
     51      //foreach (var variableName in logic.GetVariableNames()) {
     52      //  variablesListBox.Items.Add(variableName,true);
     53      //}
     54    }
     55
     56    private void variablesListBox_ItemCheck(object sender, ItemCheckEventArgs e) {
     57      //string item = variablesListBox.Items[e.Index] as string;
     58
    3159    }
    3260  }
Note: See TracChangeset for help on using the changeset viewer.