epplus线图改变平滑线VB

时间:2014-04-28 15:38:46

标签: asp.net vb.net excel epplus linegraph

我正在使用epplus创建一个默认为平滑线的折线图。我想关闭平滑线,使其成为点到点的直线。我正在使用VB但找不到我需要更改的属性。

Private Sub FillPostChart(objWorksheetChartPost As ExcelWorksheet, iRow2013 As Integer, iRowEnd As Integer, sChartTitle As String)
    Dim chtPost = objWorksheetChartPost.Drawings.AddChart("PostLineChart", 65)

    chtPost.Series.Add(ExcelRange.GetFullAddress("Data", "B" & iRow2013.ToString & ":B" & iRowEnd.ToString), ExcelRange.GetFullAddress("Data", "A" & iRow2013.ToString & ":A" & iRowEnd.ToString)).Header = "a"
    chtPost.Series.Add(ExcelRange.GetFullAddress("Data", "D" & iRow2013.ToString & ":D" & iRowEnd.ToString), ExcelRange.GetFullAddress("Data", "A" & iRow2013.ToString & ":A" & iRowEnd.ToString)).Header = "b"
    chtPost.Series.Add(ExcelRange.GetFullAddress("Data", "G" & iRow2013.ToString & ":G" & iRowEnd.ToString), ExcelRange.GetFullAddress("Data", "A" & iRow2013.ToString & ":A" & iRowEnd.ToString)).Header = "c"

    chtPost.Title.Text = sChartTitle
    chtPost.SetSize(1200, 800)
    chtPost.DisplayBlanksAs = Chart.eDisplayBlanksAs.Gap
End Sub

谢谢,

1 个答案:

答案 0 :(得分:0)

解决了这个问题。下载最新版本,因为这是EPPlus中的一个错误。另外我应该将chtpost声明为ExcelLineChart并导入Imports OfficeOpenXml.Drawing.Chart

希望这有助于其他人。

谢谢,