I think you need DateAsOrdinal (instead of Date) to give you better representations of the date (although maybe not if you are happy with it), and you need to set the IsX2Axis and IsY2Axis properties on the curve to true.
Here is an updated version of your code that shows what I mean - is that what you need? (this will not be a wavy line, as you drew, given the data values, and the x-axis scale starts from 0 not 100, as in your figure, but this is because in your code it is explicitly set to 0, so I assume that it that you want).
It will always add more data each time it is called (I assume you call it from your button1), and it will shift the minimum value for the axis, so that you only show the very last bit of data - if you do not set the Min value, you will see a shaky line as it shows all the data.
GraphPane myPane = zg1.GraphPane; myPane.XAxis.IsVisible = false; myPane.X2Axis.IsVisible = true; myPane.X2Axis.MajorGrid.IsVisible = true; myPane.X2Axis.Scale.Min = 0; myPane.X2Axis.Scale.Max = 600; myPane.YAxis.IsVisible = false; myPane.Y2Axis.IsVisible = true; myPane.Y2Axis.Scale.MajorUnit = DateUnit.Minute; myPane.Y2Axis.Scale.MinorUnit = DateUnit.Second; myPane.Y2Axis.Scale.Format = "HH:mm:ss"; myPane.Y2Axis.Type = AxisType.DateAsOrdinal; // As we get more data we want to add it on to the end of the curve // and we also want to get the scale so that we can shift it along double? oringinalLastDate; XDate firstDate; LineItem myCurve; if(myPane.CurveList.Count == 0) { myCurve = myPane.AddCurve("Alpha", new PointPairList(), Color.Red, SymbolType.None); firstDate = new XDate(DateTime.Now); oringinalLastDate = null; } else { myCurve = (LineItem)myPane.CurveList[0]; firstDate = myCurve.Points[myCurve.Points.Count - 1].Y; oringinalLastDate = myPane.Y2Axis.Scale.Max; } for (int i = 0; i < 36; i++) { double x = i * 5.0; firstDate.AddSeconds(i); myCurve.AddPoint(x, firstDate); listBox1.Items.Add("x = " + x + " y = " + firstDate); } myCurve.Symbol.Fill = new Fill(Color.White); myCurve.IsX2Axis = true; myCurve.IsY2Axis = true; myPane.Chart.Fill = new Fill(Color.White, Color.LightGray, 45.0f); zg1.IsShowPointValues = true; // Now make the minimum of the scale, the maximum that it was so // the graph shifts if (oringinalLastDate.HasValue) myPane.Y2Axis.Scale.Min = oringinalLastDate.Value; zg1.AxisChange(); zg1.Invalidate();
Update
If you want to update the chart once per second with a random number from 500 to 600, this should do it (after adding all three points, the scale on the y axis moves):
private int pointCount; private double? scaleMin = null; private static readonly Random rnd = new Random(); private void button1_Click(object sender, EventArgs e) { GraphPane myPane = zg1.GraphPane; myPane.XAxis.IsVisible = false; myPane.X2Axis.IsVisible = true; myPane.X2Axis.MajorGrid.IsVisible = true; myPane.X2Axis.Scale.Min = 0; myPane.X2Axis.Scale.Max = 600; myPane.YAxis.IsVisible = false; myPane.Y2Axis.IsVisible = true; myPane.Y2Axis.Scale.MajorUnit = DateUnit.Minute; myPane.Y2Axis.Scale.MinorUnit = DateUnit.Second; myPane.Y2Axis.Scale.Format = "HH:mm:ss"; myPane.Y2Axis.Type = AxisType.DateAsOrdinal; LineItem myCurve = myPane.AddCurve("Alpha", new PointPairList(), Color.Red, SymbolType.None); myCurve.Symbol.Fill = new Fill(Color.White); myCurve.IsX2Axis = true; myCurve.IsY2Axis = true; myPane.Chart.Fill = new Fill(Color.White, Color.LightGray, 45.0f); zg1.IsShowPointValues = true; pointCount = 0; var t = new System.Windows.Forms.Timer(); t.Interval = 1000; t.Tick += ShowData; Thread.Sleep(100); t.Start(); } private void ShowData(object sender, EventArgs e) { var t = (System.Windows.Forms.Timer) sender; t.Enabled = false; pointCount++; int x = rnd.Next(500, 600); var y = new XDate(DateTime.Now); GraphPane myPane = zg1.GraphPane; if (scaleMin == null) scaleMin = myPane.Y2Axis.Scale.Max; LineItem myCurve = (LineItem)myPane.CurveList[0]; myCurve.AddPoint(x, y);