Changeset 4211 for trunk/sources
- Timestamp:
- 08/13/10 13:07:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBoxPlotView.cs
r4094 r4211 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel;25 using System.Data;26 using System.Drawing;27 24 using System.Linq; 28 using System.Text;29 25 using System.Windows.Forms; 30 26 using System.Windows.Forms.DataVisualization.Charting; 31 using HeuristicLab.Common;32 27 using HeuristicLab.Core; 33 28 using HeuristicLab.Data; … … 46 41 private string yAxisValue; 47 42 private Dictionary<int, Dictionary<object, double>> categoricalMapping; 48 private Dictionary<double, Series> seriesCache;43 private SortedDictionary<double, Series> seriesCache; 49 44 50 45 public RunCollectionBoxPlotView() { 51 46 InitializeComponent(); 52 47 this.categoricalMapping = new Dictionary<int, Dictionary<object, double>>(); 53 this.seriesCache = new Dictionary<double, Series>();48 this.seriesCache = new SortedDictionary<double, Series>(); 54 49 this.chart.ChartAreas[0].Visible = false; 55 50 this.chart.Series.Clear(); … … 307 302 axis.CustomLabels.Clear(); 308 303 if (categoricalMapping.ContainsKey(dimension)) { 309 CustomLabel label = null;310 304 foreach (var pair in categoricalMapping[dimension]) { 311 305 string labelText = pair.Key.ToString(); 306 CustomLabel label = new CustomLabel(); 307 label.ToolTip = labelText; 312 308 if (labelText.Length > 25) 313 309 labelText = labelText.Substring(0, 25) + " ... "; 314 label = axis.CustomLabels.Add(pair.Value - 0.5, pair.Value + 0.5, labelText);310 label.Text = labelText; 315 311 label.GridTicks = GridTickTypes.TickMark; 316 } 317 axis.IsLabelAutoFit = false; 318 axis.LabelStyle.Enabled = true; 319 axis.LabelStyle.Angle = 0; 320 axis.LabelStyle.TruncatedLabels = true; 312 label.FromPosition = pair.Value - 0.5; 313 label.ToPosition = pair.Value + 0.5; 314 axis.CustomLabels.Add(label); 315 } 321 316 } else if (dimension > 0 && Content.GetValue(0, dimension) is TimeSpanValue) { 322 317 this.chart.ChartAreas[0].RecalculateAxesScale(); … … 329 324 axis.CustomLabels.Add(i - correspondingAxis.LabelStyle.Interval / 2, i + correspondingAxis.LabelStyle.Interval / 2, x); 330 325 } 326 } else if (chart.ChartAreas[BoxPlotChartAreaName].AxisX == axis) { 327 double position = 1.0; 328 foreach (Series series in chart.Series) { 329 if (series.Name != BoxPlotSeriesName) { 330 string labelText = series.Points[0].XValue.ToString(); 331 CustomLabel label = new CustomLabel(); 332 label.FromPosition = position - 0.5; 333 label.ToPosition = position + 0.5; 334 label.GridTicks = GridTickTypes.TickMark; 335 label.Text = labelText; 336 axis.CustomLabels.Add(label); 337 position++; 338 } 339 } 331 340 } 332 341 }
Note: See TracChangeset
for help on using the changeset viewer.