You can create many different types of line charts such as Line, Line3D, LineSmoothed, LineStacked, LineStacked100pc, LineStacked100pcWithMarkers, LineStackedWithMarkers, LineWithMarkers, and LineWithMarkersSmoothed. The following image displays a line chart.
The following code creates a line chart.
CS |
Copy Code
|
---|---|
GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries ds = new GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries(); ds.Values.Add(3); ds.Values.Add(-2); ds.Values.Add(4); ds.Values.Add(7); GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries ds2 = new GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries(); ds2.Values.Add(6); ds2.Values.Add(-7); ds2.Values.Add(8); ds2.Values.Add(10); GrapeCity.Windows.SpreadSheet.Data.SpreadChart chart = gcSpreadSheet1.ActiveSheet.AddChart("chart", GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.Line, 50, 50, 500, 400); chart.DataSeries.Add(ds); chart.DataSeries.Add(ds2); |
VB.NET |
Copy Code
|
---|---|
Dim ds As New GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries() ds.Values.Add(3) ds.Values.Add(-2) ds.Values.Add(4) ds.Values.Add(7) Dim ds2 As New GrapeCity.Windows.SpreadSheet.Data.SpreadDataSeries() ds2.Values.Add(6) ds2.Values.Add(-7) ds2.Values.Add(8) ds2.Values.Add(10) Dim chart = GcSpreadSheet1.ActiveSheet.AddChart("chart", GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.Line, 50, 50, 500, 400) chart.DataSeries.Add(ds) chart.DataSeries.Add(ds2) |