2016-06-20 107 views
1

我有一個堆疊列報告,我需要顯示每個系列內的標籤值,這是可能的。這是我迄今爲止的代碼。它看起來像barcharts有這個選項,不知道如果我需要將報告轉換爲該類型。顯示數據標籤列堆疊epplus

  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; 

回答

0

,所以我只是被迫條形圖的格式和我有標籤選項

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