I have an ExcelBarChart
that I am creating using EPPlus.
I'm trying to change the position of the data label to Inside Base, but when I look inside the ExcelBarChart
object I see an ExcelChartDataLabel
property, and inside that a property named eLabelPosition
.
eLabelPosition
is protected however and inaccessible.
What is the proper way to set the data label position using EPPlus?
Please see the relevant code below:
var chart = (ExcelBarChart)chartWorksheet.Drawings.AddChart("changesVisualized", eChartType.ColumnClustered);
chart.SetSize(1000, 500);
chart.SetPosition(0,0);
chart.Title.Text = row.Name + "Volume " + date1.ToString("MM/dd/yyyy") + " - " + date2.ToString("MM/dd/yyyy");
chart.DataLabel.ShowValue = true;
var thisYearSeries = (ExcelChartSerie)(chart.Series.Add(worksheet.Cells["B4,D4,F4,H4,J4"], worksheet.Cells["B3,D3,F3,H3,J3"]));
thisYearSeries.Header = "This Year's Volume";
var lastYearSeries = (ExcelChartSerie)(chart.Series.Add(chartWorksheet.Cells["A1,B1,C1,D1,E1"], worksheet.Cells["B3,D3,F3,H3,J3"]));
lastYearSeries.Header = "Last Year's Volume";