Free cookie consent management tool by TermsFeed Policy Generator

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

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

Implemented multiple Y-Axes. A LineChart has several Y-Axes and each Y-Axis has several data rows. The same clipping area is set for all data rows belonging to a Y-Axis. (#433)

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