1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33:
| var s = new Series("ID"); s.ChartType = SeriesChartType.Column; DateTime time = new DateTime(2014, 1, 17, 09, 30, 48, 923); s.Points.AddXY(time.ToOADate(), 1); DateTime time11 = new DateTime(2014, 1, 17, 09, 30, 49, 115); s.Points.AddXY(time.ToOADate(), 1); DateTime time2 = new DateTime(2014, 1, 17, 09, 30, 49, 317); s.Points.AddXY(time2.ToOADate(), 1); DateTime time3 = new DateTime(2014, 1, 17, 09, 30, 49, 519); s.Points.AddXY(time3.ToOADate(), 1); DateTime time4 = new DateTime(2014, 1, 17, 09, 30, 49, 744); s.Points.AddXY(time4.ToOADate(), 1);
chart1.Series.Clear(); chart1.Series.Add(s); chart1.Series[0].XValueType = ChartValueType.DateTime; chart1.ChartAreas[0].AxisX.Interval = 1; chart1.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Auto; chart1.ChartAreas[0].AxisX.LabelStyle.Format = "dd:MM:yyyy HH:mm:ss:fff "; chart1.Series[0].XValueType = ChartValueType.DateTime; chart1.ChartAreas[0].AxisX.Minimum = time.ToOADate(); chart1.ChartAreas[0].AxisX.Maximum = time4.ToOADate(); chart1.Series[0].BorderWidth = 3; chart1.Series[0].ShadowOffset = 5; chart1.Series[0]["PixelPointWidth"] = "13"; |