- Timestamp:
- 01/18/17 13:17:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs
r14519 r14582 118 118 foreach (var row in rows) { 119 119 RegisterDataRowEvents(row); 120 var series = new Series(row.Name); 120 var series = new Series(row.Name) { 121 Tag = row 122 }; 121 123 if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName; 122 124 else series.LegendText = row.Name; … … 128 130 RecalculateAxesScale(chart.ChartAreas[0]); 129 131 UpdateYCursorInterval(); 132 UpdateHistogramTransparency(); 130 133 } 131 134 … … 174 177 break; 175 178 case DataRowVisualProperties.DataRowChartType.Histogram: 176 series.ChartType = SeriesChartType.StackedColumn; 179 bool stacked = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Stacked; 180 series.ChartType = stacked ? SeriesChartType.StackedColumn : SeriesChartType.Column; 181 bool sideBySide = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.SideBySide; 182 series.SetCustomProperty("DrawSideBySide", sideBySide ? "True" : "False"); 177 183 series.SetCustomProperty("PointWidth", "1"); 178 184 if (!series.Color.IsEmpty && series.Color.GetBrightness() < 0.25) … … 275 281 } 276 282 283 protected void UpdateHistogramTransparency() { 284 if (Content.Rows.Any(r => RequiresTransparency(r) && r.VisualProperties.Color.IsEmpty)) { 285 foreach (var series in chart.Series) // sync colors before applying palette colors 286 series.Color = ((DataRow)series.Tag).VisualProperties.Color; 287 chart.ApplyPaletteColors(); 288 } 289 290 var numTransparent = Content.Rows.Count(RequiresTransparency); 291 if (numTransparent <= 1) return; 292 foreach (var series in chart.Series) { 293 var row = (DataRow)series.Tag; 294 if (!RequiresTransparency(row)) 295 continue; 296 var baseColor = row.VisualProperties.Color; 297 if (baseColor.IsEmpty) baseColor = series.Color; 298 series.Color = Color.FromArgb(180, baseColor); 299 } 300 } 301 private bool RequiresTransparency(DataRow row) { 302 return row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram 303 && row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Overlapping; 304 } 305 277 306 #region Event Handlers 278 307 #region Content Event Handlers … … 327 356 series.Points.Clear(); 328 357 ConfigureSeries(series, row); 329 FillSeriesWithRowValues(series, row); 330 RecalculateAxesScale(chart.ChartAreas[0]); 358 if (!invisibleSeries.Contains(series)) { 359 FillSeriesWithRowValues(series, row); 360 RecalculateAxesScale(chart.ChartAreas[0]); 361 UpdateHistogramTransparency(); 362 } 331 363 } 332 364 }
Note: See TracChangeset
for help on using the changeset viewer.