Changeset 980
- Timestamp:
- 12/12/08 07:15:24 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.Test/LineChartTests.cs
r869 r980 20 20 row2.Thickness = 4; 21 21 row3.Thickness = 5; 22 23 row1.Style = DrawingStyle.Solid; 24 row2.Style = DrawingStyle.Solid; 25 row3.Style = DrawingStyle.Dashed; 26 22 27 23 28 f.Model.AddDataRow(row1); -
trunk/sources/HeuristicLab.Visualization/LineChart.cs
r928 r980 69 69 70 70 for (int i = 1; i < row.Count; i++) { 71 LineShape lineShape = new LineShape(i - 1, row[i - 1], i, row[i], 0, row.Color, row.Thickness );71 LineShape lineShape = new LineShape(i - 1, row[i - 1], i, row[i], 0, row.Color, row.Thickness, row.Style); 72 72 lineShapes.Add(lineShape); 73 73 // TODO each DataRow needs its own WorldShape so Y Axes can be zoomed independently. … … 97 97 // new value was added 98 98 if (index > 0 && index == lineShapes.Count + 1) { 99 LineShape lineShape = new LineShape(index - 1, row[index - 1], index, row[index], 0, row.Color, row.Thickness );99 LineShape lineShape = new LineShape(index - 1, row[index - 1], index, row[index], 0, row.Color, row.Thickness, row.Style); 100 100 lineShapes.Add(lineShape); 101 101 // TODO each DataRow needs its own WorldShape so Y Axes can be zoomed independently. -
trunk/sources/HeuristicLab.Visualization/LineShape.cs
r870 r980 1 1 using System.Drawing; 2 using System.Drawing.Drawing2D; 2 3 3 4 namespace HeuristicLab.Visualization { … … 7 8 private Color color; 8 9 private int thickness; 10 private DashStyle dashStyle; 9 11 10 12 /// <summary> … … 16 18 /// <param name="y2">y coordinate of right lineEndPoind</param> 17 19 /// <param name="color">color for the LineShape</param> 18 public LineShape(double x1, double y1, double x2, double y2, double z, Color color, int thickness ) {20 public LineShape(double x1, double y1, double x2, double y2, double z, Color color, int thickness, DrawingStyle style) { 19 21 this.boundingBox = new RectangleD(x1, y1, x2, y2); 20 22 this.z = z; 21 23 this.color = color; 22 24 this.thickness = thickness; 25 if (style==DrawingStyle.Dashed) { 26 this.dashStyle = DashStyle.Dash; 27 } 28 else { 29 this.dashStyle = DashStyle.Solid; //default 30 } 23 31 } 24 32 … … 55 63 public void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) { 56 64 using (Pen pen = new Pen(color, thickness)){ 57 // TODO there seems to be a bug with drawing straight lines.65 pen.DashStyle = this.dashStyle; 58 66 Rectangle screenRect = Transform.ToScreen(boundingBox, viewport, clippingArea); 59 67 graphics.DrawLine(pen,screenRect.Left, screenRect.Bottom, screenRect.Right, screenRect.Top);
Note: See TracChangeset
for help on using the changeset viewer.