Changeset 550
- Timestamp:
- 09/11/08 15:28:07 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Charting.Data/Datachart.cs
r2 r550 34 34 get { return myTitle; } 35 35 set { 36 if 36 if(myTitle != value) { 37 37 myTitle = value; 38 38 OnUpdate(); … … 55 55 Group.Add(group); 56 56 dataRowTypes.Add(dataRowType); 57 if 57 if(dataRowType == DataRowType.Lines) { 58 58 Group lines = new Group(this); 59 59 group.Add(lines); … … 71 71 Group group = (Group)Group.Primitives[dataRowIndex]; 72 72 73 switch 73 switch(dataRowType) { 74 74 case DataRowType.Lines: 75 75 Group lines = (Group)group.Primitives[1]; 76 76 Group points = (Group)group.Primitives[0]; 77 if 77 if(points.Primitives.Count > 0) { 78 78 FixedSizeRectangle lastRect = (FixedSizeRectangle)points.Primitives[0]; 79 79 Line line = new Line(this, lastRect.Point, point, group.Pen); … … 85 85 break; 86 86 case DataRowType.Bars: 87 if(group.Primitives.Count < 2) { 88 group.Add(new FixedSizeRectangle(this, point, new Size(0, 0), group.Pen, group.Brush)); 89 if(group.Primitives.Count == 2) { 90 PointD p = ((FixedSizeRectangle)group.Primitives[0]).Point; 91 PointD q = ((FixedSizeRectangle)group.Primitives[1]).Point; 92 double y0 = Math.Min(p.Y, q.Y); 93 double y1 = Math.Max(p.Y, q.Y); 94 double x0 = Math.Min(p.X, q.X); 95 double x1 = Math.Max(p.X, q.X); 96 Rectangle bar = new Rectangle(this, x0, y0, x1, y1, group.Pen, group.Brush); 97 bar.ToolTipText = "Height=" + (y1 - y0); 98 group.Add(bar); 99 } 100 } 87 101 break; 88 102 case DataRowType.Points: 89 FixedSizeRectangle p= new FixedSizeRectangle(this, point, new Size(5, 5), group.Pen, group.Brush);90 p.ToolTipText = "(" + point.X.ToString() + " ; " + point.Y.ToString() + ")";91 group.Add( p);103 FixedSizeRectangle r = new FixedSizeRectangle(this, point, new Size(5, 5), group.Pen, group.Brush); 104 r.ToolTipText = "(" + point.X.ToString() + " ; " + point.Y.ToString() + ")"; 105 group.Add(r); 92 106 break; 93 107 }
Note: See TracChangeset
for help on using the changeset viewer.