I need have monthly report display by bar and line series on same chart.
The datasource return a datatable with 2 colums of YYYY-mm (monthly) and production loss for 12 months
I formate botom lable to
ch1.Axes.Bottom.Labels.DateTimeFormat = "MM/yyyy";
For bar chart if having
bar1.YValues.DataMember = dt.Columns["u_loss"].ToString();
bar1.LabelMember = dt.Columns["production_date"].ToString();
it will display format of MM/YYYY
but with line code of
fastLine1.XValues.DateTime = true;
int rowIndex = 0;
foreach (DataRow row in dt.Rows)
{
for (int colIndex = 1; colIndex < dt.Columns.Count; colIndex++)
{
fastLine1.Add(Convert.ToDateTime(row.ItemArray[0]), Convert.ToDouble(row[colIndex]));
}
}
rowIndex++;
The result will push bars all together, and line display not correctly either.
Bottom line, I would like to get help on display monthly data(1/2009, 120; 2/2009, 150, 3/2009, 162; ...) for line series
Date format issue with bar and line on same chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Date format issue with bar and line on same chart
Hi Beige,
Can you please arrange a simple example project we can run "as-is" to reproduce the problem here? You can create a simble run-time datasource as in the example here:
http://www.teechart.net/support/viewtopic.php?t=8206
Thanks in advance.
Can you please arrange a simple example project we can run "as-is" to reproduce the problem here? You can create a simble run-time datasource as in the example here:
http://www.teechart.net/support/viewtopic.php?t=8206
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Date format issue with bar and line on same chart
my problem is more on for Xvalue in month format "MM/YYYY", does it treat as date formate or string format. If treat like a date format, line will try to divid X evenly by 30 days, so it shows 6/2009, 7/2009, 7/2009, the second 7/2009 actually is for day 7/31/2009. If it treat as string, how the sorting will be?
Thanks,
Beige
Thanks,
Beige
Re: Date format issue with bar and line on same chart
I think i figure out