.net 4.0 chart control custom grid line
Is it possible to customise how the grid lines appear. I have two charts one shows daily data - with Time as x axis. I would like grid-line to show on the hour or for example every 2 hours. In the second chart the x axis is across a date 开发者_如何转开发range so I would like grid-line to be for every day or for example every 5 days.
You can set the ChartArea's AxisX's IntervalType and Interval properties:
chart.ChartAreas[0].AxisX = new Axis() {
IntervalType = DateTimeIntervalType.Hours,
Interval = 2
};
chart.ChartAreas[0].AxisX = new Axis() {
IntervalType = DateTimeIntervalType.Days,
Interval = 5
};
精彩评论