[]
Loads the data bar conditional format from a JSON string.
This method replaces the current data bar rule with the rule defined in the specified JSON string. The JSON content is typically generated by ToJson().
void FromJson(string json)
Sub FromJson(json As String)
| Type | Name | Description |
|---|---|---|
| string | json | The JSON string that defines a data bar conditional format. |
worksheet.Range["A1:A3"].Value = new object[,] {{10}, {30}, {20}};
IDataBar dataBar = worksheet.Range["A1:A3"].FormatConditions.AddDatabar();
dataBar.BarFillType = DataBarFillType.Solid;
dataBar.BarColor.Color = Color.Green;
dataBar.ShowValue = false;
string json = dataBar.ToJson();
IDataBar copiedDataBar = worksheet.Range["B1:B3"].FormatConditions.AddDatabar();
copiedDataBar.FromJson(json);
| Type | Condition |
|---|---|
| InvalidOperationException | if the specified JSON string does not describe a data bar conditional format. |