Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization.Test/LineChartTestForm.cs @ 1038

Last change on this file since 1038 was 1038, checked in by mstoeger, 15 years ago

Modified the XAxis labels so they are always visible at the bottom. (#433)
Added simple layout management to the line chart's root shape containing a title-, lines- and xaxis-area. (#345)

File size: 1002 bytes
RevLine 
[1038]1using System;
2using System.Windows.Forms;
[861]3using HeuristicLab.Core;
4
5namespace HeuristicLab.Visualization.Test {
6  public partial class LineChartTestForm : Form {
[1038]7    private readonly IView view;
[861]8    private ChartDataRowsModel model;
9
10    public LineChartTestForm() {
11      InitializeComponent();
[1038]12    }
[861]13
[1038]14    public LineChartTestForm(ChartDataRowsModel model) : this() {
15      this.model = model;
[985]16      view = model.CreateView();
[861]17
18      Control viewControl = (Control)view;
19      viewControl.Dock = DockStyle.Fill;
20
21      lineChartGroupBox.Controls.Add(viewControl);
22    }
23
[1038]24    private void btnResetView_Click(object sender, EventArgs e) {
25      if (view != null) {
26        LineChart lineChart = (LineChart)view;
27        lineChart.ResetView();
28      }
[861]29    }
[985]30
[1038]31    private void btnAddRandomValue_Click(object sender, EventArgs e) {
32      Random rand = new Random();
33
34      foreach (IDataRow row in model.Rows)
35        row.AddValue(rand.NextDouble()*100);
[985]36    }
[861]37  }
38}
Note: See TracBrowser for help on using the repository browser.