Changeset 1457 for trunk/sources
- Timestamp:
- 03/27/09 17:34:56 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.Test/LineChartTests.cs
r1390 r1457 84 84 yaxis1.Label = "Y-Axis 1"; 85 85 yaxis2.Label = "Y-Axis 2"; 86 87 yaxis1.Position = AxisPosition.Left; 88 yaxis2.Position = AxisPosition.Right; 86 89 87 90 row1.Color = Color.Red; … … 500 503 } 501 504 502 503 504 505 [Test] 505 506 public void TestMainForm() { -
trunk/sources/HeuristicLab.Visualization/HeuristicLab.Visualization.csproj
r1350 r1457 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <ProductVersion>9.0. 21022</ProductVersion>6 <ProductVersion>9.0.30729</ProductVersion> 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{E392A1E2-DC95-4E33-B82E-8ED690EDA1AB}</ProjectGuid> … … 70 70 <Compile Include="AvgAggregator.cs" /> 71 71 <Compile Include="AvgLineAggregator.cs" /> 72 <Compile Include="AxisPosition.cs" /> 72 73 <Compile Include="AxisTicks.cs" /> 73 74 <Compile Include="Canvas.cs" /> -
trunk/sources/HeuristicLab.Visualization/LineChart.cs
r1390 r1457 6 6 using HeuristicLab.Visualization.Legend; 7 7 using HeuristicLab.Visualization.Options; 8 using HeuristicLab.Visualization.Test; 8 9 9 10 namespace HeuristicLab.Visualization { … … 93 94 canvas.AddShape(xAxis); 94 95 95 int yAxesWidth = 0; 96 int yAxesWidthLeft = 0; 97 int yAxesWidthRight = 0; 96 98 97 99 foreach (YAxisDescriptor yAxisDescriptor in model.YAxes) { … … 99 101 if (yAxisDescriptor.ShowYAxis) { 100 102 canvas.AddShape(info.YAxis); 101 yAxesWidth += YAxisWidth; 103 info.YAxis.Position = yAxisDescriptor.Position; 104 switch (yAxisDescriptor.Position) { 105 case AxisPosition.Left: 106 yAxesWidthLeft += YAxisWidth; 107 break; 108 case AxisPosition.Right: 109 yAxesWidthRight += YAxisWidth; 110 break; 111 default: 112 throw new NotImplementedException(); 113 } 102 114 } 103 115 } … … 111 123 titleShape.Y = canvasUI.Height - 10; 112 124 113 RectangleD linesAreaBoundingBox = new RectangleD(yAxesWidth ,125 RectangleD linesAreaBoundingBox = new RectangleD(yAxesWidthLeft, 114 126 XAxisHeight, 115 canvasUI.Width ,127 canvasUI.Width - yAxesWidthRight, 116 128 canvasUI.Height); 117 129 … … 126 138 127 139 int yAxisLeft = 0; 140 int yAxisRight = (int)linesAreaBoundingBox.X2; 141 128 142 foreach (YAxisDescriptor yAxisDescriptor in model.YAxes) { 129 143 YAxisInfo info = GetYAxisInfo(yAxisDescriptor); 130 144 if (yAxisDescriptor.ShowYAxis) { 131 info.YAxis.BoundingBox = new RectangleD(yAxisLeft, 132 linesAreaBoundingBox.Y1, 133 yAxisLeft + YAxisWidth, 134 linesAreaBoundingBox.Y2); 135 yAxisLeft += YAxisWidth; 145 switch (yAxisDescriptor.Position) { 146 case AxisPosition.Left: 147 info.YAxis.BoundingBox = new RectangleD(yAxisLeft, 148 linesAreaBoundingBox.Y1, 149 yAxisLeft + YAxisWidth, 150 linesAreaBoundingBox.Y2); 151 yAxisLeft += YAxisWidth; 152 break; 153 case AxisPosition.Right: 154 info.YAxis.BoundingBox = new RectangleD(yAxisRight, 155 linesAreaBoundingBox.Y1, 156 yAxisRight + YAxisWidth, 157 linesAreaBoundingBox.Y2); 158 yAxisRight += YAxisWidth; 159 break; 160 default: 161 throw new NotImplementedException(); 162 } 136 163 } 137 164 } -
trunk/sources/HeuristicLab.Visualization/YAxis.cs
r1343 r1457 1 using System; 1 2 using System.Drawing; 2 3 using HeuristicLab.Visualization.LabelProvider; 4 using HeuristicLab.Visualization.Test; 3 5 4 6 namespace HeuristicLab.Visualization { … … 7 9 8 10 private ILabelProvider labelProvider = new ContinuousLabelProvider("e4"); 11 private AxisPosition position = AxisPosition.Left; 9 12 10 13 public ILabelProvider LabelProvider { 11 14 get { return labelProvider; } 12 15 set { labelProvider = value; } 16 } 17 18 public AxisPosition Position { 19 get { return position; } 20 set { position = value; } 13 21 } 14 22 … … 19 27 ClippingArea.Height, 20 28 ClippingArea.Y1)) { 21 TextShape label = new TextShape(ClippingArea.X2 - 3, y, 22 labelProvider.GetLabel(y)); 23 label.AnchorPositionX = AnchorPositionX.Right; 29 double x; 30 AnchorPositionX anchorPositionX; 31 32 switch (position) { 33 case AxisPosition.Left: 34 x = ClippingArea.X2 - 3; 35 anchorPositionX = AnchorPositionX.Right; 36 break; 37 case AxisPosition.Right: 38 x = ClippingArea.X1 + 3; 39 anchorPositionX = AnchorPositionX.Left; 40 break; 41 default: 42 throw new NotImplementedException(); 43 } 44 45 TextShape label = new TextShape(x, y, labelProvider.GetLabel(y)); 46 label.AnchorPositionX = anchorPositionX; 24 47 label.AnchorPositionY = AnchorPositionY.Middle; 25 48 AddShape(label); -
trunk/sources/HeuristicLab.Visualization/YAxisDescriptor.cs
r1390 r1457 2 2 using System.Collections.Generic; 3 3 using HeuristicLab.Visualization.LabelProvider; 4 using HeuristicLab.Visualization.Test; 4 5 5 6 namespace HeuristicLab.Visualization { … … 12 13 private string label = ""; 13 14 public bool ClipChangeable = true; 15 private AxisPosition position = AxisPosition.Left; 14 16 15 17 public event YAxisDescriptorChangedHandler YAxisDescriptorChanged; … … 78 80 } 79 81 82 public AxisPosition Position { 83 get { return position; } 84 set { position = value; } 85 } 86 80 87 public void AddDataRow(IDataRow row) { 81 88 if (row.YAxis != null) {
Note: See TracChangeset
for help on using the changeset viewer.