去掉MultiData接口,命名空间重命名

This commit is contained in:
monitor1394
2019-04-02 22:49:44 +08:00
parent 735783fdb5
commit ba1e2c29a2
10 changed files with 21 additions and 106 deletions

View File

@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
namespace xcharts
namespace XCharts
{
[System.Serializable]
public class BarInfo

View File

@@ -4,7 +4,7 @@ using UnityEngine.UI;
using System.Collections.Generic;
using System.Text;
namespace xcharts
namespace XCharts
{
[System.Serializable]
@@ -46,16 +46,8 @@ namespace xcharts
public bool boundaryGap = true;
[SerializeField]
private List<string> data;
private List<string> multidata = new List<string>();
private List<string> Data
{
get
{
if (multidata.Count > 0) return multidata;
else return data;
}
}
private List<string> Data { get { return data; } }
public void AddData(string category)
{
@@ -66,15 +58,6 @@ namespace xcharts
data.Add(category);
}
public void AddMultiData(string category)
{
if (multidata.Count >= maxSplitNumber && maxSplitNumber != 0)
{
multidata.RemoveAt(0);
}
multidata.Add(category);
}
public string GetData(int index)
{
return Data[index];

View File

@@ -2,7 +2,7 @@
using UnityEngine.UI;
using System.Collections.Generic;
namespace xcharts
namespace XCharts
{
[System.Serializable]
public enum ChartType
@@ -174,11 +174,10 @@ namespace xcharts
public int showDataNumber = 0;
[SerializeField]
private List<float> dataList = new List<float>();
private List<float> multiDataList = new List<float>();
public List<float> DataList
{
get { return multiDataList.Count > 0 ? multiDataList : dataList; }
get { return dataList; }
}
public float Max
@@ -219,15 +218,6 @@ namespace xcharts
dataList.Add(value);
}
public void AddMultiData(float value)
{
if (multiDataList.Count >= showDataNumber && showDataNumber != 0)
{
multiDataList.RemoveAt(0);
}
multiDataList.Add(value);
}
public float GetData(int index)
{
if (index >= 0 && index <= DataList.Count - 1)
@@ -244,14 +234,6 @@ namespace xcharts
dataList[index] = value;
}
}
public void UpdateMultiData(int index, float value)
{
if (index >= 0 && index <= multiDataList.Count - 1)
{
multiDataList[index] = value;
}
}
}
public class BaseChart : MaskableGraphic
@@ -259,18 +241,13 @@ namespace xcharts
private const string TILTE_TEXT = "title";
private const string SUB_TILTE_TEXT = "sub_title";
private const string LEGEND_TEXT = "legend";
[SerializeField]
protected Theme theme = Theme.Dark;
[SerializeField]
protected ThemeInfo themeInfo = new ThemeInfo();
[SerializeField]
protected Title title = new Title();
[SerializeField]
protected Legend legend = new Legend();
[SerializeField]
protected Tooltip tooltip = new Tooltip();
[SerializeField]
protected List<Series> seriesList = new List<Series>();
[SerializeField] protected Theme theme = Theme.Dark;
[SerializeField] protected ThemeInfo themeInfo = new ThemeInfo();
[SerializeField] protected Title title = new Title();
[SerializeField] protected Legend legend = new Legend();
[SerializeField] protected Tooltip tooltip = new Tooltip();
[SerializeField] protected List<Series> seriesList = new List<Series>();
private Theme checkTheme = 0;
private Title checkTitle = new Title();
@@ -326,29 +303,11 @@ namespace xcharts
RefreshChart();
}
public void AddMultiData(string legend, float value)
{
for (int i = 0; i < seriesList.Count; i++)
{
if (seriesList[i].name.Equals(legend))
{
seriesList[i].AddMultiData(value);
break;
}
}
RefreshChart();
}
public void AddData(int legend,float value)
{
seriesList[legend].AddData(value);
}
public void AddMultiData(int legend, float value)
{
seriesList[legend].AddMultiData(value);
}
public void UpdateData(string legend, float value, int dataIndex = 0)
{
for (int i = 0; i < seriesList.Count; i++)
@@ -375,32 +334,6 @@ namespace xcharts
RefreshChart();
}
public void UpdateMultiData(string legend, float value, int dataIndex = 0)
{
for (int i = 0; i < seriesList.Count; i++)
{
if (seriesList[i].name.Equals(legend))
{
seriesList[i].UpdateMultiData(dataIndex, value);
break;
}
}
RefreshChart();
}
public void UpdateMultiData(int legendIndex, float value, int dataIndex = 0)
{
for (int i = 0; i < seriesList.Count; i++)
{
if (i == legendIndex)
{
seriesList[i].UpdateMultiData(dataIndex, value);
break;
}
}
RefreshChart();
}
public void UpdateTheme(Theme theme)
{
this.theme = theme;

View File

@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections;
namespace xcharts
namespace XCharts
{
[System.Serializable]
public enum Theme

View File

@@ -2,7 +2,7 @@
using UnityEngine;
using UnityEngine.UI;
namespace xcharts
namespace XCharts
{
public static class ChartUtils
{

View File

@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
namespace xcharts
namespace XCharts
{
[System.Serializable]
public class LineInfo

View File

@@ -3,7 +3,7 @@ using System.Text;
using UnityEngine;
using UnityEngine.UI;
namespace xcharts
namespace XCharts
{
[System.Serializable]
public class PieInfo

View File

@@ -3,7 +3,7 @@ using System.Text;
using UnityEngine;
using UnityEngine.UI;
namespace xcharts
namespace XCharts
{
[System.Serializable]
public class RadarIndicator