我正在尝试从导出到 .xls 文件的一些数据中创建图表。我成功地创建了图表,但是我将在图表上有 3-7 条线。我添加了图例以使其更易于阅读,但是图例上没有文字。它只显示一个没有标签的线条。有没有办法给图例键加标签?
以下是我正在制作的图表的代码:
以下是我正在制作的图表的代码:
var lineChart = ws.Drawings.AddChart(item.TestHeader, eChartType.Line) as ExcelLineChart;
lineChart.SetSize(800, 400);
lineChart.Series.Add(Char.ConvertFromUtf32(65 + distanceCount + 1).ToString() + "1:" + Char.ConvertFromUtf32(65 + distanceCount + 1).ToString() + (testCount.ToString()), "A1:A" + (testCount.ToString()));
lineChart.Title.Text = item.TestHeader;
lineChart.DataLabel.ShowSeriesName = true;
lineChart.DataLabel.ShowLegendKey = true;
lineChart.DataLabel.ShowLeaderLines = true;
lineChart.XAxis.Title.Text = "Inches from Decoder";
lineChart.YAxis.Title.Text = "Milliseconds to decode";
lineChart.YAxis.MaxValue = 1000;
有所帮助总比没有好,谢谢!