【发布时间】:2020-01-15 06:33:21
【问题描述】:
我需要将图的图例位置设置为左上角。但无法设置,因为 eLegendPosition 上不存在此类属性。
var myChart = myWorksheet.Drawings.AddChart("Chart2", eChartType.ColumnClustered) as ExcelBarChart;
**Adding an series to chart**
var serie2a = myChart.Series.Add(myWorksheet.Cells[2, 2, dataRow, 2], myWorksheet.Cells[2, 1, dataRow, 1]);
//serie2a.Header = myWorksheet.Cells[1, 2].Value.ToString();
serie2a.Header = "Plan";
myChart.YAxis.Title.Text = "Daily MH %";
myChart.YAxis.Title.Font.Size = 8;
chart2b.UseSecondaryAxis = true; //Flip the axes
chart5e.UseSecondaryAxis = true; //Flip the axes
chart2b.YAxis.Title.Text = "Cumul Daily MH %";
chart2b.YAxis.Title.Font.Size = 8;
**Here I am Facing an issue while setting it to TopLeft**
myChart.Legend.Position = eLegendPosition.Bottom;
myChart.Border.Fill.Color = System.Drawing.Color.Green;
myChart.Title.Text = "OVERALL S CURVE";
myChart.Title.Font.Size = 10;
myChart.SetSize(800, 400);
// Add to 7th row and to the 7th column
myChart.SetPosition(7, 0, 7, 0);
【问题讨论】:
-
能否提供代码?
标签: asp.net excel asp.net-core-mvc epplus