Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/30/09 13:12:34 (15 years ago)
Author:
shofstad
Message:

Legend implementation updated (#407)

Location:
trunk/sources/HeuristicLab.Visualization/3.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/3.2/Legend/LegendItem.cs

    r1877 r1977  
    33namespace HeuristicLab.Visualization.Legend {
    44  public class LegendItem {
    5 
    65    // default width
    76    // every legend under 100 gets the default width
    87    public static readonly int WIDTH = 100;
    98
     9    private readonly IDataRow row;
     10
    1011    /// <summary>
    1112    /// a legend item object with its properties
    1213    /// </summary>
    13     /// <param name="label">the label of the legend</param>
    14     /// <param name="color">the color of the legend line</param>
    15     /// <param name="thickness">the thickness of the legend line</param>
    16     public LegendItem(string label, Color color, int thickness) {
    17       Label = label;
    18       Color = color;
    19       Thickness = thickness;
     14    public LegendItem(IDataRow row) {
     15      this.row = row;
    2016    }
    2117
    22     public string Label { get; set; }
    23     public Color Color { get; set; }
    24     public int Thickness { get; set; }
     18    public string Label {
     19      get { return row.RowSettings.Label; }
     20    }
     21
     22    public Color Color {
     23      get { return row.RowSettings.Color; }
     24    }
     25
     26    public int Thickness {
     27      get { return row.RowSettings.Thickness; }
     28    }
    2529  }
    2630}
  • trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs

    r1974 r1977  
    367367      row.DataRowChanged += OnDataRowChanged;
    368368
    369       legendShape.AddLegendItem(new LegendItem(row.RowSettings.Label, row.RowSettings.Color, row.RowSettings.Thickness));
     369      legendShape.AddLegendItem(new LegendItem(row));
    370370      legendShape.CreateLegend();
    371371
Note: See TracChangeset for help on using the changeset viewer.