Index: /trunk/sources/HeuristicLab.Visualization.Test/HeuristicLab.Visualization.Test.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Visualization.Test/HeuristicLab.Visualization.Test.csproj	(revision 860)
+++ /trunk/sources/HeuristicLab.Visualization.Test/HeuristicLab.Visualization.Test.csproj	(revision 861)
@@ -52,4 +52,8 @@
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>NUnit-2.4.8-bin\nunit.framework.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core">
@@ -70,4 +74,11 @@
     <Compile Include="HeuristicLabVisualizationTestApplication.cs" />
     <Compile Include="HeuristicLabVisualizationTestPlugin.cs" />
+    <Compile Include="LineChartTestForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="LineChartTestForm.Designer.cs">
+      <DependentUpon>LineChartTestForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="LineChartTests.cs" />
     <Compile Include="MainForm.cs">
       <SubType>Form</SubType>
@@ -83,4 +94,8 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Core\HeuristicLab.Core.csproj">
+      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
+      <Name>HeuristicLab.Core</Name>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
@@ -93,4 +108,7 @@
   </ItemGroup>
   <ItemGroup>
+    <EmbeddedResource Include="LineChartTestForm.resx">
+      <DependentUpon>LineChartTestForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
Index: /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.Designer.cs	(revision 861)
+++ /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.Designer.cs	(revision 861)
@@ -0,0 +1,58 @@
+﻿namespace HeuristicLab.Visualization.Test {
+  partial class LineChartTestForm {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.lineChartGroupBox = new System.Windows.Forms.GroupBox();
+      this.SuspendLayout();
+      // 
+      // lineChartGroupBox
+      // 
+      this.lineChartGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.lineChartGroupBox.Location = new System.Drawing.Point(12, 12);
+      this.lineChartGroupBox.Name = "lineChartGroupBox";
+      this.lineChartGroupBox.Size = new System.Drawing.Size(607, 318);
+      this.lineChartGroupBox.TabIndex = 0;
+      this.lineChartGroupBox.TabStop = false;
+      this.lineChartGroupBox.Text = "Line Chart";
+      // 
+      // LineChartTestForm
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(631, 395);
+      this.Controls.Add(this.lineChartGroupBox);
+      this.Name = "LineChartTestForm";
+      this.Text = "LineChartTestForm";
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox lineChartGroupBox;
+
+  }
+}
Index: /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.cs	(revision 861)
+++ /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.cs	(revision 861)
@@ -0,0 +1,25 @@
+﻿using System.Windows.Forms;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Visualization.Test {
+  public partial class LineChartTestForm : Form {
+    private ChartDataRowsModel model;
+
+    public LineChartTestForm() {
+      InitializeComponent();
+
+      model = new ChartDataRowsModel();
+
+      IView view = model.CreateView();
+
+      Control viewControl = (Control)view;
+      viewControl.Dock = DockStyle.Fill;
+
+      lineChartGroupBox.Controls.Add(viewControl);
+    }
+
+    public ChartDataRowsModel Model {
+      get { return model; }
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.resx
===================================================================
--- /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.resx	(revision 861)
+++ /trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.resx	(revision 861)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: /trunk/sources/HeuristicLab.Visualization.Test/LineChartTests.cs
===================================================================
--- /trunk/sources/HeuristicLab.Visualization.Test/LineChartTests.cs	(revision 861)
+++ /trunk/sources/HeuristicLab.Visualization.Test/LineChartTests.cs	(revision 861)
@@ -0,0 +1,23 @@
+using NUnit.Framework;
+
+namespace HeuristicLab.Visualization.Test {
+  [TestFixture]
+  public class LineChartTests {
+    [Test]
+    public void TestLineChart() {
+      LineChartTestForm f = new LineChartTestForm();
+
+      IDataRow row = new DataRow();
+      f.Model.AddDataRow(row);
+
+      row.AddValue(10);
+      row.AddValue(5);
+      row.AddValue(7);
+      row.AddValue(3);
+      row.AddValue(10);
+      row.AddValue(2);
+
+      f.ShowDialog();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Visualization/LineChart.cs
===================================================================
--- /trunk/sources/HeuristicLab.Visualization/LineChart.cs	(revision 860)
+++ /trunk/sources/HeuristicLab.Visualization/LineChart.cs	(revision 861)
@@ -1,18 +1,14 @@
 ﻿using System;
-using System.Drawing;
+using System.Collections.Generic;
 using HeuristicLab.Core;
 
-namespace HeuristicLab.Visualization
-{
-  public partial class LineChart : ViewBase
-  {
+namespace HeuristicLab.Visualization {
+  public partial class LineChart : ViewBase {
     private readonly IChartDataRowsModel model;
-    private Color[] lineColors;
 
     /// <summary>
     /// This constructor shouldn't be called. Only required for the designer.
     /// </summary>
-    public LineChart()
-    {
+    public LineChart() {
       InitializeComponent();
     }
@@ -22,144 +18,93 @@
     /// </summary>
     /// <param name="model">Referenz to the model, for data</param>
-    public LineChart(IChartDataRowsModel model) : this()
-    {
+    public LineChart(IChartDataRowsModel model) : this() {
       if (model == null)
-      {
         throw new NullReferenceException("Model cannot be null.");
-      }
 
       this.model = model;
+      this.Item = (IItem)model;
 
-      //TODO: read line colors instead of static ones
-      lineColors = new Color[3];
-      lineColors[0] = Color.Red;
-      lineColors[1] = Color.Green;
-      lineColors[2] = Color.Blue;
-      
       //TODO: correct Rectangle to fit
-      RectangleD clientRectangle = new RectangleD(ClientRectangle.Left, ClientRectangle.Top, ClientRectangle.Right,
-                                                  ClientRectangle.Bottom);
+      RectangleD clientRectangle = new RectangleD(-1, -1, 11, 11);
       canvasUI1.MainCanvas.WorldShape = new WorldShape(clientRectangle, clientRectangle);
-      Reset();
-    }
-
-    /// <summary>
-    /// Resets the line chart by deleting all shapes and reloading all data from the model.
-    /// </summary>
-    private void Reset()
-    {
-      // TODO an neues model interface anpassen   
-      throw new NotImplementedException();
-      
-//      BeginUpdate();
-//
-//      // TODO clear existing shapes
-//
-//      WorldShape mainWorld = canvasUI1.MainCanvas.WorldShape;
-//
-//      double spacing = mainWorld.BoundingBox.Width/model.Columns.Count;
-//      double oldX = 0;
-//      double currentX = spacing;
-//      ChartDataRowsModelColumn oldColumn = null;
-//      // reload data from the model and create shapes
-//      foreach (ChartDataRowsModelColumn column in model.Columns)
-//      {
-//        if (oldColumn != null)
-//        {
-//          if (column.Values != null)
-//          {
-//            for (int i = 0; i < column.Values.Length; i++)
-//            {
-//              LineShape line = new LineShape(oldX, oldColumn.Values[i], currentX, column.Values[i], 0, lineColors[i]);
-//              mainWorld.AddShape(line);
-//            }
-//            oldX = currentX;
-//            currentX += spacing;
-//          }
-//          oldColumn = column;
-//        }
-//        else
-//        {
-//          oldColumn = column;
-//        }
-//
-//        canvasUI1.Invalidate();
-//
-//        //   AddColumn(column.ColumnId, column.Values);
-//      }
-//
-//      EndUpdate();
-    }
-
-    /// <summary>
-    /// Event handler which gets called when data in the model changes.
-    /// </summary>
-    /// <param name="type">Type of change</param>
-    /// <param name="columnId">Id of the changed column</param>
-    /// <param name="values">Values contained within the changed column</param>
-    private void OnDataChanged(ChangeType type, long columnId, double[] values)
-    {
-      switch (type)
-      {
-        case ChangeType.Add:
-          AddColumn(columnId, values);
-          break;
-        case ChangeType.Modify:
-          ModifyColumn(columnId, values);
-          break;
-        case ChangeType.Remove:
-          RemoveColumn(columnId);
-          break;
-        default:
-          throw new ArgumentOutOfRangeException("type");
-      }
-    }
-
-    /// <summary>
-    /// Adds a new column to the chart.
-    /// </summary>
-    /// <param name="columnId">Id of the column</param>
-    /// <param name="values">Values of the column</param>
-    private void AddColumn(long columnId, double[] values)
-    {
-      throw new NotImplementedException();
-    }
-
-    /// <summary>
-    /// Modifies an existing column of the chart.
-    /// </summary>
-    /// <param name="columnId">Id of the column</param>
-    /// <param name="values">Values of the column</param>
-    private void ModifyColumn(long columnId, double[] values)
-    {
-      throw new NotImplementedException();
-    }
-
-    /// <summary>
-    /// Removes a column from the chart.
-    /// </summary>
-    /// <param name="columnId">Id of the column</param>
-    private void RemoveColumn(long columnId)
-    {
-      throw new NotImplementedException();
     }
 
     #region Add-/RemoveItemEvents
 
-    protected override void AddItemEvents()
-    {
-      // TODO an neues model interface anpassen   
-      throw new NotImplementedException();
-//      base.AddItemEvents();
-//      model.ColumnChanged += OnDataChanged;
+    protected override void AddItemEvents() {
+      base.AddItemEvents();
+
+      model.DataRowAdded += OnDataRowAdded;
+      model.DataRowRemoved += OnDataRowRemoved;
+      model.ModelChanged += OnModelChanged;
     }
 
-    protected override void RemoveItemEvents()
-    {
-      // TODO an neues model interface anpassen   
-      throw new NotImplementedException();
+    protected override void RemoveItemEvents() {
+      base.RemoveItemEvents();
 
-//      base.RemoveItemEvents();
-//      model.ColumnChanged -= OnDataChanged;
+      model.DataRowAdded -= OnDataRowAdded;
+      model.DataRowRemoved -= OnDataRowRemoved;
+      model.ModelChanged -= OnModelChanged;
+    }
+
+    private void OnDataRowAdded(IDataRow row) {
+      row.ValueChanged += OnRowValueChanged;
+      row.ValuesChanged += OnRowValuesChanged;
+
+      InitShapes(row);
+    }
+
+    private void InitShapes(IDataRow row) {
+      List<LineShape> lineShapes = new List<LineShape>();
+
+      for (int i = 1; i < row.Count; i++) {
+        LineShape lineShape = new LineShape(i - 1, row[i - 1], i, row[i], 0, row.Color);
+        lineShapes.Add(lineShape);
+        canvasUI1.MainCanvas.WorldShape.AddShape(lineShape);
+      }
+
+      rowToLineShapes[row] = lineShapes;
+
+      canvasUI1.Invalidate();
+    }
+
+    private void OnDataRowRemoved(IDataRow row) {
+      row.ValueChanged -= OnRowValueChanged;
+      row.ValuesChanged -= OnRowValuesChanged;
+    }
+
+    private readonly IDictionary<IDataRow, List<LineShape>> rowToLineShapes = new Dictionary<IDataRow, List<LineShape>>();
+
+    private void OnRowValueChanged(IDataRow row, double value, int index) {
+      List<LineShape> lineShapes = rowToLineShapes[row];
+
+      if (index > lineShapes.Count+1)
+        throw new NotImplementedException();
+
+      // new value was added
+      if (index > 0 && index == lineShapes.Count+1) {
+        LineShape lineShape = new LineShape(index - 1, row[index - 1], index, row[index], 0, row.Color);
+        lineShapes.Add(lineShape);
+        canvasUI1.MainCanvas.WorldShape.AddShape(lineShape);
+      }
+
+      // not the first value
+      if (index > 0)
+        lineShapes[index-1].Y2 = value;
+
+      // not the last value
+      if (index > 0 && index < row.Count)
+        lineShapes[index].Y1 = value;
+
+      canvasUI1.Invalidate();
+    }
+
+    private void OnRowValuesChanged(IDataRow row, double[] values, int index) {
+      foreach (double value in values) {
+        OnRowValueChanged(row, value, index++);
+      }
+    }
+
+    private void OnModelChanged() {
     }
 
@@ -170,22 +115,16 @@
     private int beginUpdateCount = 0;
 
-    public void BeginUpdate()
-    {
+    public void BeginUpdate() {
       beginUpdateCount++;
     }
 
-    public void EndUpdate()
-    {
+    public void EndUpdate() {
       if (beginUpdateCount == 0)
-      {
         throw new InvalidOperationException("Too many EndUpdates.");
-      }
 
       beginUpdateCount--;
 
       if (beginUpdateCount == 0)
-      {
         Invalidate();
-      }
     }
 
Index: /trunk/sources/HeuristicLab.Visualization/LineShape.cs
===================================================================
--- /trunk/sources/HeuristicLab.Visualization/LineShape.cs	(revision 860)
+++ /trunk/sources/HeuristicLab.Visualization/LineShape.cs	(revision 861)
@@ -3,5 +3,5 @@
 namespace HeuristicLab.Visualization {
   public class LineShape : IShape {
-    private RectangleD boundingRect;
+    private RectangleD boundingBox;
     private double z;
     private Color color;
@@ -16,5 +16,5 @@
     /// <param name="color">color for the LineShape</param>
     public LineShape(double x1, double y1, double x2, double y2, double z, Color color) {
-      this.boundingRect = new RectangleD(x1, y1, x2, y2);
+      this.boundingBox = new RectangleD(x1, y1, x2, y2);
       this.z = z;
       this.color = color;
@@ -22,5 +22,25 @@
 
     public RectangleD BoundingBox {
-      get { return boundingRect; }
+      get { return boundingBox; }
+    }
+
+    public double Y1 {
+      get { return boundingBox.Y1; }
+      set { boundingBox.Y1 = value; }
+    }
+
+    public double Y2 {
+      get { return boundingBox.Y2; }
+      set { boundingBox.Y2 = value; }
+    }
+
+    public double X1 {
+      get { return boundingBox.X1; }
+      set { boundingBox.X1 = value; }
+    }
+
+    public double X2 {
+      get { return boundingBox.X2; }
+      set { boundingBox.X2 = value; }
     }
 
@@ -33,5 +53,5 @@
     public void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) {
       using (Pen pen = new Pen(color, 3)){
-        Rectangle screenRect = Transform.ToScreen(boundingRect, viewport, clippingArea);
+        Rectangle screenRect = Transform.ToScreen(boundingBox, viewport, clippingArea);
         graphics.DrawLine(pen,screenRect.Left, screenRect.Bottom, screenRect.Right, screenRect.Top);
       }
