title: MS Chart Control: Formatting Axis Labels
body: <p>I have questions about formatting the axis labels of the MS ASP.NET chart control.  Before I dive into my questions, please take a look at this screenshot.</p>
  
  <p><img src="https://i.stack.imgur.com/gDiSS.gif" alt="enter image description here"></p>
  
  <p>As you can see in the screenshot, the axis labels are hard to read and appear to be bolded.  Now, my questions are:</p>
  
  <ul>
  <li>Which default chart properties cause the axis labels to not look like Arial 11px regular, i.e. bolding and close characters?</li>
  <li>How can the appearance of the axis labels be easier to read and cleaned up, i.e. regular font weight and separation between characters?</li>
  </ul>
  
  <p>The responsible code is:</p>
  
  <pre><code>public Chart GetChart(ChartData chartDataData, IChartSettings settings)
  {
      var chart = new Chart
      {
          BackColor = Color.Transparent,
          Height = settings.Height,
          Palette = ChartColorPalette.None,
          PaletteCustomColors = settings.PaletterCustomColors.ToArray(),
          Width = settings.Width
      };
      if (settings.ShowLegend)
      {
          chart.Legends.Add("Legend").Alignment = StringAlignment.Center;
      }
      AddChartArea(chart);
  
      foreach (var seriesData in chartDataData.Series)
      {
          AddSeries(chart, seriesData, settings.ChartType);
      }
  
      chart.AlignDataPointsByAxisLabel();
      return chart;
  }
  
  private void AddChartArea(Chart chart)
  {
      var area = new ChartArea();
      area.AxisX.LabelStyle.Angle = -45;
      area.AxisX.MajorGrid.LineColor = Color.Transparent;
      chart.ChartAreas.Add(area);
      area.AxisX.LabelStyle.Font = area.AxisY.LabelStyle.Font = new Font("Arial", 11, GraphicsUnit.Pixel);
  }
  
  private void AddSeries(Chart chart, SeriesData data, SeriesChartType chartType)
  {
      var series = new Series
      {
          ChartType = chartType,
          Name = data.Name,
          ToolTip = data.Name,
          Url = data.Url
      };
  
      foreach (var pointData in data.Points)
      {
          AddPoint(series, pointData.XValue, pointData.YValue);
      }
      chart.Series.Add(series);
  }
  
  private void AddPoint(Series series, string xValue, float yValue)
  {
      var point = new DataPoint
      {
          AxisLabel = xValue
      };
      point.SetValueXY(xValue, yValue);
      series.Points.Add(point);
  }
  </code></pre>
  
  <p>where the code for the settings object is:</p>
  
  <pre><code>public static ChartSettings TaskSummary = new ChartSettings
  {
      ChartType = SeriesChartType.StackedColumn,
      Height = Unit.Pixel(300),
      Width = Unit.Pixel(450),
      PaletterCustomColors = new[]
      {
          Color.FromArgb(191, 214, 151),
          Color.FromArgb(249, 255, 149),
          Color.FromArgb(191, 79, 75),
          Color.Green
      },
      ShowLegend = true
  };
  </code></pre>
  
  <p>Thanks for the help.</p>