Skip to content

Commit

Permalink
Worked on flexible coloring of data rows and on changing the initial …
Browse files Browse the repository at this point in the history
…index from 1 to 0 (#925)

git-svn-id: https://src.heuristiclab.com/svn/core/trunk@4648 2abd9481-f8db-48e9-bd25-06bc13291c1b
  • Loading branch information
s-wagner committed Oct 27, 2010
1 parent c54f9c0 commit d340d8f
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 26 deletions.
46 changes: 23 additions & 23 deletions sources/HeuristicLab.Analysis.Views/3.3/DataTableView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private void AddDataRow(DataRow row) {
break;
}
series.YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary;
if (row.VisualProperties.Color != Color.Empty) series.Color = row.VisualProperties.Color;
series.ToolTip = row.Name + " X = #INDEX, Y = #VAL";
FillSeriesWithRowValues(series, row);
chart.Series.Add(series);
Expand Down Expand Up @@ -255,6 +256,7 @@ private void Row_VisualPropertiesChanged(object sender, EventArgs e) {
break;
}
chart.Series[row.Name].YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary;
if (row.VisualProperties.Color != Color.Empty) chart.Series[row.Name].Color = row.VisualProperties.Color;
}
}
private void Row_NameChanged(object sender, EventArgs e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public override IOperation Apply() {
DataRowVisualProperties visualProperties = new DataRowVisualProperties();
visualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Line;
visualProperties.SecondYAxis = true;
visualProperties.StartIndexZero = true;
allelesTable.Rows.Add(new DataRow("Unique Alleles of Best Known Solution", null, visualProperties));
allelesTable.Rows.Add(new DataRow("Fixed Alleles", null, visualProperties));
allelesTable.Rows.Add(new DataRow("Fixed Alleles of Best Known Solution", null, visualProperties));
Expand Down
54 changes: 51 additions & 3 deletions sources/HeuristicLab.Analysis/3.3/DataRowVisualProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using System.ComponentModel;
using HeuristicLab.Common;
using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
using System.Drawing;

namespace HeuristicLab.Analysis {
/// <summary>
Expand All @@ -38,7 +39,6 @@ public enum DataRowChartType {
}
#endregion

[Storable(DefaultValue = DataRowChartType.Line)]
private DataRowChartType chartType;
public DataRowChartType ChartType {
get { return chartType; }
Expand All @@ -49,7 +49,6 @@ public DataRowChartType ChartType {
}
}
}
[Storable(DefaultValue = false)]
private bool secondYAxis;
public bool SecondYAxis {
get { return secondYAxis; }
Expand All @@ -60,14 +59,61 @@ public bool SecondYAxis {
}
}
}
private Color color;
public Color Color {
get { return color; }
set {
if (color != value) {
color = value;
OnPropertyChanged("Color");
}
}
}
private bool startIndexZero;
public bool StartIndexZero {
get { return startIndexZero; }
set {
if (startIndexZero != value) {
startIndexZero = value;
OnPropertyChanged("StartIndexZero");
}
}
}

#region Persistence Properties
[Storable(Name = "ChartType")]
private DataRowChartType StorableChartType {
get { return chartType; }
set { chartType = value; }
}
[Storable(Name = "SecondYAxis")]
private bool StorableSecondYAxis {
get { return secondYAxis; }
set { secondYAxis = value; }
}
[Storable(Name = "Color")]
private Color StorableColor {
get { return color; }
set { color = value; }
}
[Storable(Name = "StartIndexZero")]
private bool StorableStartIndexZero {
get { return startIndexZero; }
set { startIndexZero = value; }
}
#endregion

public DataRowVisualProperties() {
chartType = DataRowChartType.Line;
secondYAxis = false;
color = Color.Empty;
startIndexZero = false;
}
public DataRowVisualProperties(DataRowChartType chartType, bool secondYAxis) {
public DataRowVisualProperties(DataRowChartType chartType, bool secondYAxis, Color color, bool startIndexZero) {
this.chartType = chartType;
this.secondYAxis = secondYAxis;
this.color = color;
this.startIndexZero = startIndexZero;
}
[StorableConstructor]
protected DataRowVisualProperties(bool deserializing) { }
Expand All @@ -76,6 +122,8 @@ public override IDeepCloneable Clone(Cloner cloner) {
DataRowVisualProperties clone = (DataRowVisualProperties)base.Clone(cloner);
clone.chartType = chartType;
clone.secondYAxis = secondYAxis;
clone.color = color;
clone.startIndexZero = startIndexZero;
return clone;
}

Expand Down

0 comments on commit d340d8f

Please sign in to comment.