I have a simple test app which adds rows to table NmsSummaries with Date as Xval and a random number used for Y.
ChartControl is bound to this through EF5 to display a simple line chart.
I also have a Datagridview bound to the same source so I can see what is happening in real time.
The chart is updating as I add rows and I see the new Y value corresponding to the random value generated but the x value dates are all starting at Dec30 1899!
A similar test using datasets works properly adding points at current date
Any ideas what is wrong?
Code below
Public Class Form1
Dim context As IdirectLocalDbDAL.LocalDbEntities
Sub InitChart()
Dim model As New ChartDataBindModel(context.NmsSummaries.Local.ToBindingList)
Dim X = model.XIndex
model.XName = "TheDate"
model.YNames = New String() {"MaxCn"}
Dim series As New ChartSeries("Series")
series.Text = series.Name
series.SeriesIndexedModelImpl = model
series.Type = ChartSeriesType.Line
ChartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime
Me.ChartControl1.Series.Add(series)
End Sub