我使用Interop excel 12.0創建圖表。如何在Excel中使用C#.net設置Yaxis最小比例尺
我分配給yaxis的數據範圍從7/5/2010開始到2011年8月29日。但Y於圖表軸從2010年7月12日開始,但是在圖表線生長示出了從開始DATAS結束
myChart.Chart.ChartWizard(xlWorkSheet.get_Range("A1", "B62"),misValue, misValue, misValue,misValue, Excel.XlRowCol.xlColumns, false,
"Space Used Trend Report for databases DLP01P, DLP07P, DPN01P and DUV01P", "Date", "GB", misValue);
Font f = new System.Drawing.Font(FontFamily.GenericSansSerif, 10.0f);
myChart.Chart.ChartTitle.Characters.Font.Size = f.Size;
chartPage.HasTitle = true;
//Trend Line setting
//Creating a series
Excel.Series series = (Excel.Series)chartPage.SeriesCollection(1);
//Setting the series to Secondary (y) axis so as to format the same
series.AxisGroup = Excel.XlAxisGroup.xlSecondary;
//Setting the trendline type
Excel.Trendlines trendlines = (Excel.Trendlines)series.Trendlines(System.Type.Missing);
Excel.Trendline trendline = trendlines.Add(Microsoft.Office.Interop.Excel.XlTrendlineType.xlLinear, 2,
0, misValue, misValue, misValue, false, false, misValue);
//Creating a variable for yaxis and assigning the chart's y axis to the same
Excel.Axis yaxis = (Excel.Axis)chartPage.Axes(Excel.XlAxisType.xlCategory, series.AxisGroup);
yaxis.MajorUnit = 14;
yaxis.MinorUnit = 7;
yaxis.Format.Line.BackColor.RGB = Color.Red.ToArgb();
yaxis.Format.Line.ForeColor.RGB = Color.Red.ToArgb();
yaxis.MajorUnitScale = Excel.XlTimeUnit.xlDays;
yaxis.MinorUnitScale = Excel.XlTimeUnit.xlDays;
yaxis.MinimumScaleIsAuto = false;
yaxis.MinimumScale = ?????
最小刻度是隻取雙值在2011年8月22日結束。