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/MinAggregator.cs

    r1343 r1350  
    11using System;
    22using System.Collections.Generic;
    3 using System.Drawing;
    4 using HeuristicLab.Visualization.LabelProvider;
    53
    64namespace HeuristicLab.Visualization {
    7   public class MinAggregator : IAggregator {
     5  public class MinAggregator : DataRowBase {
    86    #region IAggregator Members
    97
     
    5048      } else {
    5149        curMinValue = double.MaxValue;
    52         foreach (var rows in dataRowWatches) {
     50        foreach (IDataRow rows in dataRowWatches) {
    5351          for (int i = 0; i < rows.Count; i++) {
    5452            if (rows[i] < curMinValue) {
     
    6563    #region IDataRow Members
    6664
    67     private string label = "";
    68     private Color color = Color.Black;
    69     private int thickness = 2;
    70     private DrawingStyle style = DrawingStyle.Solid;
    71     private DataRowType lineType = DataRowType.Normal;
    72 
    73 
    74     public string Label {
    75       get { return label; }
    76       set {
    77         label = value;
    78         OnDataRowChanged(this);
    79       }
    80     }
    81 
    82     public Color Color {
    83       get { return color; }
    84       set {
    85         color = value;
    86         OnDataRowChanged(this);
    87       }
    88     }
    89 
    90     public int Thickness {
    91       get { return thickness; }
    92       set {
    93         thickness = value;
    94         OnDataRowChanged(this);
    95       }
    96     }
    97 
    98     public DrawingStyle Style {
    99       get { return style; }
    100       set {
    101         style = value;
    102         OnDataRowChanged(this);
    103       }
    104     }
    105 
    106     public DataRowType LineType {
    107       get { return lineType; }
    108       set {
    109         lineType = value;
    110         OnDataRowChanged(this);
    111       }
    112     }
    113 
    114 
    115     private bool showYAxis = false;
    116 
    117     public bool ShowYAxis {
    118       get { return showYAxis; }
    119       set {
    120         showYAxis = value;
    121         OnDataRowChanged(this);
    122       }
    123     }
    124 
    125     private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");
    126     public ILabelProvider YAxisLabelProvider {
    127       get { return labelProvider; }
    128       set {
    129         this.labelProvider = value;
    130         OnDataRowChanged(this);
    131       }
    132     }
    133 
    134     public void AddValue(double value) {
     65    public override void AddValue(double value) {
    13566      OnValueChanged(2, 0, Action.Added);
    13667    }
    13768
    138     public void AddValue(double value, int index) {
     69    public override void AddValue(double value, int index) {
    13970      throw new NotSupportedException();
    14071    }
    14172
    142     public void AddValues(double[] values) {
     73    public override void AddValues(double[] values) {
    14374      throw new NotSupportedException();
    14475    }
    14576
    146     public void AddValues(double[] values, int index) {
     77    public override void AddValues(double[] values, int index) {
    14778      throw new NotSupportedException();
    14879    }
    14980
    150     public void ModifyValue(double value, int index) {
     81    public override void ModifyValue(double value, int index) {
    15182      throw new NotSupportedException();
    15283    }
    15384
    154     public void ModifyValues(double[] values, int index) {
     85    public override void ModifyValues(double[] values, int index) {
    15586      throw new NotSupportedException();
    15687    }
    15788
    158     public void RemoveValue(int index) {
     89    public override void RemoveValue(int index) {
    15990      throw new NotSupportedException();
    16091    }
    16192
    162     public void RemoveValues(int index, int count) {
     93    public override void RemoveValues(int index, int count) {
    16394      throw new NotSupportedException();
    16495    }
    16596
    166     public int Count {
     97    public override int Count {
    16798      get { return 1; }
    16899    }
    169100
    170     public double this[int index] {
     101    public override double this[int index] {
    171102      get {
    172103        return curMinValue;
     
    177108    }
    178109
    179     public double MinValue {
    180       get { throw new System.NotImplementedException(); }
     110    public override double MinValue {
     111      get { return curMinValue; }
    181112    }
    182113
    183     public double MaxValue {
    184       get { throw new System.NotImplementedException(); }
    185     }
    186 
    187     public event ValuesChangedHandler ValuesChanged;
    188 
    189     protected void OnValuesChanged(double[] values, int index, Action action) {
    190       if (ValuesChanged != null) {
    191         ValuesChanged(this, values, index, action);
    192       }
    193     }
    194 
    195     public event ValueChangedHandler ValueChanged;
    196 
    197     protected void OnValueChanged(double value, int index, Action action) {
    198       if (ValueChanged != null) {
    199         ValueChanged(this, value, index, action);
    200       }
    201     }
    202 
    203     public event DataRowChangedHandler DataRowChanged;
    204 
    205     protected void OnDataRowChanged(IDataRow row) {
    206       if (DataRowChanged != null) {
    207         DataRowChanged(this);
    208       }
     114    public override double MaxValue {
     115      get { return curMinValue; }
    209116    }
    210117
Note: See TracChangeset for help on using the changeset viewer.