[feature][API] add SaveAsImage()

This commit is contained in:
monitor1394
2022-09-22 08:37:56 +08:00
parent eba8986f18
commit bd9a0df52b
8 changed files with 147 additions and 0 deletions

View File

@@ -588,5 +588,15 @@ namespace XCharts.Runtime
SerieHelper.GetItemColor(out color, out toColor, serie, null, m_Theme);
return color;
}
/// <summary>
/// 保存图表为图片。
/// </summary>
/// <param name="imageType">type of image: png, jpg, exr</param>
/// <param name="savePath">save path</param>
public void SaveAsImage(string imageType = "png", string savePath = "")
{
StartCoroutine(SaveAsImageSync(imageType, savePath));
}
}
}