Hi,
I've got a chart which currently compares line series from different years, therefore the x-axis goes from 0 to 365. I would like it to have dd-MM format instead. How could I do this?
Thanks.
X Axis Showing dd-MM only
Hi Dave
You can do it as below line:
You can do it as below line:
Code: Select all
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd-MM";
Hi Edu,
This will not work because, like I said earlier, my current x-axis values are integer from 0 to 365.
My series is filled by the following code:
Instead of showing daysDifference on the x-axis, I would like to show a DateTime x-axis with a format of "dd-MM". How could I do it?
This will not work because, like I said earlier, my current x-axis values are integer from 0 to 365.
My series is filled by the following code:
Code: Select all
DateTime startYear = new DateTime(2007, 01, 01);
for (int i = 0; i<dRow.Length; i++)
{
DateTime currentDate = Convert.ToDateTime(dRow[i]["date"].ToString())
TimeSpan ts = currentDate.Subtract(startYear)
int daysDifference = ts.Days;
lineSeries.Add(daysDifference, Single.Parse(dRow[i]["values"].ToString()))
}