GR
Golda Rebecal
Syncfusion Team
October 6, 2007 11:10 AM UTC
Hi Zaw,
Sorry for the delay in responding.
You have to set y values in the order High, Low, Open and Close. Also you have to give proper datetime range for X axis in order to display the chart properly. I tested this issue by using the values given by you in the FinancialCharts demo sample and it worked fine.
Here is the modified code snippet I used to test this issue in FinancialCharts demo sample:
private void CreateDataSet()
{
........
..........
DataRow drEmpty = prodDs1.Tables[tableName].NewRow();
prodDs1.Tables[tableName].Rows.Add(drEmpty);
int count = Math.Max(0, prodDs1.Tables[tableName].Rows.Count - 1);
prodDs1.Tables[tableName].Rows[count]["Quantity"] = 2.037;
prodDs1.Tables[tableName].Rows[count]["Quantity1"] = 2.030;
prodDs1.Tables[tableName].Rows[count]["Quantity2"] = 2.035;
prodDs1.Tables[tableName].Rows[count]["Quantity3"] = 2.030;
prodDs1.Tables[tableName].Rows[count]["ExpiresDate"] = "2007-07-31 23:59";
}
protected void InitializeChartData()
{
ChartSeries series1 = this.chartControl1.Model.NewSeries(" Series 1",ChartSeriesType.Candle);
series1.Text = series1.Name;
ChartDataBindModel model = new ChartDataBindModel(this.prodDs1, "Products");
model.XName = "ExpiresDate";
model.YNames = new string[] { "Quantity", "Quantity1", "Quantity2", "Quantity3" };
series1.SeriesModelImpl = model;
this.chartControl1.Series.Add(series1);
this.chartControl1.Text="Stock Price Summary";
this.chartControl1.PrimaryYAxis.Title="Price $";
this.chartControl1.PrimaryXAxis.Title="Week Day";
this.chartControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
this.chartControl1.PrimaryYAxis.Range.Min = 2;
this.chartControl1.PrimaryYAxis.Range.Max = 2.1;
this.chartControl1.PrimaryYAxis.Range.Interval = 0.1;
this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
this.chartControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
//this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(lastTime.AddMonths(-1).AddDays(-21), lastTime.AddMonths(-1).AddDays(-19), 8, ChartDateTimeIntervalType.Hours);
this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(DateTime.Parse("2007-07-29 23:59"), DateTime.Parse("2007-08-1 23:59"), 8, ChartDateTimeIntervalType.Hours);
this.chartControl1.PrimaryXAxis.LabelIntersectAction = ChartLabelIntersectAction.Rotate;
this.chartControl1.PrimaryXAxis.DateTimeFormat = "dd/MM/yy hh";
}
Please try this and let me know if this helps you.
We appreciate your interest in Syncfusion products.
Bes regards,
Golda