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.Xaml.SpreadSheet.Data.SpreadDataSeries ds = new GrapeCity.Xaml.SpreadSheet.Data.SpreadDataSeries(); ds.Values.Add(3); ds.Values.Add(-2); ds.Values.Add(4); ds.Values.Add(7); GrapeCity.Xaml.SpreadSheet.Data.SpreadDataSeries ds2 = new GrapeCity.Xaml.SpreadSheet.Data.SpreadDataSeries(); ds2.Values.Add(6); ds2.Values.Add(-7); ds2.Values.Add(8); ds2.Values.Add(10); GrapeCity.Xaml.SpreadSheet.Data.SpreadChart chart = gcSpreadSheet1.ActiveSheet.AddChart("chart", GrapeCity.Xaml.SpreadSheet.Data.SpreadChartType.Line, 50, 50, 500, 400); chart.DataSeries.Add(ds); chart.DataSeries.Add(ds2); |
VB |
Copy Code |
---|---|
Dim ds As New GrapeCity.Xaml.SpreadSheet.Data.SpreadDataSeries() ds.Values.Add(3) ds.Values.Add(-2) ds.Values.Add(4) ds.Values.Add(7) Dim ds2 As New GrapeCity.Xaml.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.Xaml.SpreadSheet.Data.SpreadChartType.Line, 50, 50, 500, 400) chart.DataSeries.Add(ds) chart.DataSeries.Add(ds2) |