public Candle_AxisLabels() { // This call is required by the Windows Form Designer. InitializeComponent(); Random r = new Random(); candleSeries1.Clear(); tChart1.Header.Text = "Axis Labels no Weekends"; tChart1.Header.Visible = true; TeeChart.Styles.StringList labels = new TeeChart.Styles.StringList(10); labels.Add("23/03/2009"); labels.Add("24/03/2009"); labels.Add("25/03/2009"); labels.Add("26/03/2009"); labels.Add("27/03/2009"); labels.Add("28/03/2009"); labels.Add("29/03/2009"); labels.Add("30/03/2009"); labels.Add("31/03/2009"); candleSeries1.XValues.DateTime = false; candleSeries1.GetHorizAxis.Labels.Angle = 90; double tmpOpen; double tmpClose; int count = 0; DateTime dt = new DateTime(2009, 03, 23); //DateTime.Parse("23/03/2009"); TimeSpan ts = TimeSpan.FromDays(1); for (int t = 0; t < 13; t++) { tmpOpen = r.Next(100); tmpClose = tmpOpen - r.Next(100); if (dt.DayOfWeek != DayOfWeek.Saturday & dt.DayOfWeek != DayOfWeek.Sunday) { ++count; candleSeries1.Add(count, tmpOpen, tmpOpen + r.Next(50), tmpClose - r.Next(50), tmpClose); } dt += ts; } candleSeries1.Labels = labels; }
public Candle_NoWeekends() { // This call is required by the Windows Form Designer. InitializeComponent(); Random r = new Random(); candleSeries1.Clear(); TeeChart.Styles.StringList labels = new TeeChart.Styles.StringList(10); labels.Add("07/02/2003"); labels.Add("10/02/2003"); labels.Add("11/02/2003"); labels.Add("12/02/2003"); labels.Add("13/02/2003"); labels.Add("14/02/2003"); labels.Add("17/02/2003"); labels.Add("18/02/2003"); labels.Add("19/02/2003"); candleSeries1.XValues.DateTime = false; candleSeries1.GetHorizAxis.Labels.Angle = 90; double tmpOpen = r.Next(1000); double tmpClose; int count = 0; DateTime dt = DateTime.Parse("07/02/2003"); TimeSpan ts = TimeSpan.FromDays(1); for (int t = 0; t < 13; t++) { tmpOpen += r.Next(100) - 50.0; tmpClose = tmpOpen - r.Next(100) + 50.0; if (dt.DayOfWeek != DayOfWeek.Saturday & dt.DayOfWeek != DayOfWeek.Sunday) { ++count; candleSeries1.Add(count, tmpOpen, tmpOpen + r.Next(10), tmpClose - r.Next(10), tmpClose); } dt += ts; } candleSeries1.Labels = labels; }