This question is locked. New answers and comments are not allowed.
I am trying to plot a line series chart with a date time categorical x axis and a linear y axis. The issue is that the lines are connected prior to the date time categorical axis sorting them chronologically. What ends up is that the points are connected they were added, instead of chronological order.
Chart.Series.Add(lineSeries);
LineSeries lineSeries = new LineSeries(); Chart.VerticalAxis = new LinearAxis(); Chart.HorizontalAxis = new DateTimeCategoricalAxis() { PlotMode = AxisPlotMode.OnTicksPadded, DateTimeComponent = DateTimeComponent.Month, LabelFormat = "{0,0:MMM yy}" }; foreach (var data in FormattedData.Values) { foreach (var key in data) { CategoricalDataPoint point = new CategoricalDataPoint(); point.Value = string.IsNullOrEmpty(key.Value.Data) ? 0 : Convert.ToDouble(key.Value.Data); DateTime outDate; if (DateTime.TryParse(key.Key, out outDate)) point.Category = outDate; lineSeries.DataPoints.Add(point); }
}Chart.Series.Add(lineSeries);