GrapeCity.Xaml.SpreadSheet.Data
AddChart(String,SpreadChartType,String,Double,Double,Double,Double) Method
Example 


GrapeCity.Xaml.SpreadSheet.Data Namespace > Worksheet Class > AddChart Method : AddChart(String,SpreadChartType,String,Double,Double,Double,Double) Method
The name of the chart.
The type of the chart.
The formula.
The x value or left position.
The y value or top position.
The width.
The height.
Adds the chart.
Syntax
'Declaration
 
Public Overloads Function AddChart( _
   ByVal name As String, _
   ByVal chartType As SpreadChartType, _
   ByVal formula As String, _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal width As Double, _
   ByVal height As Double _
) As SpreadChart
'Usage
 
Dim instance As Worksheet
Dim name As String
Dim chartType As SpreadChartType
Dim formula As String
Dim x As Double
Dim y As Double
Dim width As Double
Dim height As Double
Dim value As SpreadChart
 
value = instance.AddChart(name, chartType, formula, x, y, width, height)
public SpreadChart AddChart( 
   string name,
   SpreadChartType chartType,
   string formula,
   double x,
   double y,
   double width,
   double height
)

Parameters

name
The name of the chart.
chartType
The type of the chart.
formula
The formula.
x
The x value or left position.
y
The y value or top position.
width
The width.
height
The height.
Remarks
The chartType parameter indicates which type of chart will be added. The width and height parameters specify the size of the chart. The absolute position is specified by the x and y parameters.
Example
This example uses the AddChart method.
object[,] values = { { "lg1", "lg2", "lg3", "lg4", "lg5", "lg6", "lg7", "lg8", "lg9" }, { "tt1", 12.0, 5.0, 5, 7, 6, 8, 7, 9 }, { "tt2", 4.0, 5.0, 2, 4, 3, 5, 4, 6 } };
gcSpreadSheet1.Sheets[0].SetArray(0, 0, values);
GrapeCity.Xaml.SpreadSheet.Data.SpreadChart chart = gcSpreadSheet1.Sheets[0].AddChart("chart1", GrapeCity.Xaml.SpreadSheet.Data.SpreadChartType.Scatter, "Sheet1!$A$1:$I$3", 0, 0, 400, 400);
Dim values As Object(,) = {{"lg1", "lg2", "lg3", "lg4", "lg5", "lg6", "lg7", "lg8", "lg9"}, {"tt1", 12.0, 5.0, 5, 7, 6, 8, 7, 9}, {"tt2", 4.0, 5.0, 2, 4, 3, 5, 4, 6}}
GcSpreadSheet1.Sheets(0).SetArray(0, 0, values)
Dim chart = GcSpreadSheet1.Sheets(0).AddChart("chart1", GrapeCity.Xaml.SpreadSheet.Data.SpreadChartType.Scatter, "Sheet1!$A$1:$I$3", 0, 0, 400, 400)
See Also

Reference

Worksheet Class
Worksheet Members
Overload List