0

When the Microsoft chart control is zoomed in, the values of the labels and grid lines often looks like 38.2, 39.2, 40.2, 41.2 ... rather than 38,39,40,41. I tried to set the interval offset to correct this by using the code shown below without success.

myChart.ChartAreas[0].AxisX.MinorGrid.IntervalOffset = myChart.ChartAreas[0].AxisY.ScaleView.ViewMinimum % 1;
myChart.ChartAreas[0].AxisX.IntervalOffset = myChart.ChartAreas[0].AxisY.ScaleView.ViewMinimum % 1;

What is the proper way to get the major and minor grid-lines and labels to be drawn starting at a specific value?

DarwinIcesurfer
  • 1,073
  • 4
  • 25
  • 42

1 Answers1

1

Your problems might be caused by margins being added. Make sure you set

myChart.ChartArea[0].AxisX.IsMarginVisible = false;
zeFrenchy
  • 6,541
  • 1
  • 27
  • 36