我有一些从我的网络代码中导出的图表。我正在使用 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 (%)");
任何帮助将不胜感激。我在谷歌和这个网站上搜索了几个小时,但没有找到解决方案。该图正确显示,我只是无法获得辅助轴。
谢谢