/******************************************/ /* */ /* Copyright (c) 2018 monitor1394 */ /* https://github.com/monitor1394 */ /* */ /******************************************/ using System.Collections.Generic; using UnityEngine; namespace XCharts { public partial class RingChart { /// /// 更新指定系列执行数据项的最大值 /// /// /// /// /// public bool UpdateMax(int serieIndex, int dataIndex, float value) { var serie = m_Series.GetSerie(serieIndex); if (serie != null) { var serieData = serie.GetSerieData(dataIndex); if (serieData != null) { return serieData.UpdateData(1, value); } } return false; } /// /// 更新指定系列的所有数据项的最大值 /// /// /// /// public bool UpdateMax(int serieIndex, float value) { var serie = m_Series.GetSerie(serieIndex); if (serie != null) { var flag = true; foreach (var serieData in serie.data) { if (!serieData.UpdateData(1, value)) flag = false; } return flag; } return false; } /// /// 更新第一个系列第一个数据项的最大值 /// /// /// public bool UpdateMax(float value) { return UpdateMax(0, 0, value); } /// /// Adds the data with the specified maximum value to the specified serie. /// 添加指定最大值的数据到指定系列中。 /// /// the name of serie /// the data /// the max data /// the name of data /// Returns True on success public override SerieData AddData(string serieName, float value, float max, string dataName = null) { return base.AddData(serieName, value, max, dataName); } /// /// Adds the data with the specified maximum value to the specified serie. /// 添加指定最大值的数据到指定系列中。 /// /// the index of serie /// the data /// the max data /// the name of data /// Returns True on success public override SerieData AddData(int serieIndex, float value, float max, string dataName = null) { return base.AddData(serieIndex, value, max, dataName); } } }