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

    r1343 r1350  
    1515  public delegate void ValueChangedHandler(IDataRow row, double value, int index, Action action);
    1616
    17   public class DataRow : IDataRow {
    18     private string label = "";
    19     private Color color = Color.Black;
    20     private int thickness = 2;
    21     private DrawingStyle style = DrawingStyle.Solid;
    22     private DataRowType lineType = DataRowType.Normal;
     17  public class DataRow : DataRowBase {
    2318    private readonly List<double> dataRow = new List<double>();
    24 
    25     private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");
    2619
    2720    // TODO implement calculation of min and max values
    2821    private double minValue = double.MaxValue;
    2922    private double maxValue = double.MinValue;
    30 
    31     public DataRowType LineType{
    32       get { return lineType; }
    33       set {
    34         lineType = value;
    35         OnDataRowChanged(this);
    36       }
    37     }
    38 
    39     public ILabelProvider YAxisLabelProvider {
    40       get { return labelProvider; }
    41       set {
    42         this.labelProvider = value;
    43         OnDataRowChanged(this);
    44       }
    45     }
    4623
    4724    public DataRow() {
     
    6037    }
    6138
    62     public event DataRowChangedHandler DataRowChanged;
    63 
    64     protected void OnDataRowChanged(IDataRow row) {
    65       if (DataRowChanged != null) {
    66         DataRowChanged(this);
    67       }
    68     }
    69 
    70     public event ValuesChangedHandler ValuesChanged;
    71 
    72     protected void OnValuesChanged(double[] values, int index, Action action) {
    73       if (ValuesChanged != null) {
    74         ValuesChanged(this, values, index, action);
    75       }
    76     }
    77 
    78     public event ValueChangedHandler ValueChanged;
    79 
    80     protected void OnValueChanged(double value, int index, Action action) {
    81       if (ValueChanged != null) {
    82         ValueChanged(this, value, index, action);
    83       }
    84     }
    85  
    86     public string Label {
    87       get { return label; }
    88       set {
    89         label = value;
    90         OnDataRowChanged(this);
    91       }
    92     }
    93    
    94 
    95     public Color Color {
    96       get { return color; }
    97       set {
    98         color = value;
    99         OnDataRowChanged(this);
    100       }
    101     }
    102 
    103     public int Thickness {
    104       get { return thickness; }
    105       set {
    106         thickness = value;
    107         OnDataRowChanged(this);
    108       }
    109     }
    110 
    111     public DrawingStyle Style {
    112       get { return style; }
    113       set {
    114         style = value;
    115         OnDataRowChanged(this);
    116       }
    117     }
    118 
    119     private bool showYAxis = true;
    120 
    121     public virtual bool ShowYAxis {
    122       get { return showYAxis; }
    123       set {
    124         showYAxis = value;
    125         OnDataRowChanged(this);
    126       }
    127     }
    128 
    129     public void AddValue(double value) {
     39    public override void AddValue(double value) {
    13040      UpdateMinMaxValue(value);
    13141
     
    13444    }
    13545
    136     public void AddValue(double value, int index) {
     46    public override void AddValue(double value, int index) {
    13747      //check if index is valid
    13848      if (index >= 0 && index < dataRow.Count) {
     
    14454    }
    14555
    146     public void AddValues(double[] values) {
     56    public override void AddValues(double[] values) {
    14757      int startInd = dataRow.Count;
    14858
     
    15363    }
    15464
    155     public void AddValues(double[] values, int index) {
     65    public override void AddValues(double[] values, int index) {
    15666      int j = index;
    15767
     
    16878    }
    16979
    170     public void ModifyValue(double value, int index) {
     80    public override void ModifyValue(double value, int index) {
    17181      //check if index is valid
    17282      if (index >= 0 && index < dataRow.Count) {
     
    17888    }
    17989
    180     public void ModifyValues(double[] values, int index) {
     90    public override void ModifyValues(double[] values, int index) {
    18191      int startInd = index;
    18292      int modInd = index;
     
    194104    }
    195105
    196     public void RemoveValue(int index) {
     106    public override void RemoveValue(int index) {
    197107      double remVal = dataRow[index];
    198108      //check if index is valid
     
    205115    }
    206116
    207     public void RemoveValues(int index, int count) {
     117    public override void RemoveValues(int index, int count) {
    208118      double[] remValues = new double[count]; //removed values
    209119      int j = 0;
     
    227137    }
    228138
    229     public int Count {
     139    public override int Count {
    230140      get { return dataRow.Count; }
    231141    }
    232142
    233     public double this[int index] {
     143    public override double this[int index] {
    234144      get { return dataRow[index]; }
    235145      set {
     
    239149    }
    240150
    241     public double MinValue {
     151    public override double MinValue {
    242152      get { return minValue; }
    243153    }
    244154
    245     public double MaxValue {
     155    public override double MaxValue {
    246156      get { return maxValue; }
    247157    }
Note: See TracChangeset for help on using the changeset viewer.