TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Chinfot
- Newbie
- Posts: 9
- Joined: Wed Sep 02, 2015 12:00 am
Post
by Chinfot » Tue Sep 29, 2015 7:31 am
Code: Select all
public class NumberAxis
{
public DateTime X { get; set; }
public int Y { get; set; }
public int Z { get; set; }
}
private void Form1_Load(object sender, EventArgs e)
{
List<NumberAxis> stemp = new List<NumberAxis>();
for (int t = 0; t < 20; t++)
{
DateTime dt = DateTime.Parse("2015-02-14 12:02:06");
NumberAxis ss = new NumberAxis() { X = dt.AddDays(t), Y = t, Z = t };
stemp.Add(ss);
}
tChart1.Axes.Bottom.Labels.ExactDateTime = true;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
tChart1.Axes.Bottom.Labels.Angle = 90;
points3D1.DataSource = stemp;
points3D1.XValues.DataMember = "X";
points3D1.XValues.DataMember = "Y";
points3D1.ZValues.DataMember = "Z";
}
-
Attachments
-
- demo.jpg (64.3 KiB) Viewed 6789 times
-
Christopher
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Post
by Christopher » Tue Sep 29, 2015 9:16 am
The following code:
Code: Select all
public class NumberAxis
{
public DateTime X { get; set; }
public int Y { get; set; }
public int Z { get; set; }
}
Points3D points3D1;
private void InitializeChart()
{
points3D1 = new Points3D(tChart1.Chart);
List<NumberAxis> stemp = new List<NumberAxis>();
for (int t = 0; t < 20; t++)
{
DateTime dt = DateTime.Parse("2015-02-14 12:02:06");
NumberAxis ss = new NumberAxis() { X = dt.AddDays(t), Y = t, Z = t };
stemp.Add(ss);
}
tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.PointValue;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
tChart1.Axes.Bottom.Labels.Angle = 90;
points3D1.DataSource = stemp;
points3D1.XValues.DataMember = "X";
points3D1.YValues.DataMember = "Y";
points3D1.ZValues.DataMember = "Z";
}
gives me the following chart:
- chart_dates.PNG (27.88 KiB) Viewed 6783 times
-
Chinfot
- Newbie
- Posts: 9
- Joined: Wed Sep 02, 2015 12:00 am
Post
by Chinfot » Wed Sep 30, 2015 1:27 am
thank you!