Changeset 12595 for branches/BubbleChart/HeuristicLab.Optimization.BubbleChart/3.3/BubbleChartView.cs
- Timestamp:
- 07/06/15 11:32:59 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BubbleChart/HeuristicLab.Optimization.BubbleChart/3.3/BubbleChartView.cs
r12554 r12595 200 200 series.Points.Add(new DataPoint(x, new[] { y, s })); 201 201 } 202 203 202 } 204 203 } … … 216 215 return parent.Children 217 216 .Where(child => child.Data.ContainsKey(dataKey)) 218 .Select(child => ConvertToDouble(child .Data[dataKey], child, dataKey));217 .Select(child => ConvertToDouble(child, dataKey)); 219 218 } 220 219 return Enumerable.Empty<double>(); … … 231 230 return GetValue(item, sizeDimension).ToEnumerable(); 232 231 } else if (item.Data.ContainsKey(key)) { 233 IItem value = item.Data[key]; 234 return ConvertToDouble( value,item, key).ToEnumerable();232 233 return ConvertToDouble(item, key).ToEnumerable(); 235 234 } else { 236 235 return Enumerable.Empty<double>(); … … 239 238 } 240 239 241 private double ConvertToDouble(IItem value, RecursiveDataItem item, string key) { 240 private double ConvertToDouble(RecursiveDataItem item, string key) { 241 IItem value = item.Data[key]; 242 242 var doubleValue = value as DoubleValue; 243 243 var intValue = value as IntValue; … … 252 252 ret = timeSpanValue.Value.TotalSeconds; 253 253 else 254 ret = GetCategoricalValue( item,key, value.ToString());254 ret = GetCategoricalValue(key, value.ToString()); 255 255 return ret.Value; 256 256 } 257 257 258 private double? GetCategoricalValue( RecursiveDataItem item,string key, string value) {258 private double? GetCategoricalValue(string key, string value) { 259 259 if (!categoricalMapping.ContainsKey(key)) { 260 260 categoricalMapping[key] = new Dictionary<object, double>(); … … 322 322 } 323 323 private void SetCustomAxisLabels(Axis axis, string key) { 324 if (key == null) return; 325 var tokens = key.Split(new[] { Separator }, StringSplitOptions.RemoveEmptyEntries); 326 if (tokens.Length == 2) 327 key = tokens[1]; 324 328 axis.CustomLabels.Clear(); 325 if ( key != null &&categoricalMapping.ContainsKey(key)) {329 if (categoricalMapping.ContainsKey(key)) { 326 330 foreach (var pair in categoricalMapping[key]) { 327 331 string labelText = pair.Key.ToString(); … … 336 340 axis.CustomLabels.Add(label); 337 341 } 338 } else if ( false && key != null&& Content.Data[key] is TimeSpanValue) { // TODO342 } else if (Content.Data.ContainsKey(key) && Content.Data[key] is TimeSpanValue) { // TODO 339 343 chart.ChartAreas[0].RecalculateAxesScale(); 340 344 for (double i = axis.Minimum; i <= axis.Maximum; i += axis.LabelStyle.Interval) {
Note: See TracChangeset
for help on using the changeset viewer.