Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9717


Ignore:
Timestamp:
07/17/13 16:00:55 (11 years ago)
Author:
ascheibe
Message:

#2031 ported changes from the boxplot view from r9435 to the sample size influence view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs

    r9713 r9717  
    391391      if (!this.categoricalMapping.ContainsKey(dimension)) {
    392392        this.categoricalMapping[dimension] = new Dictionary<object, double>();
    393         var orderedCategories = Content.Where(r => r.Visible).Select(r => Content.GetValue(r, dimension).ToString())
    394                                 .Distinct()
    395                                 .OrderBy(x => x, new NaturalStringComparer());
     393        var orderedCategories = Content.Where(r => r.Visible && Content.GetValue(r, dimension) != null).Select(r => Content.GetValue(r, dimension).ToString())
     394
     395                                       .Distinct().OrderBy(x => x, new NaturalStringComparer());
    396396        int count = 1;
    397397        foreach (var category in orderedCategories) {
     
    438438      Axis yAxis = this.chart.ChartAreas[BoxPlotChartAreaName].AxisY;
    439439      int axisDimensionCount = Enum.GetNames(typeof(AxisDimension)).Count();
    440       //TODO: hack!!!!!
     440
    441441      SetCustomAxisLabels(xAxis, -1);
    442442      SetCustomAxisLabels(yAxis, yAxisComboBox.SelectedIndex - axisDimensionCount);
     
    454454      axis.CustomLabels.Clear();
    455455      if (categoricalMapping.ContainsKey(dimension)) {
    456         foreach (var pair in categoricalMapping[dimension]) {
     456        int position = 1;
     457        foreach (var pair in categoricalMapping[dimension].Where(x => seriesCache.ContainsKey(x.Value))) {
    457458          string labelText = pair.Key.ToString();
    458459          CustomLabel label = new CustomLabel();
     
    462463          label.Text = labelText;
    463464          label.GridTicks = GridTickTypes.TickMark;
    464           label.FromPosition = pair.Value - 0.5;
    465           label.ToPosition = pair.Value + 0.5;
     465          label.FromPosition = position - 0.5;
     466          label.ToPosition = position + 0.5;
    466467          axis.CustomLabels.Add(label);
     468          position++;
    467469        }
    468470      } else if (dimension > 0 && Content.GetValue(0, dimension) is TimeSpanValue) {
Note: See TracChangeset for help on using the changeset viewer.