Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12787


Ignore:
Timestamp:
07/21/15 10:49:55 (9 years ago)
Author:
mkommend
Message:

#2436: Fixed exception in BoxplotView when color is selected as category.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r12077 r12787  
    345345      switch (axisDimension) {
    346346        case AxisDimension.Color: {
    347             value = GetCategoricalValue(-1, run.Color.ToString());
     347            const int colorDimension = -1;
     348            if (!categoricalMapping.ContainsKey(colorDimension)) {
     349              categoricalMapping[colorDimension] = Content.Where(r => r.Visible)
     350                  .Select(r => r.Color.Name)
     351                  .Distinct()
     352                  .OrderBy(c => c, new NaturalStringComparer())
     353                  .Select((c, i) => new { Color = c, Index = i })
     354                  .ToDictionary(a => (object)a.Color, a => (double)a.Index);
     355
     356            }
     357            value = GetCategoricalValue(colorDimension, run.Color.Name);
    348358            break;
    349359          }
Note: See TracChangeset for help on using the changeset viewer.