Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Defining CategoryDatetime axis in code behind
posted

Hello All,

In my first scenario, I had to build a chart with numeric Xaxis and numeric Yaxis (in the code behind). It worked like a charm when I defined it as:

series = new ScatterSeries();
series.ItemsSource = model.CDFResults[i].DataPoints;
series.MarkerType = MarkerType.Circle;
series.XMemberPath = "dt";
series.YMemberPath = "value";
series.XAxis = (NumericXAxis)NEWCHART.Axes.Where(x => x.Name == "thisisX").FirstOrDefault() as NumericXAxis;
series.YAxis = (NumericYAxis)NEWCHART.Axes.Where(x => x.Name == "thisisY").FirstOrDefault() as NumericYAxis;
series.ShowDefaultTooltip = true;

NEWCHART.Series.Add(series);

Now in the second case, the X axis needs to be datetime or Date. 

I couldn't find any option as series.CATEGORYDATETIME.. how do I define X axis as datetime type in the code behind? Please advice. Thanks!

Parents Reply Children
No Data