Last change
on this file since 1235 was
1038,
checked in by mstoeger, 16 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
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Windows.Forms;
|
---|
3 | using HeuristicLab.Core;
|
---|
4 |
|
---|
5 | namespace HeuristicLab.Visualization.Test {
|
---|
6 | public partial class LineChartTestForm : Form {
|
---|
7 | private readonly IView view;
|
---|
8 | private ChartDataRowsModel model;
|
---|
9 |
|
---|
10 | public LineChartTestForm() {
|
---|
11 | InitializeComponent();
|
---|
12 | }
|
---|
13 |
|
---|
14 | public LineChartTestForm(ChartDataRowsModel model) : this() {
|
---|
15 | this.model = model;
|
---|
16 | view = model.CreateView();
|
---|
17 |
|
---|
18 | Control viewControl = (Control)view;
|
---|
19 | viewControl.Dock = DockStyle.Fill;
|
---|
20 |
|
---|
21 | lineChartGroupBox.Controls.Add(viewControl);
|
---|
22 | }
|
---|
23 |
|
---|
24 | private void btnResetView_Click(object sender, EventArgs e) {
|
---|
25 | if (view != null) {
|
---|
26 | LineChart lineChart = (LineChart)view;
|
---|
27 | lineChart.ResetView();
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
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);
|
---|
36 | }
|
---|
37 | }
|
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.