I''m charting an extended gantt chart with multiple points on the x-axis that represent dates.
Let''s say for example, the range is 2 days.
So, I set the interval at 3, and hours, and I get a good number of x-labels.
When I zoom in, however, I want more labels, so I attach to the VisibleRangeChanged event, check if the zoomFactorX has changed, and if so, set a new DateTimeRange on the PrimaryXAxis, using a calculated interval of:
interval = 3 * chartControl1.ZoomFactorX;
then:
chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange (start, start.AddDays(2), interval, ChartDateTimeIntervalType.Hours);
This works great, until I start getting really zoomed in. When I get really in there, the chart grid lines become VERY close, making the chart almost black.
What does work perfectly, using this, is the actual number of Labels on the x-axis.
SO, the question is:
HOw can I make the number of vertical lines on the graph grid basically equal the number of label points when its zoomed in?
See Attached pictures.
zoom Graph Problem.zip