mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 16:00:24 +00:00
增加Chart的Json导出导入
This commit is contained in:
@@ -154,5 +154,25 @@ namespace XCharts.Runtime
|
||||
}
|
||||
|
||||
protected virtual void OnThemeChanged() { }
|
||||
|
||||
/// <summary>
|
||||
/// Export UI component configuration to JSON string.
|
||||
/// </summary>
|
||||
[Since("v3.16.0")]
|
||||
public string ExportToJson(bool prettyPrint = true)
|
||||
{
|
||||
return UIComponentJsonSerializer.Serialize(this, prettyPrint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Import JSON and update current UI component configuration.
|
||||
/// </summary>
|
||||
[Since("v3.16.0")]
|
||||
public void ImportFromJson(string json)
|
||||
{
|
||||
UIComponentJsonDeserializer.Deserialize(json, this);
|
||||
RefreshAllComponent();
|
||||
RefreshGraph();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user