我有一些从我的网络代码导出的图表。我正在使用Winnovative来创建excel输出。有没有办法创建一个辅助(第二)y轴,我找不到允许我这样做的任何类。这是我在C#中创建图表的代码,我需要它有2个y轴:
ExcelChart excelChart3 = worksheet.Charts.AddChart((ExcelChartType)39);
excelChart3.LeftColumnIndex = (1);
excelChart3.RightColumnIndex = (6);
excelChart3.TopRowIndex = (25);
excelChart3.BottomRowIndex = (40);
excelChart3.SeriesByRows = (true);
excelChart3.ShowDataTable = (false);
excelChart3.Title.Text = ("Job Growth/Units Ratio & Rent Growth");
excelChart3.Title.Font.Size = (10.0);
excelChart3.Title.Font.Color = (Color.DarkBlue);
excelChart3.Legend.Interior.FillType = ((ExcelShapeFillType)1);
excelChart3.Legend.Interior.SolidFillOptions.BackColor = (Color.WhiteSmoke);
excelChart3.Legend.Font.Size = (7.0);
excelChart3.Legend.Font.Bold = (true);
excelChart3.Legend.Position = 0;
excelChart3.CategoryAxis.CategoryAxisType = ((ExcelChartCategoryAxisType)1);
excelChart3.CategoryAxis.Font.Size = (8.0);
excelChart3.CategoryAxis.CategoryLabelsInterval = (3);
excelChart3.CategoryAxis.ShowMajorGridLines = (false);
excelChart3.CategoryAxis.CategoryLabelsPosition = ((ExcelChartAxisLabelPosition)1);
excelChart3.ValueAxis.Font.Size = (8.0);
excelChart3.ChartArea.Interior.FillType = ((ExcelShapeFillType)1);
excelChart3.ChartArea.Interior.SolidFillOptions.BackColor = (Color.White);
excelChart3.PlotArea.Interior.FillType = ((ExcelShapeFillType)1);
excelChart3.PlotArea.Interior.SolidFillOptions.BackColor = (Color.White);
ExcelChartSeries excelChartSeries3 = excelChart3.Series.AddSeries("Annual Job Growth/Units Ratio");
excelChartSeries3.ChartType = ((ExcelChartType)39);
excelChartSeries3.CategoryNamesRange = (worksheet["A59:A75"]);
excelChartSeries3.ValuesRange = (worksheet["D59:D75"]);
excelChartSeries3.Name = ("Annual Job Growth/Units Ratio");
ExcelChartSeries excelChartSeries4 = excelChart3.Series.AddSeries("Rental Growth");
excelChartSeries4.ChartType = ((ExcelChartType)39);
excelChartSeries4.CategoryNamesRange = (worksheet["A59:A75"]);
excelChartSeries4.ValuesRange = (worksheet["E59:E75"]);
excelChartSeries4.Name = ("Rent Growth (%)");
非常感谢任何帮助。我搜索谷歌和这个网站几个小时,并没有找到解决方案。图表显示正确,我无法获得辅助轴。
由于
答案 0 :(得分:0)
不可能有辅助y轴。您可以设置的轴是类别(X),值(Y)和深度(系列)。