Last change
on this file since 1002 was
983,
checked in by mstoeger, 16 years ago
|
Added XAxis shape to project (#433)
Some small refactorings in LineChart (#345)
|
File size:
1.8 KB
|
Rev | Line | |
---|
[983] | 1 | using System;
|
---|
[869] | 2 | using System.Drawing;
|
---|
[861] | 3 | using NUnit.Framework;
|
---|
| 4 |
|
---|
| 5 | namespace HeuristicLab.Visualization.Test {
|
---|
| 6 | [TestFixture]
|
---|
| 7 | public class LineChartTests {
|
---|
| 8 | [Test]
|
---|
| 9 | public void TestLineChart() {
|
---|
| 10 | LineChartTestForm f = new LineChartTestForm();
|
---|
| 11 |
|
---|
[869] | 12 | IDataRow row1 = new DataRow();
|
---|
| 13 | IDataRow row2 = new DataRow();
|
---|
| 14 | IDataRow row3 = new DataRow();
|
---|
[861] | 15 |
|
---|
[869] | 16 | row1.Color = Color.Red;
|
---|
| 17 | row2.Color = Color.Green;
|
---|
| 18 | row3.Color = Color.Blue;
|
---|
[861] | 19 |
|
---|
[869] | 20 | row1.Thickness = 3;
|
---|
| 21 | row2.Thickness = 4;
|
---|
| 22 | row3.Thickness = 5;
|
---|
| 23 |
|
---|
[980] | 24 | row1.Style = DrawingStyle.Solid;
|
---|
| 25 | row2.Style = DrawingStyle.Solid;
|
---|
| 26 | row3.Style = DrawingStyle.Dashed;
|
---|
| 27 |
|
---|
| 28 |
|
---|
[869] | 29 | f.Model.AddDataRow(row1);
|
---|
| 30 | f.Model.AddDataRow(row2);
|
---|
| 31 | f.Model.AddDataRow(row3);
|
---|
| 32 |
|
---|
| 33 | row1.AddValue(10);
|
---|
| 34 | row1.AddValue(5);
|
---|
| 35 | row1.AddValue(7);
|
---|
| 36 | row1.AddValue(3);
|
---|
| 37 | row1.AddValue(10);
|
---|
| 38 | row1.AddValue(2);
|
---|
| 39 |
|
---|
| 40 | row2.AddValue(5);
|
---|
| 41 | row2.AddValue(6);
|
---|
| 42 | row2.AddValue(5);
|
---|
| 43 |
|
---|
| 44 | row3.AddValue(2);
|
---|
| 45 | row3.AddValue(2);
|
---|
| 46 | row3.AddValue(2);
|
---|
| 47 | row3.AddValue(2);
|
---|
| 48 | row3.AddValue(2);
|
---|
| 49 |
|
---|
[983] | 50 | Random rand = new Random();
|
---|
| 51 |
|
---|
| 52 | for (int i = 0; i < 1000; i++) {
|
---|
| 53 | row1.AddValue(rand.NextDouble()*10);
|
---|
| 54 | row2.AddValue(rand.NextDouble()*10);
|
---|
| 55 | row3.AddValue(rand.NextDouble()*10);
|
---|
| 56 | }
|
---|
| 57 |
|
---|
[861] | 58 | f.ShowDialog();
|
---|
| 59 | }
|
---|
[983] | 60 |
|
---|
| 61 | [Test]
|
---|
| 62 | public void TestAxes() {
|
---|
| 63 | LineChartTestForm f = new LineChartTestForm();
|
---|
| 64 |
|
---|
| 65 | IDataRow row1 = new DataRow();
|
---|
| 66 |
|
---|
| 67 | row1.Color = Color.Red;
|
---|
| 68 | row1.Thickness = 3;
|
---|
| 69 | row1.Style = DrawingStyle.Solid;
|
---|
| 70 |
|
---|
| 71 | f.Model.AddDataRow(row1);
|
---|
| 72 |
|
---|
| 73 | row1.AddValue(10);
|
---|
| 74 | row1.AddValue(5);
|
---|
| 75 | row1.AddValue(7);
|
---|
| 76 | row1.AddValue(3);
|
---|
| 77 | row1.AddValue(10);
|
---|
| 78 | row1.AddValue(2);
|
---|
| 79 |
|
---|
| 80 | f.ShowDialog();
|
---|
| 81 | }
|
---|
[861] | 82 | }
|
---|
| 83 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.