Setting Time Labels on RangeBar Chart
I have a RangeBar chart that will show different schedules and how they overlap. I can't seem to get AxisY (which is really AxisX, but they switch wh开发者_JAVA百科en you use a RangeBar for some reason) to display the hour. It displays a gridline for every hour, but the label is the date, which is not helpful at all.
I tried
asChart.ChartAreas["ChartArea1"].AxisY.CustomLabels.Add(0, DateTimeIntervalType.Hours, string.Format("{0:H}"));
but I get the error: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Can somebody point me in the right direction?
Okay. I'm dumb.
asChart.ChartAreas["ChartArea1"].AxisY.LabelStyle.Format = "{HH:mm}";
精彩评论