Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/09 19:42:17 (15 years ago)
Author:
mstoeger
Message:

Implemented multiple Y-Axes. A LineChart has several Y-Axes and each Y-Axis has several data rows. The same clipping area is set for all data rows belonging to a Y-Axis. (#433)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/AvgLineAggregator.cs

    r1343 r1350  
    11using System;
    22using System.Collections.Generic;
    3 using System.Drawing;
    43
    54namespace HeuristicLab.Visualization {
    6   public class AvgLineAggregator : IAggregator {
     5  public class AvgLineAggregator : DataRowBase {
    76
    87    private readonly List<double> dataRow = new List<double>();
     
    7776    #region IDataRow Members
    7877
    79     private string label = "";
    80     private Color color = Color.Black;
    81     private int thickness = 2;
    82     private DrawingStyle style = DrawingStyle.Solid;
    83     private DataRowType lineType = DataRowType.Normal;
    84 
    85 
    86     public string Label {
    87       get { return label; }
    88       set {
    89         label = value;
    90         OnDataRowChanged(this);
    91       }
    92     }
    93 
    94     public Color Color {
    95       get { return color; }
    96       set {
    97         color = value;
    98         OnDataRowChanged(this);
    99       }
    100     }
    101 
    102     public int Thickness {
    103       get { return thickness; }
    104       set {
    105         thickness = value;
    106         OnDataRowChanged(this);
    107       }
    108     }
    109 
    110     public DrawingStyle Style {
    111       get { return style; }
    112       set {
    113         style = value;
    114         OnDataRowChanged(this);
    115       }
    116     }
    117 
    118     public DataRowType LineType {
    119       get { return lineType; }
    120       set {
    121         lineType = value;
    122         OnDataRowChanged(this);
    123       }
    124     }
    125 
    126 
    127     private bool showYAxis = false;
    128 
    129     public bool ShowYAxis {
    130       get { return showYAxis; }
    131       set {
    132         showYAxis = value;
    133         OnDataRowChanged(this);
    134       }
    135     }
    136 
    137     public LabelProvider.ILabelProvider YAxisLabelProvider {
    138       get {
    139         throw new NotImplementedException();
    140       }
    141       set {
    142         throw new NotImplementedException();
    143       }
    144     }
    145 
    146     public void AddValue(double value) {
     78    public override void AddValue(double value) {
    14779      dataRow.Add(value);
    14880      OnValueChanged(value, dataRow.Count - 1, Action.Added);
    14981    }
    15082
    151     public void AddValue(double value, int index) {
    152       throw new System.NotImplementedException();
     83    public override void AddValue(double value, int index) {
     84      throw new NotImplementedException();
    15385    }
    15486
    155     public void AddValues(double[] values) {
     87    public override void AddValues(double[] values) {
    15688      throw new NotSupportedException();
    15789    }
    15890
    159     public void AddValues(double[] values, int index) {
     91    public override void AddValues(double[] values, int index) {
    16092      throw new NotSupportedException();
    16193    }
    16294
    163     public void ModifyValue(double value, int index) {
     95    public override void ModifyValue(double value, int index) {
    16496      throw new NotSupportedException();
    16597    }
    16698
    167     public void ModifyValues(double[] values, int index) {
     99    public override void ModifyValues(double[] values, int index) {
    168100      throw new NotSupportedException();
    169101    }
    170102
    171     public void RemoveValue(int index) {
     103    public override void RemoveValue(int index) {
    172104      throw new NotSupportedException();
    173105    }
    174106
    175     public void RemoveValues(int index, int count) {
     107    public override void RemoveValues(int index, int count) {
    176108      throw new NotSupportedException();
    177109    }
    178110
    179     public int Count {
     111    public override int Count {
    180112      get { return dataRowWatches.Count; }
    181113    }
    182114
    183     public double this[int index] {
     115    public override double this[int index] {
    184116      get { return dataRow[index]; }
    185117      set {
     
    189121    }
    190122
    191     public double MinValue {
    192       get { throw new System.NotImplementedException(); }
     123    // TODO calculate min value
     124    public override double MinValue {
     125      get { return 0; }
    193126    }
    194127
    195     public double MaxValue {
    196       get { throw new System.NotImplementedException(); }
    197     }
    198 
    199     public event ValuesChangedHandler ValuesChanged;
    200 
    201     protected void OnValuesChanged(double[] values, int index, Action action) {
    202       if (ValuesChanged != null) {
    203         ValuesChanged(this, values, index, action);
    204       }
    205     }
    206 
    207     public event ValueChangedHandler ValueChanged;
    208 
    209     protected void OnValueChanged(double value, int index, Action action) {
    210       if (ValueChanged != null) {
    211         ValueChanged(this, value, index, action);
    212       }
    213     }
    214 
    215     public event DataRowChangedHandler DataRowChanged;
    216 
    217     protected void OnDataRowChanged(IDataRow row) {
    218       if (DataRowChanged != null) {
    219         DataRowChanged(this);
    220       }
     128    // TODO calculate max value
     129    public override double MaxValue {
     130      get { return 0; }
    221131    }
    222132
Note: See TracChangeset for help on using the changeset viewer.