- Timestamp:
- 05/23/09 08:28:50 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.Test/3.2/LineChartTests.cs
r1818 r1876 130 130 }; 131 131 132 f.ShowDialog(); 133 } 134 135 [Test] 136 public void TestGridX() { 137 LineChartTestForm f = new LineChartTestForm(model); 138 IDataRow row1 = new DataRow(); 139 model.AddDataRow(row1); 140 141 model.ShowXAxisGrid = false; 142 143 Random rand = new Random(42); 144 for (int i = 0; i < 10; i++) { 145 row1.AddValue(rand.NextDouble() * 10); 146 } 132 147 f.ShowDialog(); 133 148 } -
trunk/sources/HeuristicLab.Visualization/3.2/ChartDataRowsModel.cs
r1530 r1876 17 17 private string xAxisLabel = ""; 18 18 private bool showXAxisLabel = true; 19 private bool showXAxisGrid = true; 19 20 private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##"); 20 21 21 22 private ViewSettings viewSettings = new ViewSettings(); 23 24 public bool ShowXAxisGrid { 25 get { return showXAxisGrid; } 26 set { 27 this.showXAxisGrid = value; 28 OnModelChanged(); 29 } 30 } 22 31 23 32 public ILabelProvider XAxisLabelProvider { -
trunk/sources/HeuristicLab.Visualization/3.2/HeuristicLab.Visualization-3.2.csproj
r1818 r1876 115 115 <Compile Include="LabelProvider\ContinuousLabelProvider.cs" /> 116 116 <Compile Include="LabelProvider\DiscreteLabelProvider.cs" /> 117 <Compile Include=" Grid.cs" />117 <Compile Include="YAxisGrid.cs" /> 118 118 <Compile Include="HorizontalLineShape.cs" /> 119 119 <Compile Include="LabelProvider\ILabelProvider.cs" /> … … 164 164 <Compile Include="WorldShape.cs" /> 165 165 <Compile Include="XAxis.cs" /> 166 <Compile Include="XAxisGrid.cs" /> 166 167 <Compile Include="YAxis.cs" /> 167 168 <Compile Include="YAxisDescriptor.cs" /> -
trunk/sources/HeuristicLab.Visualization/3.2/IChartDataRowsModel.cs
r1530 r1876 21 21 string XAxisLabel { get; set; } 22 22 bool ShowXAxisLabel { get; set; } 23 bool ShowXAxisGrid { get; set; } 23 24 24 25 event ModelChangedHandler ModelChanged; -
trunk/sources/HeuristicLab.Visualization/3.2/LineChart.cs
r1839 r1876 18 18 private readonly LegendShape legendShape = new LegendShape(); 19 19 private readonly XAxis xAxis = new XAxis(); 20 private readonly XAxisGrid xAxisGrid = new XAxisGrid(); 20 21 private readonly List<RowEntry> rowEntries = new List<RowEntry>(); 21 22 … … 87 88 88 89 titleShape.Text = model.Title; 90 91 if (model.ShowXAxisGrid) { 92 canvas.AddShape(xAxisGrid); 93 } 89 94 90 95 foreach (YAxisDescriptor yAxisDescriptor in model.YAxes) { … … 144 149 rowEntry.LinesShape.BoundingBox = linesAreaBoundingBox; 145 150 } 151 152 xAxisGrid.BoundingBox = linesAreaBoundingBox; 146 153 147 154 foreach (YAxisDescriptor yAxisDescriptor in model.YAxes) { … … 348 355 349 356 private void SetClipX(double x1, double x2) { 357 xAxisGrid.ClippingArea = new RectangleD(x1, 358 xAxisGrid.ClippingArea.Y1, 359 x2, 360 xAxisGrid.ClippingArea.Y2); 361 350 362 xAxis.ClippingArea = new RectangleD(x1, 351 363 0, … … 374 386 375 387 private void SetClipY(RowEntry rowEntry, double y1, double y2) { 388 xAxisGrid.ClippingArea = new RectangleD(xAxisGrid.ClippingArea.X1, 389 y1, 390 xAxisGrid.ClippingArea.X2, 391 y2); 392 376 393 rowEntry.LinesShape.ClippingArea = new RectangleD(rowEntry.LinesShape.ClippingArea.X1, 377 394 y1, … … 469 486 470 487 private void OnModelChanged() { 488 UpdateLayout(); 471 489 canvasUI.Invalidate(); 472 490 } … … 671 689 672 690 private class YAxisInfo { 673 private readonly Grid grid = newGrid();691 private readonly YAxisGrid grid = new YAxisGrid(); 674 692 private readonly YAxis yAxis = new YAxis(); 675 693 676 public Grid Grid {694 public YAxisGrid Grid { 677 695 get { return grid; } 678 696 } -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.Designer.cs
r1839 r1876 53 53 this.flpShowYAxis = new System.Windows.Forms.FlowLayoutPanel(); 54 54 this.fdFont = new System.Windows.Forms.FontDialog(); 55 this.chkShowXAxisGrid = new System.Windows.Forms.CheckBox(); 55 56 this.Optionstabs.SuspendLayout(); 56 57 this.tabPage1.SuspendLayout(); … … 286 287 // tpXAxis 287 288 // 289 this.tpXAxis.Controls.Add(this.chkShowXAxisGrid); 288 290 this.tpXAxis.Controls.Add(this.btnChangeXAxisFont); 289 291 this.tpXAxis.Location = new System.Drawing.Point(4, 22); … … 357 359 this.flpShowYAxis.Size = new System.Drawing.Size(275, 57); 358 360 this.flpShowYAxis.TabIndex = 0; 361 // 362 // chkShowXAxisGrid 363 // 364 this.chkShowXAxisGrid.AutoSize = true; 365 this.chkShowXAxisGrid.Location = new System.Drawing.Point(3, 32); 366 this.chkShowXAxisGrid.Name = "chkShowXAxisGrid"; 367 this.chkShowXAxisGrid.Size = new System.Drawing.Size(107, 17); 368 this.chkShowXAxisGrid.TabIndex = 3; 369 this.chkShowXAxisGrid.Text = "Show X-Axis Grid"; 370 this.chkShowXAxisGrid.UseVisualStyleBackColor = true; 371 this.chkShowXAxisGrid.CheckedChanged += new System.EventHandler(this.chkShowXAxisGrid_CheckedChanged); 359 372 // 360 373 // Options … … 376 389 this.tpTitle.PerformLayout(); 377 390 this.tpXAxis.ResumeLayout(false); 391 this.tpXAxis.PerformLayout(); 378 392 this.tpYAxes.ResumeLayout(false); 379 393 this.tpYAxes.PerformLayout(); … … 415 429 private System.Windows.Forms.FlowLayoutPanel flpShowYAxis; 416 430 private System.Windows.Forms.FontDialog fdFont; 431 private System.Windows.Forms.CheckBox chkShowXAxisGrid; 417 432 private System.Windows.Forms.TextBox tbxTitle; 418 433 private System.Windows.Forms.Label label5; -
trunk/sources/HeuristicLab.Visualization/3.2/Options/Options.cs
r1839 r1876 13 13 private string oldTitle; 14 14 private Dictionary<CheckBox, bool> ShowYAxisBoxes; 15 private bool oldShowXAxisGrid; 15 16 private Dictionary<CheckBox, bool> yAxisClipChangeableBoxes; 16 17 … … 65 66 66 67 public void ResetSettings() { 68 model.ShowXAxisGrid = oldShowXAxisGrid; 69 67 70 foreach (var param in oldLineParams) { 68 71 param.applySettings(); … … 150 153 151 154 private void Options_Load(object sender, EventArgs e) { 155 oldShowXAxisGrid = model.ShowXAxisGrid; 156 chkShowXAxisGrid.Checked = model.ShowXAxisGrid; 157 152 158 InitTabPageLines(); 153 159 InitTabPageYAxes(); … … 238 244 } 239 245 246 private void chkShowXAxisGrid_CheckedChanged(object sender, EventArgs e) { 247 model.ShowXAxisGrid = chkShowXAxisGrid.Checked; 248 } 249 240 250 private void tbxTitle_TextChanged(object sender, EventArgs e) { 241 251 model.Title = tbxTitle.Text; -
trunk/sources/HeuristicLab.Visualization/3.2/YAxisGrid.cs
r1838 r1876 2 2 3 3 namespace HeuristicLab.Visualization { 4 public class Grid : WorldShape {4 public class YAxisGrid : WorldShape { 5 5 private Color color = Color.LightBlue; 6 6 … … 14 14 LineShape line = new LineShape(ClippingArea.X1, y, 15 15 ClippingArea.X2, y, 16 color, 1,17 DrawingStyle.Dashed);18 AddShape(line);19 }20 21 foreach (double x in AxisTicks.GetTicks(XAxis.PixelsPerInterval,22 Parent.Viewport.Width,23 ClippingArea.Width,24 ClippingArea.X1)) {25 LineShape line = new LineShape(x, ClippingArea.Y1,26 x, ClippingArea.Y2,27 16 color, 1, 28 17 DrawingStyle.Dashed);
Note: See TracChangeset
for help on using the changeset viewer.