title: Setting excel chart minimumscale using C#
body: <p>I can't seem to figure out how to set the minimum scale of a excel chart using C#.</p>
  
  <p>The xaxis for the chart is loaded with values from columns "A", which are hr:min values {"08:32","08:33",...}.</p>
  
  <p>I want my axis labels to start at "09:00", and I figured that setting the minimumscale is the only way of doing this. </p>
  
  <p>Xaxis.MinimumScale seems to want a double value, but I want to tell it to start at 09:00. My attempt is below, but it fails when trying to set the string to the double value.</p>
  
  <p>Thanks</p>
  
  <pre><code>        Excel.Workbook oWB = (Excel.Workbook)oWS.Parent;
          Excel.Series oSeries;
          int length = numRows + 2;
          string colname;
          Excel.ChartObjects xlCharts;
          Excel.ChartObject myChart;
          Excel.Chart chartPage;
          Excel.SeriesCollection oSeriesCollection;
  
              ...
  
              xlCharts = (Excel.ChartObjects)oWS.ChartObjects(Type.Missing);
              myChart = (Excel.ChartObject)xlCharts.Add(10, 80, 300, 250);
              chartPage = myChart.Chart;
              oSeriesCollection = (Excel.SeriesCollection)chartPage.SeriesCollection();
  
              oSeries = oSeriesCollection.NewSeries();
              oSeries.Name = "Actual";
              oSeries.XValues = oWS.Range["A2:A" + length];
              oSeries.Values = oWS.Range["A2","A"+length];
  
              //Set the interval to 1 hour
              Excel.Axis Xaxis;
                //format the x-axis
              Xaxis = (Excel.Axis)chartPage.Axes(Excel.XlAxisType.xlCategory,
                            Excel.XlAxisGroup.xlPrimary);
              Xaxis.TickLabelSpacing = 60;
              Xaxis.TickLabels.Offset = 130;
              Xaxis.HasTitle = true;
              Xaxis.AxisTitle.Text = "Time of day";
              Xaxis.TickMarkSpacing = 60;
              Xaxis.MinorTickMark = Excel.XlTickMark.xlTickMarkNone;
  
              Excel.Range rg =(Excel.Range)oWS.Cells[28,1];
              object d = rg.Value2;
  
              Xaxis.MinimumScale = d;
  </code></pre>