DateTime on x axis of colorgrid
Posted: Tue Jan 06, 2009 8:29 pm
I have a requirement for a colorgrid with DataTime on the x axis. What's the best way for this to be done?
Steema Software - Customer Support Forums
http://216.92.101.67/support/
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Axes.Bottom.Labels.Angle = 90;
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.XValues.DateTime = true;
Random y = new Random();
for (int x = 0; x < 10; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid1.Add(DateTime.Now.AddDays(x).ToOADate(), y.Next(), z);
}
}
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Axes.Bottom.Labels.Angle = 90;
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.XValues.DateTime = true;
List<DateTime> DateTimeList = new List<DateTime>();
List<double> Y = new List<double>();
List<double> Z = new List<double>();
DateTime currentDate = DateTime.Today;
for (int day = 0; day < 60; day++)
{
DateTimeList.Add(currentDate);
Y.Add((double)day);
Z.Add((double)day);
currentDate.AddDays(1);
}
for (int displayPoint = 0; displayPoint < 60; displayPoint++)
{
colorGrid1.Add(DateTimeList[displayPoint],Y[displayPoint],Z[displayPoint]);
}
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Axes.Bottom.Labels.Angle = 90;
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.XValues.DateTime = true;
colorGrid1.IrregularGrid = true;
List<DateTime> DateTimeList = new List<DateTime>();
List<double> Y = new List<double>();
List<double> Z = new List<double>();
DateTime currentDate = DateTime.Today;
for (int day = 0; day < 60; day++)
{
DateTimeList.Add(currentDate);
Y.Add((double)day);
Z.Add((double)day);
currentDate.AddDays(1);
}
for (int displayPoint = 0; displayPoint < DateTimeList.Count; displayPoint++)
{
colorGrid1.Add(DateTimeList[displayPoint].ToOADate(), Y[displayPoint], Z[displayPoint]);
}
}