Changeset 731 for trunk/sources/HeuristicLab.Visualization
- Timestamp:
- 11/10/08 22:10:38 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/ChartDataRowsModel.cs
r728 r731 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Globalization; 3 4 using System.IO; 4 5 using System.Linq; … … 43 44 vals[vals.Length-1] = value; 44 45 columns[dataRowId].Values = vals; 46 47 RaiseColumnChanged(ChangeType.Add, vals.Length-1, new double[1]{value}); 45 48 } 46 49 … … 78 81 79 82 for (int i = 0; i < column.Values.Length; i++){ 80 columnElement.InnerText += column.Values[i].ToString() + ";"; 83 if (i == 0){ 84 columnElement.InnerText += column.Values[i].ToString(CultureInfo.InvariantCulture.NumberFormat); 85 } else{ 86 columnElement.InnerText += ";" + column.Values[i].ToString(CultureInfo.InvariantCulture.NumberFormat); 87 } 81 88 } 82 //columnElement.InnerText = "xx"; 83 node.AppendChild(columnElement); 89 node.AppendChild(columnElement); 84 90 } 85 91 86 //node.InnerText = "test1";87 //test.Data = 11;88 92 return node; 89 93 … … 91 95 92 96 93 /*97 94 98 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 95 99 base.Populate(node, restoredObjects); 96 //Data = bool.Parse(node.InnerText); 100 101 102 foreach (XmlNode column in node.ChildNodes){ 103 XmlAttributeCollection attrs = column.Attributes; 104 XmlAttribute rowIdAttr = (XmlAttribute)attrs.GetNamedItem("id"); 105 int rowId = int.Parse(rowIdAttr.Value); 106 AddDataRow(rowId); 107 string[] tokens = column.InnerText.Split(';'); 108 double[] data = new double[tokens.Length]; 109 for (int i = 0; i < data.Length; i++){ 110 test.Data = i; 111 data[i] = 2.3; 112 //if(double.TryParse(tokens[i], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out data[i]) == false) { 113 // throw new FormatException("Can't parse " + tokens[i] + " as double value."); 114 //} 115 116 } 117 Columns[rowId-1].Values = data; 118 } 97 119 } 98 */120 99 121 } 100 122 }
Note: See TracChangeset
for help on using the changeset viewer.