Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/31/15 08:36:14 (9 years ago)
Author:
abeham
Message:

#2431: if multiple targets are plotted, the same color is used for each group

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs

    r12808 r12822  
    2323using System.Collections.Generic;
    2424using System.ComponentModel;
     25using System.Drawing;
    2526using System.Linq;
    2627using System.Windows.Forms;
     
    3738  public partial class RunCollectionRLDView : ItemView {
    3839    private const string AllRuns = "All Runs";
     40
     41    private static readonly Color[] colors = new[] {
     42      Color.FromArgb(0x20, 0x4A, 0x87),
     43      Color.FromArgb(0xC1, 0x7D, 0x11),
     44      Color.FromArgb(0x4E, 0x9A, 0x06),
     45      Color.FromArgb(0x75, 0x50, 0x7B),
     46      Color.FromArgb(0x72, 0x9F, 0xCF),
     47      Color.FromArgb(0xA4, 0x00, 0x00),
     48      Color.FromArgb(0xAD, 0x7F, 0xA8),
     49      Color.FromArgb(0xF5, 0x79, 0x00),
     50      Color.FromArgb(0x55, 0x57, 0x53),
     51      Color.FromArgb(0xEF, 0x29, 0x29),
     52      Color.FromArgb(0xED, 0xD4, 0x00),
     53      Color.FromArgb(0x73, 0xD2, 0x16),
     54    };
    3955
    4056    public new RunCollection Content {
     
    208224                            select Tuple.Create(g.Key, g.ToList())).ToList();
    209225        var xAxisTitles = new HashSet<string>();
     226        var colorCount = 0;
     227        var lineStyles = new[] {
     228          DataRowVisualProperties.DataRowLineStyle.Solid,
     229          DataRowVisualProperties.DataRowLineStyle.Dash,
     230          DataRowVisualProperties.DataRowLineStyle.DashDot,
     231          DataRowVisualProperties.DataRowLineStyle.Dot
     232        };
     233        var lineStyleCount = 0;
    210234        foreach (var group in groupedRuns) {
    211235          var hits = new Dictionary<string, SortedList<double, double>>();
     
    258282              VisualProperties = {
    259283                ChartType = DataRowVisualProperties.DataRowChartType.StepLine,
    260                 LineWidth = 2
     284                LineWidth = 2,
     285                Color = colors[colorCount],
     286                LineStyle = lineStyles[lineStyleCount]
    261287              }
    262288            };
     
    268294            combinedDataTable.Rows.Add(row);
    269295          }
     296          colorCount = (colorCount + 1) % colors.Length;
     297          if (colorCount == 0) lineStyleCount = (lineStyleCount + 1) % lineStyles.Length;
    270298        }
    271299        combinedDataTable.VisualProperties.XAxisTitle = string.Join(" / ", xAxisTitles);
Note: See TracChangeset for help on using the changeset viewer.