- Timestamp:
- 05/23/09 10:19:25 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/3.2/ChartDataRowsModel.cs
r1876 r1880 5 5 using HeuristicLab.Core; 6 6 using System.Text; 7 using HeuristicLab.Visualization.LabelProvider;8 7 using HeuristicLab.Visualization.Options; 9 8 … … 15 14 public class ChartDataRowsModel : ChartDataModelBase, IChartDataRowsModel{ 16 15 private string title = "Title"; 17 private string xAxisLabel = "";18 private bool showXAxisLabel = true;19 private bool showXAxisGrid = true;20 private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");21 16 22 17 private ViewSettings viewSettings = new ViewSettings(); 23 18 24 public bool ShowXAxisGrid { 25 get { return showXAxisGrid; } 26 set { 27 this.showXAxisGrid = value; 28 OnModelChanged(); 29 } 19 private readonly XAxisDescriptor xAxisDescriptor = new XAxisDescriptor(); 20 21 public ChartDataRowsModel() { 22 this.XAxis.XAxisDescriptorChanged += delegate { OnModelChanged(); }; 30 23 } 31 24 32 public ILabelProvider XAxisLabelProvider { 33 get { return labelProvider; } 34 set{ 35 this.labelProvider = value; 36 OnModelChanged(); 37 } 25 public XAxisDescriptor XAxis { 26 get { return xAxisDescriptor; } 38 27 } 39 28 … … 52 41 53 42 private readonly List<IDataRow> rows = new List<IDataRow>(); 54 //private readonly List<string> xLabels = new List<string>();55 56 //public List<string> XLabels{57 // get { return xLabels; }58 //}59 43 60 44 public List<IDataRow> Rows{ … … 70 54 } 71 55 72 public string XAxisLabel {73 get { return xAxisLabel; }74 set {75 xAxisLabel = value;76 OnModelChanged();77 }78 }79 80 public bool ShowXAxisLabel {81 get { return showXAxisLabel; }82 set {83 showXAxisLabel = value;84 OnModelChanged();85 }86 }87 88 56 public override IView CreateView() { 89 57 return new LineChart(this); 90 58 } 91 92 //public void AddLabel(string label) {93 // xLabels.Add(label);94 // OnModelChanged();95 //}96 97 //public void AddLabel(string label, int index) {98 // xLabels[index] = label;99 // OnModelChanged();100 //}101 102 //public void AddLabels(string[] labels) {103 // foreach (var s in labels){104 // AddLabel(s);105 // }106 // //OnModelChanged();107 //}108 109 //public void AddLabels(string[] labels, int index) {110 // int i = 0;111 // foreach (var s in labels){112 // AddLabel(s, index + i);113 // i++;114 // }115 // //OnModelChanged();116 //}117 118 //public void ModifyLabel(string label, int index) {119 // xLabels[index] = label;120 // OnModelChanged();121 //}122 123 //public void ModifyLabels(string[] labels, int index) {124 // int i = 0;125 // foreach (var s in labels){126 // ModifyLabel(s, index + i);127 // i++;128 // }129 // //OnModelChanged();130 //}131 132 //public void RemoveLabel(int index) {133 // xLabels.RemoveAt(index);134 // OnModelChanged();135 //}136 137 //public void RemoveLabels(int index, int count) {138 // for (int i = index; i < index + count; i++ ){139 // RemoveLabel(i);140 // }141 // //OnModelChanged();142 //}143 59 144 60 private readonly YAxisDescriptor defaultYAxisDescriptor = new YAxisDescriptor(); … … 228 144 } 229 145 230 XmlNode labelProviderNode = document.ImportNode( labelProvider.GetLabelProviderXmlNode(), true);146 XmlNode labelProviderNode = document.ImportNode(XAxis.XAxisLabelProvider.GetLabelProviderXmlNode(), true); 231 147 node.AppendChild(labelProviderNode); 232 148 … … 239 155 foreach (XmlNode dataRow in node.ChildNodes) { 240 156 if (dataRow.Name.Equals("LabelProvider")) { 241 labelProvider = labelProvider.PopulateLabelProviderXmlNode(dataRow);157 XAxis.XAxisLabelProvider = XAxis.XAxisLabelProvider.PopulateLabelProviderXmlNode(dataRow); 242 158 } else { 243 159 XmlAttributeCollection attrs = dataRow.Attributes;
Note: See TracChangeset
for help on using the changeset viewer.