Opened 8 months ago

Closed 6 weeks ago

#2715 closed feature request (done)

Multiple Histogram DataRows in DataTableView

Reported by: pfleck Owned by: pfleck
Priority: medium Milestone: HeuristicLab 3.3.15
Component: Algorithms.DataAnalysis.Views Version: 3.3.14
Keywords: Cc:

Description (last modified by pfleck)

When the DataTableView displays multiple DataRows that are marked as histograms, the columns for each datarow become thinner. As a result, the x-axis does not match the bars for the histogram anymore.

Instead, the columns should be stacked, and the bin-size of the histograms should consider all histogram-datarows. This way, the bar-widths match the ranges on the x-axis.

Old version

New version

Should be released after #2713.

Attachments (2)

histograms_old.jpg (27.0 KB) - added by pfleck 8 months ago.
histograms_new.jpg (21.2 KB) - added by pfleck 8 months ago.

Download all attachments as: .zip

Change History (25)

Changed 8 months ago by pfleck

Changed 8 months ago by pfleck

comment:1 Changed 8 months ago by pfleck

  • Description modified (diff)
  • Status changed from new to accepted

comment:2 Changed 8 months ago by pfleck

r14457

  • Histograms are now displayed as stacked column chart.
  • The value range and bin sizes are now calculated based on all histogram-rows of the DataTable.
  • When a single histogram is updated, all histograms must be updated in order to keep the value range and bin sizes the same for all histograms.

comment:3 Changed 8 months ago by pfleck

r14458 Use decimal instead of double for bin-ranges to avoid floating point inaccuracies.

comment:4 Changed 8 months ago by pfleck

  • Description modified (diff)

r14508 Only use valid values for calculating min/max for histograms to avoid conversion errors from NaN.

comment:5 Changed 7 months ago by pfleck

  • Owner changed from pfleck to abeham
  • Status changed from accepted to reviewing

comment:6 Changed 7 months ago by pfleck

  • Owner changed from abeham to pfleck
  • Status changed from reviewing to assigned

comment:7 Changed 7 months ago by pfleck

  • Status changed from assigned to accepted

comment:8 Changed 7 months ago by pfleck

r14582

  • Added 3 types of histogram aggregation: Overlapping (transparent), SideBySide and Stacked
  • Added a "clear color"-button in the DataRowVisualPropertiesControl to set the color back to the default color palette color.
  • Set the legend ordering to "reversed". Otherwise legend entries of multiple histograms are not ordered according tho the DataRow ordering.

comment:9 Changed 5 months ago by pfleck

  • Owner changed from pfleck to abeham
  • Status changed from accepted to reviewing

comment:10 Changed 5 months ago by pfleck

r14740 Added percentage in the tool tip of histogram-bars.

comment:11 Changed 3 months ago by pfleck

r14984 Added a Clear-Color button (like in the DataTableVisualPropertiesControl).

comment:12 Changed 8 weeks ago by abeham

  • Owner changed from abeham to pfleck
  • Status changed from reviewing to assigned

Reviewed:

As a general remark, the # of bin setting is confusing. Changing it for one histogram to a value smaller than 10 did not have any affect unless also changing it for all others. Having one set to exact means exact for all of them, etc. Overall I think this should be a per-chart setting, rather than a per-series setting as all histograms should adhere to the same bin-setting. Can we move this from DataRowVisualProperties to DataTableVisualProperties with little effort?

comment:13 Changed 8 weeks ago by abeham

Test script

using HeuristicLab.Analysis;
using HeuristicLab.Core;
using HeuristicLab.Common;
using HeuristicLab.Collections;
using HeuristicLab.Data;
using HeuristicLab.MainForm;
using HeuristicLab.Random;

public class MyScript : HeuristicLab.Scripting.CSharpScriptBase {
  public override void Main() {
    var rand = new FastRandom();
    
    var dt = new DataTable("Test");
    var row1 = new DataRow("Hist1");
    var row2 = new DataRow("Hist2");
    row1.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
    row2.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
    
    for (var i = 0; i < 100; i++) {
      row1.Values.Add(rand.Next(20, 61));
      row2.Values.Add(rand.Next(40, 101));
    }
    
    dt.Rows.Add(row1);
    dt.Rows.Add(row2);
    MainFormManager.MainForm.ShowContent(dt);
  }

  // implement further classes and methods

}

comment:14 Changed 8 weeks ago by pfleck

  • Status changed from assigned to accepted

comment:15 Changed 7 weeks ago by pfleck

r15068 Moved the histogram properties (nr of bins, exact/approximate bins, aggregation) from DataRowVisualProperties to DataTableVisualProperties

  • Adapted DataRow/TableVisualPropertiesControl
  • Backwards compatability is handled in the DataTable (DataTableVisualProperties has no access to the DataRowVisualProperties)
    • new bins = max old nr of bins
    • new exact = any old exact
    • new aggregation = highest occurence of old aggregation

comment:16 Changed 7 weeks ago by pfleck

  • Owner changed from pfleck to abeham
  • Status changed from accepted to reviewing

comment:17 Changed 7 weeks ago by abeham

  • Owner changed from abeham to pfleck
  • Status changed from reviewing to assigned

Reviewed and tested r15068:

  • Sometimes bars overlap each other partially which is fixed as soon as e.g. the window is resized

comment:18 Changed 7 weeks ago by pfleck

  • Status changed from assigned to accepted

comment:19 Changed 7 weeks ago by pfleck

  • Owner changed from pfleck to abeham
  • Status changed from accepted to reviewing

r15095 fixed the overlapping issue

comment:20 Changed 7 weeks ago by abeham

  • Owner changed from abeham to pfleck
  • Status changed from reviewing to readytorelease

ok

comment:21 Changed 7 weeks ago by pfleck

Due to a svn-move operation of DataTable/ScatterPlotControl -> DataTable/ScatterPlotView (in r14982), changes of multiple tickets (#2713, #2715, #2765) were included in a single revision. Instead of a manually extracting the changes from that files, all three tickets will be merged and released simultaneously.

comment:22 Changed 7 weeks ago by pfleck

r15097: Merged to stable

  • 14435-14439,14493,14516,14519,14982,14987,14992,15042 (from #2713)
  • 14457-14458,14508,14582,14740,14984,15068,15095 (from #2715)
  • 14860-14861 (from #2765)

comment:23 Changed 6 weeks ago by pfleck

  • Resolution set to done
  • Status changed from readytorelease to closed
Note: See TracTickets for help on using tickets.