显示数据标签列堆叠epplus

时间:2016-06-20 16:47:43

标签: epplus

我有一个堆叠列报告,我需要在每个系列中显示标签值,这是可能的。这是我到目前为止的代码。它看起来像barcharts有这个选项,不知道我是否需要将报告转换为该类型。

         chart.Title.Text = "Total Pipeline - Initiative Count by Release";
         chart.Title.Font.Size = 8;
         chart.SetPosition(45, 0, 3, 0);
         chart.SetSize(400, 300);
         chart.Legend.Add();
         chart.YAxis.MajorUnit = 10;
         var series1 = chart.Series.Add(Chartsheet.Cells["L23:Q23"], Chartsheet.Cells["L22:Q22"]);
         series1.HeaderAddress = new ExcelAddress("'Graphs'!K23");
         var series2 = chart.Series.Add(Chartsheet.Cells["L24:Q24"], Chartsheet.Cells["L22:Q22"]);
         series2.HeaderAddress = new ExcelAddress("'Graphs'!K24");
         chart.Legend.Position = eLegendPosition.Bottom;
         chart.YAxis.LabelPosition = eTickLabelPosition.NextTo;
         chart.XAxis.MajorTickMark = eAxisTickMark.Out;
         chart.XAxis.MinorTickMark = eAxisTickMark.None;
         chart.ShowDataLabelsOverMaximum = true;

1 个答案:

答案 0 :(得分:0)

所以我强制使用条形图的格式,我有标签选项

    var chart = (OfficeOpenXml.Drawing.Chart.ExcelBarChart) Chartsheet.Drawings.AddChart("chart", eChartType.ColumnStacked);