title: Use only custom label in X-axis in .NET chart
body: <p>I'm making a .NET line graph in C# with an X-axis interval of weeks. For my project, I only want to be using the custom label, but for now I still want the gridlines. Does anyone know a way to hide the default X-Axis labels while still keeping the custom labels?</p>
  
  <p>I tried this:</p>
  
  <pre><code>Chart4.ChartAreas[0].AxisX.LabelStyle.Enabled = false;
  </code></pre>
  
  <p>The obvious result is that there were no labels applied, which is not what I was trying to do.</p>
  
  <p><strong>EDIT:</strong> 
  The code for generating the original rows was this:</p>
  
  <pre><code>Chart4.ChartAreas["ChartArea1"].AxisX.LabelStyle.Format = "M";
  </code></pre>
  
  <p>And the code for the custom label was this:</p>
  
  <pre><code>int month = XValues[0].Month;
  var XAxis = Chart4.ChartAreas[0].AxisX;
  
  DateTime StartMonthPos = XValues[0];
  DateTime EndPos = new DateTime();
  
  foreach (DateTime Date in XValues)
  {
      EndPos = Date;
  
      if (Date.Month != month)
      {
          Chart4.ChartAreas[0].AxisX.CustomLabels.Add(StartMonthPos.ToOADate(), EndPos.ToOADate(), StartMonthPos.ToString("MMMM"), 1, LabelMarkStyle.None);
          StartMonthPos = Date;
      }
  
      month = Date.Month;
  }
  
  XAxis.CustomLabels.Add(StartMonthPos.ToOADate(), EndPos.ToOADate(), StartMonthPos.ToString("MMMM"), 1, LabelMarkStyle.None);
  </code></pre>
  
  <p>The chart looks like this: <img src="https://i.stack.imgur.com/ayWdG.png" alt="Chart with dates"></p>
  
  <p>And it should look like this: <img src="https://i.stack.imgur.com/qacpi.png" alt="chart without dates"></p>