what I expect is individual candlestick (from two series) should align next to each other (if they belong to same XCategory value). However, I could see they overlap on top of each other.
see attached (expected).
I am using following code:
private void FillSampleChartData()
{
XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection<Temporal>));
using (StreamReader wr = new StreamReader("TemporalDataNew.xml"))
{
TemporalData = xs.Deserialize(wr)
as ObservableCollection<Temporal>;
}
DataSeries cs = new DataSeries();
cs.Definition =
new CandleStickSeriesDefinition();
DataSeries ps = new DataSeries();
ps.Definition =
new CandleStickSeriesDefinition();
DataSeries ls = new DataSeries();
ls.Definition =
new LineSeriesDefinition();
CoMorbidityChartData = TemporalData.Where<
Temporal>(f => f.Id == "CoMorbidityChartDetail").ToList<Temporal>();
int count = 1;
foreach (TemporalItem ti in CoMorbidityChartData[0].TemporalItem)
{
DataPoint dpPopulation = new DataPoint();
dpPopulation.XCategory = ti.Id;
dpPopulation.Low =
Convert.ToDouble(ti.Readings[0].Low);
dpPopulation.High =
Convert.ToDouble(ti.Readings[0].High);
dpPopulation.Close =
Convert.ToDouble(ti.Readings[0].Close);
dpPopulation.Open =
Convert.ToDouble(ti.Readings[0].Open);
DataPoint dpLine = new DataPoint();
dpLine.YValue =
Convert.ToDouble(ti.Readings[0].Open);
ls.Add(dpLine);
cs.Add(dpPopulation);
count++;
}
foreach (TemporalItem ti in CoMorbidityChartData[0].TemporalItem)
{
DataPoint dpCriteria = new DataPoint();
dpCriteria.XCategory = ti.Id;
dpCriteria.Low =
Convert.ToDouble(ti.Readings[1].Low);
dpCriteria.High =
Convert.ToDouble(ti.Readings[1].High);
dpCriteria.Close =
Convert.ToDouble(ti.Readings[1].Close);
dpCriteria.Open =
Convert.ToDouble(ti.Readings[1].Open);
ps.Add(dpCriteria);
}
this.RadChart1.DefaultView.ChartArea.DataSeries.Add(cs);
this.RadChart1.DefaultView.ChartArea.DataSeries.Add(ps);
}