title: ASP.NET Chart: setting the fonts on X and Y axis
body: <p>Consider an ASP.NET MVC controller method that builds an ASP.NET Chart image. </p>
  
  <pre><code>public FileStreamResult MakeImg(IEnumerable&lt;MyObj&gt; stats)
      {
          Chart barchart = BarChart(400, 300);
  
          Series series1 = new Series("Series1");
          series1.ChartArea = "ca1";            
          series1.ChartType = SeriesChartType.Column;
          series1.IsValueShownAsLabel = true;    
          series1.Font = new Font("Verdana", 9f, FontStyle.Regular);
  
          barchart.Series.Add(series1);            
  
          // Set chart data source
          barchart.DataSource = stats;
  
          // Set series members names for the X and Y values
          barchart.Series["Series1"].XValueMember = "FriendlyDate";
          barchart.Series["Series1"].YValueMembers = "NumRecords";
  
          // Data bind to the selected data source
          barchart.DataBind();
  
           MemoryStream ms = new MemoryStream();
           barchart.SaveImage(ms, ChartImageFormat.Png);
           ms.Seek(0, SeekOrigin.Begin);
  
           return new FileStreamResult(ms, "image/png");
      }
  </code></pre>
  
  <p>The image is rendered in an unattractive manner:</p>
  
  <p><a href="http://www.imagechicken.com/uploads/1253830647005451400.png">fugly http://www.imagechicken.com/uploads/1253830647005451400.png</a></p>
  
  <p><strong>Question</strong>: How can I set the font programmatically for the:</p>
  
  <ul>
  <li>X and Y axis labels - i.e. 0 through 35 on Y, and the dates on X</li>
  <li>data - i.e. 12, 0, 0, 3, 6 ?</li>
  </ul>