Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12822


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

Location:
branches/PerformanceComparison
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.cs

    r12808 r12822  
    5555      chart.CustomizeAllChartAreas();
    5656      chart.ChartAreas[0].CursorX.Interval = 1;
     57      chart.SuppressExceptions = true;
    5758    }
    5859
     
    246247        a.Maximum = double.NaN;
    247248      }
    248       // chart controls handle log scaling problems not in a graceful way
    249       if (chart.Series.Any(x => x.XAxisType == AxisType.Primary && (x.Points.Count == 0 || x.Points.Any(y => y.XValue <= 0))))
     249
     250      if (chart.Series.Any(x => x.Enabled && x.XAxisType == AxisType.Primary && (x.Points.Count == 0 || x.Points.Any(y => y.XValue <= 0))))
    250251        area.AxisX.IsLogarithmic = false;
    251252      else area.AxisX.IsLogarithmic = Content.VisualProperties.XAxisLogScale;
    252       if (chart.Series.Any(x => x.XAxisType == AxisType.Secondary && (x.Points.Count == 0 || x.Points.Any(y => y.XValue <= 0))))
     253      if (chart.Series.Any(x => x.Enabled && x.XAxisType == AxisType.Secondary && (x.Points.Count == 0 || x.Points.Any(y => y.XValue <= 0))))
    253254        area.AxisX2.IsLogarithmic = false;
    254255      else area.AxisX2.IsLogarithmic = Content.VisualProperties.SecondXAxisLogScale;
    255256
    256       if (chart.Series.Any(x => x.YAxisType == AxisType.Primary && (x.Points.Count == 0 || x.Points.Any(y => y.YValues.Min() <= 0))))
     257      if (chart.Series.Any(x => x.Enabled && x.YAxisType == AxisType.Primary && (x.Points.Count == 0 || x.Points.Any(y => y.YValues.Min() <= 0))))
    257258        area.AxisY.IsLogarithmic = false;
    258259      else area.AxisY.IsLogarithmic = Content.VisualProperties.YAxisLogScale;
    259       if (chart.Series.Any(x => x.YAxisType == AxisType.Secondary && (x.Points.Count == 0 || x.Points.Any(y => y.YValues.Min() <= 0))))
     260      if (chart.Series.Any(x => x.Enabled && x.YAxisType == AxisType.Secondary && (x.Points.Count == 0 || x.Points.Any(y => y.YValues.Min() <= 0))))
    260261        area.AxisY2.IsLogarithmic = false;
    261262      else area.AxisY2.IsLogarithmic = Content.VisualProperties.SecondYAxisLogScale;
  • 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.