[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISparkLineObject.ToJson

ToJson Method

ToJson()

Obtains the JSON string of the current Sparkline.

If a cell contains a sparkline formula, calling Value returns an ISparkLineObject that can be serialized to JSON by using this method.

Declaration
string ToJson()
Function ToJson() As String
Returns
Type Description
string

The JSON string corresponding to the current Sparkline.

Examples
worksheet.Range["B1:E1"].Value = new object[] {1, 3, 2, 4};
worksheet.Range["F1"].Formula = "=LINESPARKLINE(B1:E1,1)";
ISparkLineObject sparkline = (ISparkLineObject)worksheet.Range["F1"].Value;
string json = sparkline.ToJson();