[]
        
(Showing Draft Content)

Smooth Line Chart

You can highlight curvy trends and make the lines in the chart smoother and visually appealing without fitting the continuous data into a specific angle using the ISeries.Smooth property.

image


The following example demonstrates how to set a line as smooth in a chart.

C#

// Set data.
spreadSheet1.Workbook.ActiveSheet.SetValue(1, 1, new object[,]
{
  { "Q1", "Q2", "Q3", "Q4"},
  { 1, 2, 5, 3},
  { 2, 3, 1, 5}
});
spreadSheet1.Workbook.ActiveSheet.Cells["B2:E4"].Select();
spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Line, 300, 50, 400, 300);
var chart = spreadSheet1.Workbook.ActiveSheet.ChartObjects[0].Chart;
chart.ChartTitle.Text = "Smooth Line Chart";

// Enable smoothing for the first series in the chart.
chart.Series[0].Smooth = true;

VB

' Set data.
spreadSheet1.Workbook.ActiveSheet.SetValue(1, 1, New Object(,) {
    {"Q1", "Q2", "Q3", "Q4"},
    {1, 2, 5, 3},
    {2, 3, 1, 5}
})
spreadSheet1.Workbook.ActiveSheet.Cells("B2:E4").Select()
spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Line, 300, 50, 400, 300)
Dim chart = spreadSheet1.Workbook.ActiveSheet.ChartObjects(0).Chart
chart.ChartTitle.Text = "Smooth Line Chart"

' Enable smoothing for the first series in the chart.
chart.Series(0).Smooth = True