Compare commits
22 Commits
v3.14.0
...
b9c72c8cb9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9c72c8cb9 | ||
|
|
d76b474a61 | ||
|
|
2acb841d2e | ||
|
|
8af1796ff8 | ||
|
|
78a07aa2ae | ||
|
|
fe867d18e6 | ||
|
|
757ccb04fb | ||
|
|
b4cb62241f | ||
|
|
0fb1cab302 | ||
|
|
ead9034870 | ||
|
|
20c87265a5 | ||
|
|
1e31cf3010 | ||
|
|
d33e2f66ef | ||
|
|
ff4fbb2176 | ||
|
|
9fc3ff862f | ||
|
|
bc31f86fcf | ||
|
|
c6412f5d78 | ||
|
|
0e60a26333 | ||
|
|
59bb60950b | ||
|
|
b3320bd2cd | ||
|
|
71cfbc15f3 | ||
|
|
8fbda1fa73 |
@@ -405,7 +405,7 @@ the delegate function of animation delay.
|
||||
### AnimationInfo.duration
|
||||
|
||||
public float duration
|
||||
the duration of animation. Default is used to calculate the speed of animation. It can also be specified by speed.
|
||||
the duration of animation.
|
||||
|
||||
### AnimationInfo.durationFunction
|
||||
|
||||
@@ -432,11 +432,6 @@ the callback function of animation start.
|
||||
public bool reverse
|
||||
whether enable reverse animation.
|
||||
|
||||
### AnimationInfo.speed
|
||||
|
||||
public float speed
|
||||
the speed of animation. When speed is specified, duration will be invalid. Default is 0, which means no speed specified.
|
||||
|
||||
### AnimationInfo.End
|
||||
|
||||
public void End()
|
||||
@@ -1047,10 +1042,6 @@ public bool needAnimation
|
||||
public List<string> runtimeData
|
||||
the tick value of value axis.
|
||||
|
||||
### AxisContext.sortedDataIndices
|
||||
|
||||
public List<int> sortedDataIndices
|
||||
|
||||
## AxisHandler<T>
|
||||
|
||||
class in XCharts / Inherits from: [MainComponentHandler](#maincomponenthandler)
|
||||
@@ -1179,7 +1170,7 @@ public void Copy(AxisLabel axisLabel)
|
||||
|
||||
### AxisLabel.GetFormatterContent
|
||||
|
||||
public override string GetFormatterContent(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
public override string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
|
||||
|
||||
### AxisLabel.IsNeedShowLabel
|
||||
@@ -1392,10 +1383,6 @@ public int containerIndex
|
||||
|
||||
public int containterInstanceId
|
||||
|
||||
### Bar.useSortData
|
||||
|
||||
public override bool useSortData
|
||||
|
||||
### Bar.AddDefaultSerie
|
||||
|
||||
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
|
||||
@@ -1954,10 +1941,6 @@ public T GetOrAddChartComponent<T>() where T : MainComponent
|
||||
|
||||
public Painter GetPainter(int index)
|
||||
|
||||
### BaseChart.GetRealtimeSortSerie
|
||||
|
||||
public Serie GetRealtimeSortSerie(int gridIndex)
|
||||
|
||||
### BaseChart.GetSerie
|
||||
|
||||
public Serie GetSerie(int serieIndex)
|
||||
@@ -1970,19 +1953,19 @@ public T GetSerie<T>(int serieIndex) where T : Serie
|
||||
|
||||
### BaseChart.GetSerieBarGap<T>
|
||||
|
||||
public float GetSerieBarGap<T>(int gridIndex) where T : Serie
|
||||
public float GetSerieBarGap<T>() where T : Serie
|
||||
|
||||
### BaseChart.GetSerieBarRealCount<T>
|
||||
|
||||
public int GetSerieBarRealCount<T>(int gridIndex) where T : Serie
|
||||
public int GetSerieBarRealCount<T>() where T : Serie
|
||||
|
||||
### BaseChart.GetSerieIndexIfStack<T>
|
||||
|
||||
public int GetSerieIndexIfStack<T>(Serie currSerie, int gridIndex) where T : Serie
|
||||
public int GetSerieIndexIfStack<T>(Serie currSerie) where T : Serie
|
||||
|
||||
### BaseChart.GetSerieSameStackTotalValue<T>
|
||||
|
||||
public double GetSerieSameStackTotalValue<T>(string stack, int dataIndex, int gridIndex) where T : Serie
|
||||
public double GetSerieSameStackTotalValue<T>(string stack, int dataIndex) where T : Serie
|
||||
|
||||
### BaseChart.GetSeriesMinMaxValue
|
||||
|
||||
@@ -1990,11 +1973,11 @@ public virtual void GetSeriesMinMaxValue(Axis axis, int axisIndex, out double te
|
||||
|
||||
### BaseChart.GetSerieTotalGap<T>
|
||||
|
||||
public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index, int gridIndex) where T : Serie
|
||||
public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index) where T : Serie
|
||||
|
||||
### BaseChart.GetSerieTotalWidth<T>
|
||||
|
||||
public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount, int gridIndex) where T : Serie
|
||||
public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount) where T : Serie
|
||||
|
||||
### BaseChart.GetTitlePosition
|
||||
|
||||
@@ -2024,10 +2007,6 @@ public bool HasChartComponent(Type type)
|
||||
|
||||
public bool HasChartComponent<T>()
|
||||
|
||||
### BaseChart.HasRealtimeSortSerie
|
||||
|
||||
public bool HasRealtimeSortSerie(int gridIndex)
|
||||
|
||||
### BaseChart.HasSerie
|
||||
|
||||
public bool HasSerie(Type type)
|
||||
@@ -3103,10 +3082,6 @@ public static List<string> ParseStringFromString(string jsonData)
|
||||
|
||||
public static void RemoveComponent<T>(GameObject gameObject)
|
||||
|
||||
### ChartHelper.RemoveTMPComponents
|
||||
|
||||
public static void RemoveTMPComponents(GameObject gameObject)
|
||||
|
||||
### ChartHelper.RotateRound
|
||||
|
||||
public static Vector3 RotateRound(Vector3 position, Vector3 center, Vector3 axis, float angle)
|
||||
@@ -3459,9 +3434,10 @@ class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
|
||||
|
||||
comment of chart.
|
||||
|
||||
### CommentItem.labelObject
|
||||
### CommentItem.content
|
||||
|
||||
public ChartLabel labelObject
|
||||
public string content
|
||||
content of comment.
|
||||
|
||||
### CommentItem.markRect
|
||||
|
||||
@@ -3910,13 +3886,9 @@ public static bool NeedFormat(string content)
|
||||
|
||||
### FormatterHelper.ReplaceAxisLabelContent
|
||||
|
||||
public static void ReplaceAxisLabelContent(ref string content, string value, int index, int totalIndex)
|
||||
public static void ReplaceAxisLabelContent(ref string content, string value)
|
||||
|
||||
|
||||
### FormatterHelper.ReplaceIndexContent
|
||||
|
||||
public static void ReplaceIndexContent(ref string content, int currIndex, int totalIndex)
|
||||
|
||||
### FormatterHelper.TrimAndReplaceLine
|
||||
|
||||
public static string TrimAndReplaceLine(string content)
|
||||
@@ -4427,7 +4399,7 @@ public override void ClearData()
|
||||
|
||||
### Indicator.GetFormatterIndicatorContent
|
||||
|
||||
public string GetFormatterIndicatorContent(string indicatorName, int index, int totalIndex)
|
||||
public string GetFormatterIndicatorContent(string indicatorName)
|
||||
|
||||
|
||||
### Indicator.GetIndicator
|
||||
@@ -4678,12 +4650,12 @@ public Color GetColor(Color defaultColor)
|
||||
|
||||
### LabelStyle.GetFormatterContent
|
||||
|
||||
public virtual string GetFormatterContent(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
public virtual string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
|
||||
|
||||
### LabelStyle.GetFormatterDateTime
|
||||
|
||||
public string GetFormatterDateTime(int labelIndex, int totalIndex, double value, double minValue, double maxValue)
|
||||
public string GetFormatterDateTime(int labelIndex, double value, double minValue, double maxValue)
|
||||
|
||||
### LabelStyle.GetOffset
|
||||
|
||||
@@ -6747,7 +6719,7 @@ public double GetData(int index, int dimension, DataZoom dataZoom = null)
|
||||
|
||||
### Serie.GetDataList
|
||||
|
||||
public List<SerieData> GetDataList(DataZoom dataZoom = null, bool sorted = false)
|
||||
public List<SerieData> GetDataList(DataZoom dataZoom = null)
|
||||
获得系列的数据列表
|
||||
|
||||
### Serie.GetDataTotal
|
||||
@@ -7054,10 +7026,6 @@ public SelectStyle selectStyle
|
||||
public bool show
|
||||
[default:true] Whether the data item is showed.
|
||||
|
||||
### SerieData.sortIndex
|
||||
|
||||
public int sortIndex
|
||||
|
||||
### SerieData.state
|
||||
|
||||
public SerieState state
|
||||
@@ -7204,7 +7172,7 @@ public void SetIconActive(bool flag)
|
||||
|
||||
### SerieData.SetLabelActive
|
||||
|
||||
public void SetLabelActive(bool flag, bool force = false)
|
||||
public void SetLabelActive(bool flag)
|
||||
|
||||
### SerieData.SetPolygon
|
||||
|
||||
@@ -7981,7 +7949,7 @@ class in XCharts.Runtime / Inherits from: [SymbolStyle](#symbolstyle),[ISerieDat
|
||||
|
||||
### SerieSymbol.GetSize
|
||||
|
||||
public float GetSize(SerieData serieData, float themeSize)
|
||||
public float GetSize(List<double> data, float themeSize)
|
||||
根据指定的sizeType获得标记的大小
|
||||
|
||||
### SerieSymbol.Reset
|
||||
|
||||
@@ -6,7 +6,6 @@ slug: /changelog
|
||||
# Changelog
|
||||
|
||||
[master](#master)
|
||||
[v3.14.0](#v3140)
|
||||
[v3.13.0](#v3130)
|
||||
[v3.12.1](#v3121)
|
||||
[v3.12.0](#v3120)
|
||||
@@ -79,36 +78,6 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
## v3.14.0
|
||||
|
||||
**Key Highlights:**
|
||||
|
||||
* Added real-time sorting functionality for `Bar`
|
||||
* Added support for `\n` line breaks in `itemFormatter` for `Tooltip`
|
||||
* Added support for `{index}` formatting in `AxisLabel`
|
||||
* Added `speed` to `Animation` to specify animation speed
|
||||
* Optimized column alignment in `Tooltip`
|
||||
|
||||
**Detailed Changelog:**
|
||||
|
||||
* (2025.03.15) Released version `v3.14.0`
|
||||
* (2025.03.09) Fixed an issue where `Bar` displayed abnormally when placed in different `Grids` within the same `Chart`
|
||||
* (2025.03.07) Added `speed` to `Animation` to specify animation speed
|
||||
* (2025.03.06) Optimized the performance of newly added animations in `Animation`
|
||||
* (2025.03.04) Fixed an issue where `label` in `Treemap` displayed abnormally
|
||||
* (2025.03.02) Added `columnGapWidths` parameter to `Tooltip` to set the gap distance between column texts
|
||||
* (2025.03.01) Optimized the refresh of `Comment` component
|
||||
* (2025.02.23) Added support for `{index}`, `{index-1}`, `{-index}`, and `{-index-1}` wildcards in `formatter` for `Label` in `Axis`
|
||||
* (2025.02.23) Added `realtimeSort` to `Bar` to support real-time sorting
|
||||
* (2025.02.19) Added support for `\n` line breaks in `itemFormatter` for `Tooltip`
|
||||
* (2025.02.18) Optimized the alignment of `Tooltip`
|
||||
* (2025.02.09) Fixed an issue where `SaveAsImage` did not support transparency when saving images (#337)
|
||||
* (2025.02.05) Added support for setting `data` styles separately in `GraphChart`
|
||||
* (2025.02.05) Refactored the `sizeFunction` parameter in `SerieSymbol`
|
||||
* (2025.01.23) Fixed an issue where `Label` in `Treemap` was not displayed
|
||||
* (2025.01.15) Fixed an issue where dynamically adding `Component` to `Chart` at runtime caused exceptions (#339)
|
||||
* (2025.01.08) Fixed an issue where residual components affected `Text` initialization when `TextMeshPro` was turned off
|
||||
|
||||
## v3.13.0
|
||||
|
||||
Key Features:
|
||||
@@ -179,6 +148,7 @@ Log Details:
|
||||
* (2024.09.01) Added `radiusGradient` parameter for `Ring` to set the gradient direction
|
||||
* (2024.09.01) Optimized the position of the first Label when `Axis` is used as a time axis
|
||||
|
||||
|
||||
## v3.11.2
|
||||
|
||||
* (2024.08.01) Release `v3.11.2`
|
||||
|
||||
@@ -276,7 +276,7 @@ the delay time before animation start.
|
||||
|
||||
`float` `1000` `v3.8.0`
|
||||
|
||||
the duration of animation. Default is used to calculate the speed of animation. It can also be specified by speed.
|
||||
the duration of animation.
|
||||
|
||||
### AnimationInfo.enable
|
||||
|
||||
@@ -290,12 +290,6 @@ whether enable animation.
|
||||
|
||||
whether enable reverse animation.
|
||||
|
||||
### AnimationInfo.speed
|
||||
|
||||
`float` `0` `v3.14.0`
|
||||
|
||||
the speed of animation. When speed is specified, duration will be invalid. Default is 0, which means no speed specified.
|
||||
|
||||
## AnimationInteraction
|
||||
|
||||
class in XCharts.Runtime / Inherits from: [AnimationInfo](#animationinfo)
|
||||
@@ -2468,7 +2462,7 @@ the distance of label to axis line.
|
||||
|
||||
`string`
|
||||
|
||||
label content string template formatter. \n line wrapping is supported. Formatters for some components will not take effect. <br /> Template placeholder have the following, some of which apply only to fixed components: <br /> `\{.\}` : indicates the dot mark. <br /> `\{a\}` : indicates the series name. <br /> `\{b\}` : category value of x axis or data name. <br /> `\{c\}` : data value. <br /> `\{d\}` : percentage. <br /> `\{e\}` : indicates the data name. <br /> `\{f\}` : data sum. <br /> `\{g\}` : indicates the total number of data. <br /> `\{h\}` : hexadecimal color value. <br /> `\{y\}` : category value of y axis. <br /> `\{value\}` : the value of the axis or legend. <br /> `\{index\}` : the index of the axis. <br /> The following placeholder apply to `UITable` components: <br /> `\{name\}` : indicates the row name of the table. <br /> `\{index\}` : indicates the row number of the table. <br /> The following placeholder apply to `UIStatistc` components: <br /> `\{title\}` : title text. <br /> `\{dd\}` : day. <br /> `\{hh\}` : hours. <br /> `\{mm\}` : minutes. <br /> `\{ss\}` : second. <br /> `\{fff\}` : milliseconds. <br /> `\{d\}` : day. <br /> `\{h\}` : hours. <br /> `\{m\}` : minutes. <br /> `\{s\}` : second. <br /> `\{f\}` : milliseconds. <br /> Example :\{b\}:\{c\}<br />
|
||||
label content string template formatter. \n line wrapping is supported. Formatters for some components will not take effect. <br /> Template placeholder have the following, some of which apply only to fixed components: <br /> `\{.\}` : indicates the dot mark. <br /> `\{a\}` : indicates the series name. <br /> `\{b\}` : category value of x axis or data name. <br /> `\{c\}` : data value. <br /> `\{d\}` : percentage. <br /> `\{e\}` : indicates the data name. <br /> `\{f\}` : data sum. <br /> `\{g\}` : indicates the total number of data. <br /> `\{h\}` : hexadecimal color value. <br /> `\{y\}` : category value of y axis. <br /> `\{value\}` : The value of the axis or legend. <br /> The following placeholder apply to `UITable` components: <br /> `\{name\}` : indicates the row name of the table. <br /> `\{index\}` : indicates the row number of the table. <br /> The following placeholder apply to `UIStatistc` components: <br /> `\{title\}` : title text. <br /> `\{dd\}` : day. <br /> `\{hh\}` : hours. <br /> `\{mm\}` : minutes. <br /> `\{ss\}` : second. <br /> `\{fff\}` : milliseconds. <br /> `\{d\}` : day. <br /> `\{h\}` : hours. <br /> `\{m\}` : minutes. <br /> `\{s\}` : second. <br /> `\{f\}` : milliseconds. <br /> Example :\{b\}:\{c\}<br />
|
||||
|
||||
### LabelStyle.height
|
||||
|
||||
@@ -3761,12 +3755,6 @@ Options:
|
||||
|
||||
the radius of chart.
|
||||
|
||||
### Serie.realtimeSort
|
||||
|
||||
`bool` `false` `v3.14.0`
|
||||
|
||||
Whether to enable realtime sorting, which is used for bar-racing effect. Currently only available in Bar.
|
||||
|
||||
### Serie.right
|
||||
|
||||
`float`
|
||||
@@ -4828,17 +4816,11 @@ the color of tooltip border.
|
||||
|
||||
the width of tooltip border.
|
||||
|
||||
### Tooltip.columnGapWidths
|
||||
|
||||
`List<float>` `v3.14.0`
|
||||
|
||||
the column gap width of content. When there is only one column, it only represents the gap width of the second column.
|
||||
|
||||
### Tooltip.contentLabelStyles
|
||||
|
||||
`List<LabelStyle>`
|
||||
|
||||
the column text style list of content. The first represents the text style of the first column, and so on.
|
||||
the textstyle list of content.
|
||||
|
||||
### Tooltip.fixedHeight
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 704 KiB After Width: | Height: | Size: 293 KiB |
|
Before Width: | Height: | Size: 660 KiB After Width: | Height: | Size: 225 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 11 KiB |
@@ -405,7 +405,7 @@ public AnimationDelayFunction delayFunction
|
||||
### AnimationInfo.duration
|
||||
|
||||
public float duration
|
||||
动画的时长。默认用于计算动画的速度。也可以通过speed指定速度。
|
||||
动画的时长。
|
||||
|
||||
### AnimationInfo.durationFunction
|
||||
|
||||
@@ -432,11 +432,6 @@ public Action OnAnimationStart
|
||||
public bool reverse
|
||||
是否开启反向动画效果。
|
||||
|
||||
### AnimationInfo.speed
|
||||
|
||||
public float speed
|
||||
动画的速度。当指定speed时,duration将失效。默认为0,表示不指定速度。
|
||||
|
||||
### AnimationInfo.End
|
||||
|
||||
public void End()
|
||||
@@ -1047,10 +1042,6 @@ public bool needAnimation
|
||||
public List<string> runtimeData
|
||||
数值轴时每个tick的数值。
|
||||
|
||||
### AxisContext.sortedDataIndices
|
||||
|
||||
public List<int> sortedDataIndices
|
||||
|
||||
## AxisHandler<T>
|
||||
|
||||
class in XCharts / 继承自: [MainComponentHandler](#maincomponenthandler)
|
||||
@@ -1179,7 +1170,7 @@ public void Copy(AxisLabel axisLabel)
|
||||
|
||||
### AxisLabel.GetFormatterContent
|
||||
|
||||
public override string GetFormatterContent(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
public override string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
|
||||
|
||||
### AxisLabel.IsNeedShowLabel
|
||||
@@ -1392,10 +1383,6 @@ public int containerIndex
|
||||
|
||||
public int containterInstanceId
|
||||
|
||||
### Bar.useSortData
|
||||
|
||||
public override bool useSortData
|
||||
|
||||
### Bar.AddDefaultSerie
|
||||
|
||||
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
|
||||
@@ -1954,10 +1941,6 @@ public T GetOrAddChartComponent<T>() where T : MainComponent
|
||||
|
||||
public Painter GetPainter(int index)
|
||||
|
||||
### BaseChart.GetRealtimeSortSerie
|
||||
|
||||
public Serie GetRealtimeSortSerie(int gridIndex)
|
||||
|
||||
### BaseChart.GetSerie
|
||||
|
||||
public Serie GetSerie(int serieIndex)
|
||||
@@ -1970,19 +1953,19 @@ public T GetSerie<T>(int serieIndex) where T : Serie
|
||||
|
||||
### BaseChart.GetSerieBarGap<T>
|
||||
|
||||
public float GetSerieBarGap<T>(int gridIndex) where T : Serie
|
||||
public float GetSerieBarGap<T>() where T : Serie
|
||||
|
||||
### BaseChart.GetSerieBarRealCount<T>
|
||||
|
||||
public int GetSerieBarRealCount<T>(int gridIndex) where T : Serie
|
||||
public int GetSerieBarRealCount<T>() where T : Serie
|
||||
|
||||
### BaseChart.GetSerieIndexIfStack<T>
|
||||
|
||||
public int GetSerieIndexIfStack<T>(Serie currSerie, int gridIndex) where T : Serie
|
||||
public int GetSerieIndexIfStack<T>(Serie currSerie) where T : Serie
|
||||
|
||||
### BaseChart.GetSerieSameStackTotalValue<T>
|
||||
|
||||
public double GetSerieSameStackTotalValue<T>(string stack, int dataIndex, int gridIndex) where T : Serie
|
||||
public double GetSerieSameStackTotalValue<T>(string stack, int dataIndex) where T : Serie
|
||||
|
||||
### BaseChart.GetSeriesMinMaxValue
|
||||
|
||||
@@ -1990,11 +1973,11 @@ public virtual void GetSeriesMinMaxValue(Axis axis, int axisIndex, out double te
|
||||
|
||||
### BaseChart.GetSerieTotalGap<T>
|
||||
|
||||
public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index, int gridIndex) where T : Serie
|
||||
public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index) where T : Serie
|
||||
|
||||
### BaseChart.GetSerieTotalWidth<T>
|
||||
|
||||
public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount, int gridIndex) where T : Serie
|
||||
public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount) where T : Serie
|
||||
|
||||
### BaseChart.GetTitlePosition
|
||||
|
||||
@@ -2024,10 +2007,6 @@ public bool HasChartComponent(Type type)
|
||||
|
||||
public bool HasChartComponent<T>()
|
||||
|
||||
### BaseChart.HasRealtimeSortSerie
|
||||
|
||||
public bool HasRealtimeSortSerie(int gridIndex)
|
||||
|
||||
### BaseChart.HasSerie
|
||||
|
||||
public bool HasSerie(Type type)
|
||||
@@ -3103,10 +3082,6 @@ public static List<string> ParseStringFromString(string jsonData)
|
||||
|
||||
public static void RemoveComponent<T>(GameObject gameObject)
|
||||
|
||||
### ChartHelper.RemoveTMPComponents
|
||||
|
||||
public static void RemoveTMPComponents(GameObject gameObject)
|
||||
|
||||
### ChartHelper.RotateRound
|
||||
|
||||
public static Vector3 RotateRound(Vector3 position, Vector3 center, Vector3 axis, float angle)
|
||||
@@ -3459,9 +3434,10 @@ class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
|
||||
|
||||
注解项。
|
||||
|
||||
### CommentItem.labelObject
|
||||
### CommentItem.content
|
||||
|
||||
public ChartLabel labelObject
|
||||
public string content
|
||||
注解的文本内容。支持模板参数,可以参考Tooltip的itemFormatter。
|
||||
|
||||
### CommentItem.markRect
|
||||
|
||||
@@ -3910,13 +3886,9 @@ public static bool NeedFormat(string content)
|
||||
|
||||
### FormatterHelper.ReplaceAxisLabelContent
|
||||
|
||||
public static void ReplaceAxisLabelContent(ref string content, string value, int index, int totalIndex)
|
||||
public static void ReplaceAxisLabelContent(ref string content, string value)
|
||||
|
||||
|
||||
### FormatterHelper.ReplaceIndexContent
|
||||
|
||||
public static void ReplaceIndexContent(ref string content, int currIndex, int totalIndex)
|
||||
|
||||
### FormatterHelper.TrimAndReplaceLine
|
||||
|
||||
public static string TrimAndReplaceLine(string content)
|
||||
@@ -4427,7 +4399,7 @@ public override void ClearData()
|
||||
|
||||
### Indicator.GetFormatterIndicatorContent
|
||||
|
||||
public string GetFormatterIndicatorContent(string indicatorName, int index, int totalIndex)
|
||||
public string GetFormatterIndicatorContent(string indicatorName)
|
||||
|
||||
|
||||
### Indicator.GetIndicator
|
||||
@@ -4678,12 +4650,12 @@ public Color GetColor(Color defaultColor)
|
||||
|
||||
### LabelStyle.GetFormatterContent
|
||||
|
||||
public virtual string GetFormatterContent(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
public virtual string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
|
||||
|
||||
### LabelStyle.GetFormatterDateTime
|
||||
|
||||
public string GetFormatterDateTime(int labelIndex, int totalIndex, double value, double minValue, double maxValue)
|
||||
public string GetFormatterDateTime(int labelIndex, double value, double minValue, double maxValue)
|
||||
|
||||
### LabelStyle.GetOffset
|
||||
|
||||
@@ -6747,7 +6719,7 @@ public double GetData(int index, int dimension, DataZoom dataZoom = null)
|
||||
|
||||
### Serie.GetDataList
|
||||
|
||||
public List<SerieData> GetDataList(DataZoom dataZoom = null, bool sorted = false)
|
||||
public List<SerieData> GetDataList(DataZoom dataZoom = null)
|
||||
获得系列的数据列表
|
||||
|
||||
### Serie.GetDataTotal
|
||||
@@ -7054,10 +7026,6 @@ public SelectStyle selectStyle
|
||||
public bool show
|
||||
该数据项是否要显示。
|
||||
|
||||
### SerieData.sortIndex
|
||||
|
||||
public int sortIndex
|
||||
|
||||
### SerieData.state
|
||||
|
||||
public SerieState state
|
||||
@@ -7204,7 +7172,7 @@ public void SetIconActive(bool flag)
|
||||
|
||||
### SerieData.SetLabelActive
|
||||
|
||||
public void SetLabelActive(bool flag, bool force = false)
|
||||
public void SetLabelActive(bool flag)
|
||||
|
||||
### SerieData.SetPolygon
|
||||
|
||||
@@ -7981,7 +7949,7 @@ class in XCharts.Runtime / 继承自: [SymbolStyle](#symbolstyle),[ISerieDataCom
|
||||
|
||||
### SerieSymbol.GetSize
|
||||
|
||||
public float GetSize(SerieData serieData, float themeSize)
|
||||
public float GetSize(List<double> data, float themeSize)
|
||||
根据指定的sizeType获得标记的大小
|
||||
|
||||
### SerieSymbol.Reset
|
||||
|
||||
@@ -6,7 +6,6 @@ slug: /changelog
|
||||
# 更新日志
|
||||
|
||||
[master](#master)
|
||||
[v3.14.0](#v3140)
|
||||
[v3.13.0](#v3130)
|
||||
[v3.12.1](#v3121)
|
||||
[v3.12.0](#v3120)
|
||||
@@ -80,36 +79,6 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
## v3.14.0
|
||||
|
||||
版本要点:
|
||||
|
||||
* 新增`Bar`的实时排序功能
|
||||
* 新增`Tooltip`的`itemFormatter`支持`\n`换行
|
||||
* 新增`AxisLabel`的格式化支持`{index}`
|
||||
* 新增`Animation`的`speed`可指定动画速度
|
||||
* 优化`Tooltip`的列对齐方式
|
||||
|
||||
日志详情:
|
||||
|
||||
* (2025.03.15) 发布`v3.14.0`版本
|
||||
* (2025.03.09) 修复`Bar`在同一个`Chart`不同`Grid`里时绘制有些异常的问题
|
||||
* (2025.03.07) 增加`Animation`的`speed`可指定动画速度
|
||||
* (2025.03.06) 优化`Animation`的新增动画表现
|
||||
* (2025.03.04) 修复`Treemap`的`label`显示异常的问题
|
||||
* (2025.03.02) 增加`Tooltip`的`columnGapWidths`参数设置列文本间隙距离
|
||||
* (2025.03.01) 优化`Comment`的组件刷新
|
||||
* (2025.02.23) 增加`Axis`的`Label`的`formatter`支持`{index}``{index-1}``{-index}``{-index-1}`通配符
|
||||
* (2025.02.23) 增加`Bar`的`realtimeSort`支持实时排序
|
||||
* (2025.02.19) 增加`Tooltip`的`itemFormatter`对`\n`换行的支持
|
||||
* (2025.02.18) 优化`Tooltip`的对齐方式
|
||||
* (2025.02.09) 修复`SaveAsImage`保存图片时不支持透明度的问题 (#337)
|
||||
* (2025.02.05) 增加`GraphChart`可单独设置`data`样式的支持
|
||||
* (2025.02.05) 重构`SerieSymbol`的`sizeFunction`参数
|
||||
* (2025.01.23) 修复`Treemap`的`Label`不显示的问题
|
||||
* (2025.01.15) 修复`Chart`在运行时动态添加`Component`异常的问题 (#339)
|
||||
* (2025.01.08) 修复`TextMeshPro`关闭时残留组件影响`Text`初始化的问题
|
||||
|
||||
## v3.13.0
|
||||
|
||||
版本要点:
|
||||
|
||||
@@ -276,7 +276,7 @@ class in XCharts.Runtime / 子类: [AnimationFadeIn](#animationfadein), [Animati
|
||||
|
||||
`float` `1000` `v3.8.0`
|
||||
|
||||
动画的时长。默认用于计算动画的速度。也可以通过speed指定速度。
|
||||
动画的时长。
|
||||
|
||||
### AnimationInfo.enable
|
||||
|
||||
@@ -290,12 +290,6 @@ class in XCharts.Runtime / 子类: [AnimationFadeIn](#animationfadein), [Animati
|
||||
|
||||
是否开启反向动画效果。
|
||||
|
||||
### AnimationInfo.speed
|
||||
|
||||
`float` `0` `v3.14.0`
|
||||
|
||||
动画的速度。当指定speed时,duration将失效。默认为0,表示不指定速度。
|
||||
|
||||
## AnimationInteraction
|
||||
|
||||
class in XCharts.Runtime / 继承自: [AnimationInfo](#animationinfo)
|
||||
@@ -2468,7 +2462,7 @@ class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent), [ISerie
|
||||
|
||||
`string`
|
||||
|
||||
标签内容字符串模版格式器。支持用 \n 换行。部分组件的格式器会不生效。<br/> 模板通配符有以下这些,部分只适用于固定的组件:<br/> `\{.\}`:圆点标记。<br/> `\{a\}`:系列名。<br/> `\{b\}`:X轴类目名或数据名。<br/> `\{c\}`:数据值。<br/> `\{d\}`:百分比。<br/> `\{e\}`:数据名。<br/> `\{f\}`:数据和。<br/> `\{g\}`:数据总个数。<br/> `\{h\}`:十六进制颜色值。<br/> `\{y\}`:Y轴的类目名。<br/> `\{value\}`:坐标轴或图例的值。<br/> `\{index\}`:坐标轴编号。<br/> 以下通配符适用UITable组件:<br/> `\{name\}`: 表格的行名。<br/> `\{index\}`:表格的行号。<br/> 以下通配符适用UIStatistc组件:<br/> `\{title\}`:标题文本。<br/> `\{dd\}`:天。<br/> `\{hh\}`:小时。<br/> `\{mm\}`:分钟。<br/> `\{ss\}`:秒。<br/> `\{fff\}`:毫秒。<br/> `\{d\}`:天。<br/> `\{h\}`:小时。<br/> `\{m\}`:分钟。<br/> `\{s\}`:秒。<br/> `\{f\}`:毫秒。<br/> 示例:“\{b\}:\{c\}”
|
||||
标签内容字符串模版格式器。支持用 \n 换行。部分组件的格式器会不生效。<br/> 模板通配符有以下这些,部分只适用于固定的组件:<br/> `\{.\}`:圆点标记。<br/> `\{a\}`:系列名。<br/> `\{b\}`:X轴类目名或数据名。<br/> `\{c\}`:数据值。<br/> `\{d\}`:百分比。<br/> `\{e\}`:数据名。<br/> `\{f\}`:数据和。<br/> `\{g\}`:数据总个数。<br/> `\{h\}`:十六进制颜色值。<br/> `\{y\}`:Y轴的类目名。<br/> `\{value\}`:坐标轴或图例的值。<br/> 以下通配符适用UITable组件:<br/> `\{name\}`: 表格的行名。<br/> `\{index\}`:表格的行号。<br/> 以下通配符适用UIStatistc组件:<br/> `\{title\}`:标题文本。<br/> `\{dd\}`:天。<br/> `\{hh\}`:小时。<br/> `\{mm\}`:分钟。<br/> `\{ss\}`:秒。<br/> `\{fff\}`:毫秒。<br/> `\{d\}`:天。<br/> `\{h\}`:小时。<br/> `\{m\}`:分钟。<br/> `\{s\}`:秒。<br/> `\{f\}`:毫秒。<br/> 示例:“\{b\}:\{c\}”
|
||||
|
||||
### LabelStyle.height
|
||||
|
||||
@@ -3761,12 +3755,6 @@ class in XCharts.Runtime / 继承自: [BaseSerie](#baseserie), [IComparable](htt
|
||||
|
||||
半径。radius[0]表示内径,radius[1]表示外径。
|
||||
|
||||
### Serie.realtimeSort
|
||||
|
||||
`bool` `false` `v3.14.0`
|
||||
|
||||
是否开启实时排序,用来实现动态排序图效果。目前仅在Bar中生效。
|
||||
|
||||
### Serie.right
|
||||
|
||||
`float`
|
||||
@@ -4828,17 +4816,11 @@ class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent)
|
||||
|
||||
边框线宽。
|
||||
|
||||
### Tooltip.columnGapWidths
|
||||
|
||||
`List<float>` `v3.14.0`
|
||||
|
||||
内容部分的列间距。当只有一列时,只表示第二列的间距。
|
||||
|
||||
### Tooltip.contentLabelStyles
|
||||
|
||||
`List<LabelStyle>`
|
||||
|
||||
内容部分的列文本样式列表。第一个表示第一列的文本样式,以此类推。
|
||||
内容部分的文本样式列表。和列一一对应。
|
||||
|
||||
### Tooltip.fixedHeight
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 704 KiB After Width: | Height: | Size: 293 KiB |
|
Before Width: | Height: | Size: 660 KiB After Width: | Height: | Size: 225 KiB |
|
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 11 KiB |
@@ -6,64 +6,74 @@ slug: /support
|
||||
|
||||
# 订阅服务
|
||||
|
||||
如需技术支持和扩展图表购买,可通过订阅 VIP 服务获取专属权益。企业商务合作请联系 QQ `3525422251` 或邮件至 `monitor1394@gmail.com`。
|
||||
如需技术支持和购买扩展图表,可订阅`VIP`服务。详情可查看以下内容,也可以加QQ`3525422251(XCharts技术支持)`或发邮件到`monitor1394@gmail.com`进行咨询。
|
||||
|
||||
## 订阅计划
|
||||
企业商务合作可QQ和邮件咨询。
|
||||
|
||||
### 订阅类型
|
||||
## 订阅VIP服务
|
||||
|
||||
- **个人订阅**
|
||||
- 归属个人,不可转让,服务仅限订阅者本人使用。
|
||||
- **企业订阅**
|
||||
- 归属企业,席位可分配给指定员工,支持席位变更(如员工离职后重新分配)。
|
||||
- 通过企业专属群组提供技术支持。
|
||||
订阅服务分`个人订阅`和`企业订阅`:
|
||||
|
||||
### 订阅优势
|
||||
- __个人订阅__:`个人VIP`属于个人,不可转让,`XCharts`团队只服务于订阅当事人。
|
||||
- __企业订阅__:`企业VIP`属于企业,席位内可安排固定职员,职员离职后席位可重新安排,`XCharts`团队通过专属企业群为企业服务。
|
||||
|
||||
- **高效支持**:快速定位技术问题,节省开发时间。
|
||||
- **深度交流**:与 XCharts 核心团队及开发者社区直接互动,获取行业经验。
|
||||
- **扩展功能**:解锁高级图表和 UI 组件,持续获得更新支持。
|
||||
- **社区共建**:加入 GitHub 组织,访问私有仓库,参与项目生态建设。
|
||||
- **专属标识**:在交流群中享有 VIP 身份标识,优先响应需求。
|
||||
订阅服务有哪些优势?
|
||||
|
||||
## 服务详情
|
||||
- __提高工作效率,节省时间成本__。`XCharts`功能强大,配置项众多,`VIP`服务可快速帮您定位,节省查找和核对的时间;`VIP`的即时回答服务可快速为您答疑解惑,快速上手,提高工作效率。
|
||||
- __更多技术交流,更多经验交流__。`XCharts`团队成员从业多年,有丰富的技术和工作经验。`VIP`服务不仅可以交流`XCharts`相关的内容,也可以咨询其他方面内容。`VIP`群也有更多的交流碰撞。
|
||||
- __订阅扩展图表,获得更新支持__。扩展图表需要订阅`VIP`服务后才能购买,扩展图表超过1年后的更新支持也需要持续订阅`VIP`服务。
|
||||
- __加入团队组织,参与社区建设__。订阅`VIP`后可加入`GitHub`组织,参与社区建设,访问专有仓库,扩展图表仓库等其他私有仓库。
|
||||
- __专属高级功能,专属身份标识__。订阅`VIP`后可以享有扩展UI组件,扩展图表等其他高级功能,XCharts后续也会陆续推出更多高级功能。在`XCharts交流群`里拥有`专属头衔`,方便快速识别,优先响应,第一时间回复VIP用户的各种问题。
|
||||
|
||||
| 权益/服务 | 免费用户 | 个人 VIP | 个人 SVIP | 企业 VIP | 企业 SVIP |
|
||||
|-------------------|----------|----------|-----------------|-----------------|----------------|
|
||||
| **订阅费用** | — | 298¥/年 | 首年 1298¥<br/>续费 298¥/年 | 首年 1698¥<br/>续费 298¥/年 | 定制报价 |
|
||||
| **服务时长** | — | 1 年 | 1 年 | 1 年 | 1 年 |
|
||||
| **服务席位** | — | 1 个 | 1 个 | 1 个 | ≥5 个 |
|
||||
| **增加席位** | — | — | — | 支持(298¥/席位/年) | 支持(定制报价)|
|
||||
| **支持方式** | | | | | |
|
||||
| - Github Issues | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 官方 QQ 群 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - QQ 一对一支持 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 专属 VIP 群 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 微信支持 | — | — | — | ✔️ | ✔️ |
|
||||
| - 电话支持 | — | — | — | — | ✔️ |
|
||||
| - 专属企业群 | — | — | — | — | ✔️ |
|
||||
| **核心权益** | | | | | |
|
||||
| - 商用与二次开发 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 即时技术支持 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 开发优化指导 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 需求优先处理 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 付费定制 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 扩展 UI 组件 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 扩展图表免费使用 | — | 按需购买 | ✔️(全量) | ✔️(全量) | ✔️(全量) |
|
||||
| **企业专属权益** | | | | | |
|
||||
| - 电子发票 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 专用发票 | — | — | — | ✔️ | ✔️ |
|
||||
| - 首页赞助展示 | — | — | — | — | ✔️ |
|
||||
| **源码与更新** | | | | | |
|
||||
| - 永久持有源码 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| - 1 年更新支持 | — | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| **GitHub 仓库权限**| 公开仓库 | +UI 扩展组件 | +Pro 扩展图表 | +Pro 扩展图表 | +Pro 扩展图表 |
|
||||
| |免费用户|付费咨询|个人`VIP` | 个人`SVIP` | 企业`VIP` | 企业`SVIP` |
|
||||
| ----- |--|--|--|--|--|--|
|
||||
| 订阅费用 | -- | `98`¥ | `298`¥ | 首年`1298`¥<br/>后续`298¥`* | 首年`1698`¥<br/>后续`298¥`* | `联系我们` |
|
||||
| 订阅时长 | -- | `7`天* | `1`年 | `1`年 | `1`年 | `1`年 |
|
||||
| 拥有席位 | -- | `1`个席位 | `1`个席位 |`1`个席位|`1`个席位|`5`个以上席位|
|
||||
| 增加席位 | -- | -- | -- | -- |支持|支持|
|
||||
| __`服务方式:`__|
|
||||
| 官方QQ群交流 | √ | √ | √ | √ | √ | √ |
|
||||
| QQ一对一交流 | | √ | √ | √ | √ | √ |
|
||||
| 专属VIP群交流 | | | √ | √ | √ | √ |
|
||||
| 微信交流 | | | | | √ | √(企业专属群) |
|
||||
| 电话交流 | | | | | | √ |
|
||||
| __`服务内容:`__|
|
||||
| 可商用可二次开发 | √ | √ | √ | √ | √ | √ |
|
||||
| 有问即答 | | √ | √ | √ | √ | √ |
|
||||
| 新手入门指导 | | √ | √ | √ | √ | √ |
|
||||
| 开发优化指导 | | √ | √ | √ | √ | √ |
|
||||
| 其他技术支持 | | | √ | √ | √ | √ |
|
||||
| 问题及时处理 | | | √ | √ | √ | √ |
|
||||
| 需求优先考虑 | | | √ | √ | √ | √ |
|
||||
| 可另付费定制 | | | √ | √ | √ | √ |
|
||||
| 可另付费加急 | | | √ | √ | √ | √ |
|
||||
| 扩展UI组件 | | | √ | √ | √ | √ |
|
||||
| 首页赞助展示 | | | | | | √ |
|
||||
| 付费方式 | | | 二维码 | 二维码 | __公对公转账__* | __公对公转账__* |
|
||||
| 支持开发票 | | | 普票 | 普票 | __可开专票__ | __可开专票__ |
|
||||
| 扩展图表购买 | | | 按需购买 | __全部免费__* | __全部免费__* | __全部免费__* |
|
||||
| 扩展图表源码 | | | 永久持有 | 永久持有 | 永久持有 | 永久持有 |
|
||||
| 扩展图表更新 | | | 1年更新支持 | 1年更新支持 | 1年更新支持 | 1年更新支持 |
|
||||
| Github仓库 | XCharts<br/>[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo) | XCharts<br/>[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo) | XCharts<br/>[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)<br/>[XCharts-UI](https://github.com/XCharts-Team/XCharts-UI) | XCharts<br/>[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)<br/>[XCharts-UI](https://github.com/XCharts-Team/XCharts-UI)<br/>[XCharts-Pro](https://github.com/XCharts-Team/XCharts-Pro)<br/>[XCharts-Pro-Demo](https://github.com/XCharts-Team/XCharts-Pro-Demo) | XCharts<br/>[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)<br/>[XCharts-UI](https://github.com/XCharts-Team/XCharts-UI)<br/>[XCharts-Pro](https://github.com/XCharts-Team/XCharts-Pro)<br/>[XCharts-Pro-Demo](https://github.com/XCharts-Team/XCharts-Pro-Demo) | XCharts<br/>[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)<br/>[XCharts-UI](https://github.com/XCharts-Team/XCharts-UI)<br/>[XCharts-Pro](https://github.com/XCharts-Team/XCharts-Pro)<br/>[XCharts-Pro-Demo](https://github.com/XCharts-Team/XCharts-Pro-Demo) |
|
||||
|
||||
## 扩展图表
|
||||
>备注:
|
||||
>*__`付费定制`__ 用户可根据自己的需求可付费定制不同的图表或新功能,只有`VIP`用户才享有`付费定制`权利。
|
||||
>*__`付费加急`__ 用户可对已在开发计划中或正在开发中的功能进行付费加急,将开发优先级提到最高,并可要求在指定`截止日期`内交付,只有`VIP`用户才享有`付费加急`权利。
|
||||
>*__`付费咨询`__ 付费咨询有效期`7`天,且总咨询时长不超过`7`个小时。
|
||||
>*__`扩展图表`__ 购买后代码可永久持有和商用,1年的更新和技术支持。可继续订阅VIP延长服务时间。
|
||||
>*__`全部免费`__ 是指在订阅期间的`个人SVIP`和`企业VIP`的订阅用户,可免费使用全部的扩展图表。
|
||||
>*__`次年付费`__ 个人SVIP和企业VIP的首年和次年付费不一样,次年付费都是`298¥`。
|
||||
>*__`增加席位`__ 企业VIP支持增加席位,每个席位`298¥`一年。
|
||||
>*__`对公转账`__ 有开专票需求时,可用企业银行帐号进行公对公转账支付。二维码支付不支持开专票,只能开普票。发票默认都是电子发票。
|
||||
>*__`登记资料`__ 订阅成功后,需提供手机号和Github帐号进行登记,手机号用于确认归属,Github帐号用于加入Github的Team组织,下载源码。
|
||||
|
||||
以下扩展图表需订阅 VIP 后购买(个人SVIP 及企业 VIP 用户可免费使用全量图表):
|
||||
## 购买扩展图表
|
||||
|
||||
|编号|扩展图表|图表类名|价格|
|
||||
扩展图表为另付费购买图表,只对订阅了`VIP`服务的用户开放购买。对于`个人SVIP`和`企业VIP`的订阅用户,所有扩展图表仓库在订阅期间可全部免费使用,不用再单独购买。
|
||||
|
||||
对所有已购买的扩展图表,源码可永久持有但不能传播,并获得持续一年的更新支持和技术服务,一年后如需更新支持等服务,可再继续订阅`VIP`服务。
|
||||
|
||||
|编号|扩展图表|扩展图表|价格|
|
||||
|--|--|--|--|
|
||||
| 101 | [象形柱图](https://xcharts-team.github.io/docs/pictorialbar) |PictorialBarChart | 98¥ |
|
||||
| 102 | [漏斗图](https://xcharts-team.github.io/docs/funnel) |FunnelChart | 98¥ |
|
||||
@@ -78,15 +88,15 @@ slug: /support
|
||||
| 206 | [3D折线图](https://xcharts-team.github.io/docs/line3d) |Line3DChart | 198¥ |
|
||||
| 207 | [关系图](https://xcharts-team.github.io/docs/graph) |GraphChart | 198¥ |
|
||||
|
||||
## 附注说明
|
||||
扩展图表的在线效果图也可以查看[WebGL在线Demo](https://xcharts-team.github.io/examples/)
|
||||
|
||||
1. **扩展图表更新**:购买后享 1 年免费更新,续订 VIP 可延长服务周期。
|
||||
2. **企业订阅**:支持公对公转账与专用发票,席位可灵活调整。
|
||||
3. **定制服务**:VIP 用户可额外付费定制功能或加急需求开发。
|
||||
## 捐助支持
|
||||
|
||||
## 支持我们
|
||||
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎扫后面的二维码进行任意金额的捐助,XCharts需要您的支持和帮助。
|
||||
|
||||
- **社区支持**:欢迎在 GitHub 为 XCharts 点 ⭐️ [Star 支持](https://github.com/XCharts-Team/XCharts)
|
||||
- **扫码捐助**:
|
||||

|
||||

|
||||
## 二维码
|
||||
|
||||
如果看不到二维码图片,可以加Q联系`XCharts技术支持:3525422251`或邮件`monitor1394@gmail.com`咨询。
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -15,7 +15,6 @@ namespace XCharts.Editor
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Delay");
|
||||
PropertyField(prop, "m_Duration");
|
||||
PropertyField(prop, "m_Speed");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +30,6 @@ namespace XCharts.Editor
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Duration");
|
||||
PropertyField(prop, "m_Speed");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
@@ -47,7 +45,6 @@ namespace XCharts.Editor
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Duration");
|
||||
PropertyField(prop, "m_Speed");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace XCharts.Editor
|
||||
});
|
||||
PropertyField("m_LineStyle");
|
||||
PropertyField("m_TitleLabelStyle");
|
||||
PropertyListField("m_ColumnGapWidths");
|
||||
PropertyListField("m_ContentLabelStyles");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
|
||||
@@ -22,11 +22,6 @@ namespace XCharts.Editor
|
||||
PropertyField("m_BarWidth");
|
||||
PropertyField("m_BarGap");
|
||||
PropertyField("m_BarMaxWidth");
|
||||
PropertyField("m_RealtimeSort");
|
||||
if(serie.useSortData)
|
||||
{
|
||||
PropertyField("m_DataSortType");
|
||||
}
|
||||
if (serie.IsUseCoord<PolarCoord>())
|
||||
{
|
||||
PropertyField("m_RoundCap");
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace XCharts.Example
|
||||
}
|
||||
}
|
||||
|
||||
float SymbolSize(float defaultSize, SerieData serieData)
|
||||
float SymbolSize(List<double> data)
|
||||
{
|
||||
return defaultSize;
|
||||
return (float) (Math.Sqrt(data[2]) / 6e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
137
README.md
@@ -38,7 +38,7 @@ A powerful, easy-to-use, configurable charting and data visualization library fo
|
||||
|
||||

|
||||
|
||||
XCharts 是一款基于 UGUI 的功能强大、简单易用的 Unity 数据可视化图表插件。它提供了丰富的图表类型和灵活的配置选项,帮助开发者快速实现专业级的数据可视化效果。支持折线图、柱状图、饼图、雷达图、散点图、热力图、环形图、K线图、极坐标、平行坐标等十多种常用的内置图表。提供3D饼图、3D柱图、3D金字塔、漏斗图、仪表盘、水位图、象形柱图、甘特图、矩形树图、桑基图、3D折线图、关系图等十多种高级扩展图表。
|
||||
一款基于`UGUI`的功能强大的简单易用的`Unity`数据可视化图表插件。支持`折线图`、`柱状图`、`饼图`、`雷达图`、`散点图`、`热力图`、`环形图`、`K线图`、`极坐标`、`平行坐标`等十几种内置图表,以及`3D饼图`、`3D柱图`、`3D金字塔`、`漏斗图`、`仪表盘`、`水位图`、`象形柱图`、`甘特图`、`矩形树图`、`桑基图`、`3D折线图`、`关系图`等十几种扩展图表。
|
||||
|
||||
[XCharts 官方主页](https://xcharts-team.github.io)
|
||||
[XCharts 在线示例](https://xcharts-team.github.io/examples)
|
||||
@@ -52,24 +52,25 @@ XCharts 是一款基于 UGUI 的功能强大、简单易用的 Unity 数据可
|
||||
|
||||
## 特性
|
||||
|
||||
- __纯代码绘制__:图表完全通过代码生成,无需额外贴图或 Shader 资源,轻量高效。
|
||||
- __可视化配置__:提供直观的参数配置界面,支持实时预览效果,并可在运行时动态修改配置和数据。
|
||||
- __高度定制化__:支持从主题、组件到数据项的全面参数设置,同时允许通过代码自定义绘制逻辑、回调函数及图表实现。
|
||||
- __多内置图表__:支持线图、柱状图、饼图、雷达图、散点图、热力图、环形图、K线图、极坐标、平行坐标等多种常用的内置图表。
|
||||
- __多扩展图表__:支持3D柱图、3D饼图、漏斗图、金字塔、仪表盘、水位图、象形柱图、甘特图、矩形树图、桑基图、3D折线图、关系图等多种高级扩展图表,满足复杂数据可视化需求。
|
||||
- __多扩展组件__:支持多种实用 UI 组件,如表格、统计数值、滑动条、进度条等,增强图表交互性。
|
||||
- __多图表组合__:支持在同一图表中组合显示多个相同或不同类型的图表,满足复杂场景需求。
|
||||
- __多种坐标系__:支持直角坐标系、极坐标系、单轴等多种坐标系,适应不同数据展示需求。
|
||||
- __丰富的组件__:提供标题、图例、提示框、标线、标域、数据区域缩放、视觉映射等常用组件,提升图表可读性。
|
||||
- __多样式线图__:支持直线、曲线、虚线、面积图、阶梯线图等多种线图样式,满足不同数据趋势展示需求。
|
||||
- __多样式柱图__:支持并列柱图、堆叠柱图、堆积百分比柱图、斑马柱图、胶囊柱图等多种柱状图样式。
|
||||
- __多样式饼图__:支持环形图、玫瑰图、环形玫瑰图等多种饼图样式,直观展示数据占比。
|
||||
- __自定义绘制__:提供强大的绘图 API,支持自定义绘制点、线、面等图形,满足个性化需求。
|
||||
- __大数据绘制__:支持万级数据量绘制,优化性能表现;支持采样绘制,进一步提升大数据场景下的性能。
|
||||
- __自定义主题__:支持主题定制、导入和导出,内置明暗两种默认主题,轻松适配不同应用场景。
|
||||
- __动画和交互__:支持渐入、渐出、变更、新增等多种动画效果,以及数据筛选、视图缩放、细节展示等交互操作,提升用户体验。
|
||||
- __第三方扩展__:无缝集成TexMeshPro和New Input System,扩展功能兼容性。
|
||||
- __版本和兼容__:支持 Unity 5.6 及以上版本,兼容全平台运行。
|
||||
- __纯代码绘制__:图表纯代码绘制,无需额外的贴图和Shader资源。
|
||||
- __可视化配置__:参数可视化配置,效果实时预览,支持运行时代码动态修改配置和数据。
|
||||
- __高自由定制__:支持从主题和配置参数上任意调整;支持代码自定义绘制,自定义回调以及自定义实现图表。
|
||||
- __多内置图表__:支持线图、柱状图、饼图、雷达图、散点图、热力图、环形图、K线图、极坐标、平行坐标等多种内置图表。
|
||||
- __多扩展图表__:支持3D柱图、3D饼图、漏斗图、金字塔、仪表盘、水位图、象形柱图、甘特图、矩形树图、桑基图、3D折线图、关系图等多种扩展图表。
|
||||
- __多扩展组件__:支持表格、统计数值等多种扩展UI组件。
|
||||
- __多图表组合__:支持内置图表的任意组合,同一图中可同时显示多个相同或不同类型的图表。
|
||||
- __多种坐标系__:支持直角坐标系、极坐标系、单轴等多种坐标系。
|
||||
- __丰富的组件__:支持标题、图例、提示框、标线、标域、数据区域缩放、视觉映射等常用组件。
|
||||
- __多样式线图__:支持直线图、曲线图、虚线图、面积图、阶梯线图等多种线图。
|
||||
- __多样式柱图__:支持并列柱图、堆叠柱图、堆积百分比柱图、斑马柱图、胶囊柱图等多种柱状图。
|
||||
- __多样式饼图__:支持环形图、玫瑰图、环形玫瑰图等多种饼图。
|
||||
- __丰富的线条__:支持实线、曲线、阶梯线、虚线、点线、点划线、双点划线等线条。
|
||||
- __自定义绘制__:支持自定义图表内容绘制,提供绘制点、线、面等其他图形的强大的绘图API。
|
||||
- __大数据绘制__:支持万级大数据量绘制;支持采样绘制;特殊的简化图表支持更优的性能。
|
||||
- __自定义主题__:支持主题定制、导入和导出,内置明暗两种默认主题。
|
||||
- __动画和交互__:支持渐入动画、渐出动画、变更动画、新增动画、交互动画等多种动画;支持多平台的数据筛选、视图缩放、细节展示等交互操作。
|
||||
- __第三方扩展__:支持无缝接入`TexMeshPro`和`New Input System`。
|
||||
- __版本和兼容__:支持所有`5.6`以上的`Unity`版本;支持全平台运行。
|
||||
|
||||
## 截图
|
||||
|
||||
@@ -77,6 +78,36 @@ XCharts 是一款基于 UGUI 的功能强大、简单易用的 Unity 数据可
|
||||
|
||||

|
||||
|
||||
## 仓库
|
||||
|
||||
- __[XCharts](https://github.com/XCharts-Team/XCharts)__ XCharts核心功能,完全免费。
|
||||
- __[XCharts-Daemon](https://github.com/XCharts-Team/XCharts-Daemon)__ XCharts守护程序,用于确保XCharts更新时的编译正常。非必须,但建议使用。
|
||||
- __[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)__ XCharts官方示例,不包含扩展图表部分。订阅购买扩展图表后可导入示例。
|
||||
- __[XCharts-Pro](https://github.com/XCharts-Team/XCharts-Pro)__ XCharts专业版,包含所有扩展图表和扩展组件。订阅SVIP后可访问使用。
|
||||
- __[XCharts-Pro-Demo](https://github.com/XCharts-Team/XCharts-Pro-Demo)__ XCharts专业版官方示例,包含所有扩展图表和扩展组件的示例。订阅SVIP后可访问使用。
|
||||
- __[XCharts-UI](https://github.com/XCharts-Team/XCharts-UI)__ XCharts的扩展UI组件。订阅VIP后可访问使用。
|
||||
- __[XCharts-Bar3DChart](https://github.com/XCharts-Team/XCharts-Bar3DChart)__ XCharts扩展图表:3D柱图。订阅购买后可访问使用。
|
||||
- __[XCharts-FunnelChart](https://github.com/XCharts-Team/XCharts-FunnelChart)__ XCharts扩展图表:漏斗图。订阅购买后可访问使用。
|
||||
- __[XCharts-GanttChart](https://github.com/XCharts-Team/XCharts-GanttChart)__ XCharts扩展图表:甘特图。订阅购买后可访问使用。
|
||||
- __[XCharts-GaugeChart](https://github.com/XCharts-Team/XCharts-GaugeChart)__ XCharts扩展图表:仪表盘。订阅购买后可访问使用。
|
||||
- __[XCharts-LiquidChart](https://github.com/XCharts-Team/XCharts-LiquidChart)__ XCharts扩展图表:水位图。订阅购买后可访问使用。
|
||||
- __[XCharts-PictorialBarChart](https://github.com/XCharts-Team/XCharts-PictorialBarChart)__ XCharts扩展图表:象形住图。订阅购买后可访问使用。
|
||||
- __[XCharts-Pie3DChart](https://github.com/XCharts-Team/XCharts-Pie3DChart)__ XCharts扩展图表:3D饼图。订阅购买后可访问使用。
|
||||
- __[XCharts-PyramidChart](https://github.com/XCharts-Team/XCharts-PyramidChart)__ XCharts扩展图表:3D金字塔。订阅购买后可访问使用。
|
||||
- __[XCharts-TreemapChart](https://github.com/XCharts-Team/XCharts-TreemapChart)__ XCharts扩展图表:矩形树图。订阅购买后可访问使用。
|
||||
- __[XCharts-SankeyChart](https://github.com/XCharts-Team/XCharts-SankeyChart)__ XCharts扩展图表:桑基图。订阅购买后可访问使用。
|
||||
- __[XCharts-Line3DChart](https://github.com/XCharts-Team/XCharts-Line3DChart)__ XCharts扩展图表:3D折线图。订阅购买后可访问使用。
|
||||
- __[XCharts-GraphChart](https://github.com/XCharts-Team/XCharts-GraphChart)__ XCharts扩展图表:关系图。订阅购买后可访问使用。
|
||||
|
||||
## 分支
|
||||
|
||||
- __[master](https://github.com/XCharts-Team/XCharts/tree/master)__ XCharts3.0的开发分支。最新的修改和功能都先提交到`master`分支,稳定后再发布`release`版本。
|
||||
- __[3.0](https://github.com/XCharts-Team/XCharts/tree/3.0)__ XCharts3.0的稳定分支。一般一个月一发布,`master`分支稳定后,`merge`到`3.0`分支,并发布`release`版本。
|
||||
- __[2.0](https://github.com/XCharts-Team/XCharts/tree/2.0)__ XCharts2.0的稳定分支。带Demo,目前基本不再维护,仅修改严重bug。
|
||||
- __[2.0-upm](https://github.com/XCharts-Team/XCharts/tree/2.0-upm)__ XCharts2.0的稳定UMP分支。不带Demo,只包含Package部分,不再维护。
|
||||
- __[1.0](https://github.com/XCharts-Team/XCharts/tree/1.0)__ XCharts1.0的稳定分支。带Demo,不再维护。
|
||||
- __[1.0-upm](https://github.com/XCharts-Team/XCharts/tree/1.0-upm)__ XCharts1.0的稳定UMP分支。不带Demo,不再维护。
|
||||
|
||||
## 使用
|
||||
|
||||
- 导入`XCharts`的`unitypackage`或者源码到项目。建议也导入`XCharts`守护程序 [XCharts-Daemon](https://github.com/XCharts-Team/XCharts-Daemon)。
|
||||
@@ -86,67 +117,47 @@ XCharts 是一款基于 UGUI 的功能强大、简单易用的 Unity 数据可
|
||||
- 更多细节,请看[【XCharts教程:5分钟上手教程】](Documentation~/zh/tutorial01.md)。
|
||||
- 首次使用,建议先认真看一遍教程。
|
||||
|
||||
## 常见问题 (FAQ)
|
||||
## 注意
|
||||
|
||||
- __XCharts 可以免费使用吗?__
|
||||
XCharts 基于 MIT 协议,核心功能完全免费。您也可以订阅 VIP 服务,享受更多高级功能和专属技术支持。
|
||||
- __XCharts3.0不完全兼容XCharts2.0版本。__ 升级`3.0`时,部分代码和配置可能需要重新调整。建议旧项目可以继续使用`XCharts2.0`,新项目推荐使用`XCharts3.0`。
|
||||
- __XCharts2.0只维护不加新功能。__ `2.0`只修复严重`bug`,原则上不再加新功能。
|
||||
- __XCharts支持Unity 5.6及以上版本。__ 但由于版本测试有限难免疏漏,发现问题可提`Issue`。
|
||||
- __本仓库只包含XCharts源码,不包含Demo示例部分。__ 需要查看`Demo`示例源码请到[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)仓库。也可以在浏览器查看运行效果 [在线Demo](https://xcharts-team.github.io/examples/) 。
|
||||
|
||||
- __XCharts 支持代码动态添加和修改数据吗?__
|
||||
是的,XCharts 提供了丰富的数据操作接口,支持代码动态修改配置和数据。但数据来源(如 Excel 或数据库)需要您自行解析后调用 XCharts 接口添加到图表中。
|
||||
## FAQ
|
||||
|
||||
- __XCharts 支持哪些平台?__
|
||||
XCharts 专为 Unity 平台设计,支持 Unity 5.6 及以上版本。理论上,任何支持 UGUI 的 Unity 版本均可运行 XCharts。目前不支持 Winform 或 WPF 等其他平台。
|
||||
- __XCharts可以免费使用吗?__
|
||||
`XCharts`使用`MIT`协议,可以免费使用。也可以订阅`VIP`享受更多增值服务。
|
||||
|
||||
- __如何解决锯齿问题?XCharts 支持多大的数据量?__
|
||||
XCharts 基于 UGUI 实现,因此 UGUI 的常见问题(如锯齿、Mesh 顶点数限制)在 XCharts 中也会存在。
|
||||
- __锯齿问题__:可通过调整抗锯齿设置或使用更高分辨率解决。
|
||||
- __数据量限制__:单条折线图(Line)支持约 2 万数据点,开启采样后可支持更多数据,但会消耗更多 CPU 资源。
|
||||
更多解决方案请参考 [问答 16](Documentation~/zh/faq.md) 和 [问答 27](Documentation~/zh/faq.md)。
|
||||
- __XCharts支持代码动态添加和修改数据吗?支持从`Excel`或数据库中获取数据吗?__
|
||||
`XCharts`提供了各种数据操作的接口,支持代码动态修改配置,添加和修改数据,但数据来源需要自己解析和获取,再调用`XCharts`的接口添加到图表。
|
||||
|
||||
- __哪里可以查看 Demo?__
|
||||
本仓库仅包含 XCharts 源码,Demo 示例请访问 [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo) 仓库。您也可以在浏览器中查看 [在线 Demo](https://xcharts-team.github.io/examples/)。
|
||||
- __XCharts除了用在Unity平台,还能用在Winform或WPF等平台吗?__
|
||||
`XCharts`只支持在`Unity`平台使用。理论上任何支持`UGUI`的`Unity`版本都能运行`XCharts`。
|
||||
|
||||
- __锯齿怎么解决?支持多大量级的数据?__
|
||||
`XCharts`是基于`UGUI`实现的,所以`UGUI`中碰到的问题,在`XCharts`中也会存在。比如锯齿问题,比如`Mesh`顶点数超`65535`的问题。这两个问题的解决可参考[问答16](Documentation~/zh/faq.md)和[问答27](Documentation~/zh/faq.md)。
|
||||
由于`Mesh`的`65535`顶点数的限制,目前`XCharts`的单条`Line`支持约`2万`的数据量,当然开启采样可以支持更多数据的绘制,但同时也会更消耗CPU。
|
||||
|
||||
## 日志
|
||||
|
||||
- 各版本的详细更新日志请查看 [更新日志](Documentation~/zh/changelog.md)
|
||||
|
||||
## 扩展
|
||||
## Licenses
|
||||
|
||||
- __[XCharts](https://github.com/XCharts-Team/XCharts)__ 核心功能,完全开源免费
|
||||
- __[XCharts-Daemon](https://github.com/XCharts-Team/XCharts-Daemon)__ 守护程序,确保XCharts更新时的编译正常
|
||||
- __[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)__ 官方示例(不包含扩展图表的示例)
|
||||
- __[XCharts-Pro](https://github.com/XCharts-Team/XCharts-Pro)__ 专业版,包含所有扩展图表和扩展组件(需订阅 SVIP)
|
||||
- __[XCharts-Pro-Demo](https://github.com/XCharts-Team/XCharts-Pro-Demo)__ 专业版官方示例(需订阅 SVIP)
|
||||
- __[XCharts-UI](https://github.com/XCharts-Team/XCharts-UI)__ 扩展UI组件(需订阅 VIP)
|
||||
- __[XCharts-Bar3DChart](https://github.com/XCharts-Team/XCharts-Bar3DChart)__ 3D柱图(需订阅 VIP)
|
||||
- __[XCharts-FunnelChart](https://github.com/XCharts-Team/XCharts-FunnelChart)__ 漏斗图(需订阅 VIP)
|
||||
- __[XCharts-GanttChart](https://github.com/XCharts-Team/XCharts-GanttChart)__ 甘特图(需订阅 VIP)
|
||||
- __[XCharts-GaugeChart](https://github.com/XCharts-Team/XCharts-GaugeChart)__ 仪表盘(需订阅 VIP)
|
||||
- __[XCharts-LiquidChart](https://github.com/XCharts-Team/XCharts-LiquidChart)__ 水位图(需订阅 VIP)
|
||||
- __[XCharts-PictorialBarChart](https://github.com/XCharts-Team/XCharts-PictorialBarChart)__ 象形住图(需订阅 VIP)
|
||||
- __[XCharts-Pie3DChart](https://github.com/XCharts-Team/XCharts-Pie3DChart)__ 3D饼图(需订阅 VIP)
|
||||
- __[XCharts-PyramidChart](https://github.com/XCharts-Team/XCharts-PyramidChart)__ 3D金字塔(需订阅 VIP)
|
||||
- __[XCharts-TreemapChart](https://github.com/XCharts-Team/XCharts-TreemapChart)__ 矩形树图(需订阅 VIP)
|
||||
- __[XCharts-SankeyChart](https://github.com/XCharts-Team/XCharts-SankeyChart)__ 桑基图(需订阅 VIP)
|
||||
- __[XCharts-Line3DChart](https://github.com/XCharts-Team/XCharts-Line3DChart)__ 3D折线图(需订阅 VIP)
|
||||
- __[XCharts-GraphChart](https://github.com/XCharts-Team/XCharts-GraphChart)__ 关系图(需订阅 VIP)
|
||||
|
||||
## 许可
|
||||
|
||||
- __[MIT License](https://github.com/XCharts-Team/XCharts/blob/master/LICENSE.md)__:XCharts 核心库基于 MIT 协议,允许免费商用和二次开发。
|
||||
|
||||
- __扩展功能授权__:扩展图表和高级功能需订阅 VIP 或 SVIP 服务获得使用许可。
|
||||
- [MIT License](https://github.com/XCharts-Team/XCharts/blob/master/LICENSE.md)
|
||||
- 可免费商用,可二次开发。
|
||||
- 扩展图表和高级功能部分需购买使用授权。
|
||||
|
||||
## 订阅
|
||||
|
||||
- __核心功能免费__:XCharts 核心库基于 MIT 协议完全开源,可免费使用。
|
||||
- __增值服务__:为满足多样化需求,我们提供多种订阅服务,详情请查看 [订阅详情](Documentation~/zh/support.md)。
|
||||
- __灵活选择__:订阅非强制,不影响核心功能使用。
|
||||
- __按年付费__:订阅服务按年计费,到期后可选择续订。中断订阅后,将无法享受更新和技术支持服务。
|
||||
- `XCharts`核心库是开源的,可免费使用的。在此基础上,我们也提供多种订阅服务以满足不同用户的需求,订阅详情[☞ 请看这里](Documentation~/zh/support.md)。
|
||||
- 订阅不是必须的,不影响`XCharts`的核心功能使用。
|
||||
- 订阅是按年付费,订阅到期后,不要求必须续订,但中断订阅期间无法享受技术更新和支持等服务。
|
||||
|
||||
## 其他
|
||||
|
||||
- 邮箱:`monitor1394@gmail.com`
|
||||
- QQ群:XCharts交流群(`202030963`)
|
||||
- VIP群:XCharts VIP群(`867291970`)
|
||||
- 支持与合作:[订阅与支持](Documentation~/zh/support.md)
|
||||
- 捐助、合作、订阅和技术支持:[☞ 请看这里](Documentation~/zh/support.md)
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace XCharts.Runtime
|
||||
[SerializeField][Since("v3.8.0")] private bool m_Reverse = false;
|
||||
[SerializeField][Since("v3.8.0")] private float m_Delay = 0;
|
||||
[SerializeField][Since("v3.8.0")] private float m_Duration = 1000;
|
||||
[SerializeField][Since("v3.14.0")] private float m_Speed = 0;
|
||||
public AnimationInfoContext context = new AnimationInfoContext();
|
||||
|
||||
/// <summary>
|
||||
@@ -35,15 +34,11 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public float delay { get { return m_Delay; } set { m_Delay = value; } }
|
||||
/// <summary>
|
||||
/// the duration of animation. Default is used to calculate the speed of animation. It can also be specified by speed.
|
||||
/// ||动画的时长。默认用于计算动画的速度。也可以通过speed指定速度。
|
||||
/// the duration of animation.
|
||||
/// ||动画的时长。
|
||||
/// </summary>
|
||||
public float duration { get { return m_Duration; } set { m_Duration = value; } }
|
||||
/// <summary>
|
||||
/// the speed of animation. When speed is specified, duration will be invalid. Default is 0, which means no speed specified.
|
||||
/// ||动画的速度。当指定speed时,duration将失效。默认为0,表示不指定速度。
|
||||
/// </summary>
|
||||
public float speed { get { return m_Speed; } set { m_Speed = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// the callback function of animation start.
|
||||
/// ||动画开始的回调。
|
||||
@@ -152,7 +147,6 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (!enable) return;
|
||||
if (!context.start || context.end) return;
|
||||
context.init = false;
|
||||
context.start = false;
|
||||
context.end = true;
|
||||
context.currPointIndex = context.destPointIndex;
|
||||
@@ -174,19 +168,20 @@ namespace XCharts.Runtime
|
||||
public bool Init(float curr, float dest, int totalPointIndex)
|
||||
{
|
||||
if (!enable || !context.start) return false;
|
||||
if (context.init || context.end) return false;
|
||||
context.init = true;
|
||||
context.totalProgress = dest - curr;
|
||||
context.destPointIndex = totalPointIndex;
|
||||
if (reverse)
|
||||
{
|
||||
if (!context.init) context.currProgress = dest;
|
||||
context.currProgress = dest;
|
||||
context.destProgress = curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!context.init) context.currProgress = curr;
|
||||
context.currProgress = curr;
|
||||
context.destProgress = dest;
|
||||
}
|
||||
context.init = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -213,7 +208,7 @@ namespace XCharts.Runtime
|
||||
if (!context.start)
|
||||
return false;
|
||||
else
|
||||
return m_Delay > 0 && Time.time - context.startTime < m_Delay / 1000;
|
||||
return (m_Delay > 0 && Time.time - context.startTime < m_Delay / 1000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -290,7 +285,8 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (!context.start || !context.init || context.pause) return;
|
||||
if (IsInDelay()) return;
|
||||
var delta = GetDelta(total, m_UnscaledTime);
|
||||
var duration = GetCurrAnimationDuration();
|
||||
var delta = (float)(total / duration * (m_UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime));
|
||||
if (reverse)
|
||||
{
|
||||
context.currProgress -= delta;
|
||||
@@ -334,7 +330,8 @@ namespace XCharts.Runtime
|
||||
}
|
||||
else
|
||||
{
|
||||
var delta = GetDelta(destProgress - startProgress, m_UnscaledTime);
|
||||
var duration = GetCurrAnimationDuration(dataIndex);
|
||||
var delta = (destProgress - startProgress) / duration * (m_UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime);
|
||||
currHig += delta;
|
||||
if (reverse)
|
||||
{
|
||||
@@ -365,7 +362,8 @@ namespace XCharts.Runtime
|
||||
if (IsInDelay())
|
||||
return;
|
||||
|
||||
var delta = GetDelta(dest, m_UnscaledTime);
|
||||
var duration = GetCurrAnimationDuration();
|
||||
var delta = dest / duration * (m_UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime);
|
||||
if (reverse)
|
||||
{
|
||||
context.sizeProgress -= delta;
|
||||
@@ -379,20 +377,6 @@ namespace XCharts.Runtime
|
||||
context.sizeProgress = dest;
|
||||
}
|
||||
}
|
||||
|
||||
private float GetDelta(double total, bool unscaledTime)
|
||||
{
|
||||
if (m_Speed > 0)
|
||||
{
|
||||
context.currDuration = (float)total / m_Speed;
|
||||
return (float)(m_Speed * (unscaledTime ? Time.unscaledDeltaTime : Time.deltaTime));
|
||||
}
|
||||
else
|
||||
{
|
||||
context.currDuration = 0;
|
||||
return (float)(total / GetCurrAnimationDuration() * (unscaledTime ? Time.unscaledDeltaTime : Time.deltaTime));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -17,7 +17,6 @@ namespace XCharts.Runtime
|
||||
public float sizeProgress;
|
||||
public int currPointIndex;
|
||||
public int destPointIndex;
|
||||
public float currDuration;
|
||||
public Vector3 currPoint;
|
||||
public Vector3 destPoint;
|
||||
public Dictionary<int, float> dataCurrProgress = new Dictionary<int, float>();
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace XCharts.Runtime
|
||||
startIndex = anim.context.currPointIndex == paths.Count - 1 ?
|
||||
paths.Count - 2 :
|
||||
anim.context.currPointIndex;
|
||||
if (startIndex < 0 || startIndex >= paths.Count - 1) return;
|
||||
if (startIndex < 0 || startIndex > paths.Count - 2) startIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -336,12 +336,9 @@ namespace XCharts.Runtime
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (anim.Init(currDetailProgress, totalDetailProgress, paths.Count - 1))
|
||||
{
|
||||
anim.context.currPoint = sp;
|
||||
anim.context.destPoint = ep;
|
||||
}
|
||||
anim.context.currPoint = sp;
|
||||
anim.context.destPoint = ep;
|
||||
anim.Init(currDetailProgress, totalDetailProgress, paths.Count - 1);
|
||||
}
|
||||
|
||||
public bool IsEnd()
|
||||
@@ -365,23 +362,12 @@ namespace XCharts.Runtime
|
||||
return true;
|
||||
var animation = activedAnimation;
|
||||
if (animation != null && animation.context.end)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (IsSerieAnimation())
|
||||
{
|
||||
if (m_FadeOut.context.start)
|
||||
{
|
||||
return m_FadeOut.context.currProgress <= m_FadeOut.context.destProgress;
|
||||
}
|
||||
else if (m_Addition.context.start)
|
||||
{
|
||||
return m_Addition.context.currProgress >= m_Addition.context.destProgress;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_FadeIn.context.currProgress >= m_FadeIn.context.destProgress;
|
||||
}
|
||||
if (m_FadeOut.context.start) return m_FadeOut.context.currProgress <= m_FadeOut.context.destProgress;
|
||||
else if (m_Addition.context.start) return m_Addition.context.currProgress >= m_Addition.context.destProgress;
|
||||
else return m_FadeIn.context.currProgress >= m_FadeIn.context.destProgress;
|
||||
}
|
||||
else if (IsDataAnimation())
|
||||
{
|
||||
@@ -560,7 +546,7 @@ namespace XCharts.Runtime
|
||||
public float GetChangeDuration()
|
||||
{
|
||||
if (m_Enable && m_Change.enable)
|
||||
return m_Change.context.currDuration > 0 ? m_Change.context.currDuration : m_Change.duration;
|
||||
return m_Change.duration;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -568,7 +554,7 @@ namespace XCharts.Runtime
|
||||
public float GetAdditionDuration()
|
||||
{
|
||||
if (m_Enable && m_Addition.enable)
|
||||
return m_Addition.context.currDuration > 0 ? m_Addition.context.currDuration : m_Addition.duration;
|
||||
return m_Addition.duration;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -576,7 +562,7 @@ namespace XCharts.Runtime
|
||||
public float GetInteractionDuration()
|
||||
{
|
||||
if (m_Enable && m_Interaction.enable)
|
||||
return m_Interaction.context.currDuration > 0 ? m_Interaction.context.currDuration : m_Interaction.duration;
|
||||
return m_Interaction.duration;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace XCharts.Runtime
|
||||
if (axis.context.labelObjectList.Count <= 0)
|
||||
InitAngleAxis(axis);
|
||||
else
|
||||
UpdateLabelText(axis, runtimeWidth, null, false);
|
||||
axis.UpdateLabelText(runtimeWidth, null, false);
|
||||
}
|
||||
|
||||
private void InitAngleAxis(AngleAxis axis)
|
||||
|
||||
@@ -836,6 +836,22 @@ namespace XCharts.Runtime
|
||||
return IsCategory() ? GetDataList(dataZoom).Count : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新刻度标签文字
|
||||
/// </summary>
|
||||
/// <param name="dataZoom"></param>
|
||||
internal void UpdateLabelText(float coordinateWidth, DataZoom dataZoom, bool forcePercent)
|
||||
{
|
||||
for (int i = 0; i < context.labelObjectList.Count; i++)
|
||||
{
|
||||
if (context.labelObjectList[i] != null)
|
||||
{
|
||||
var text = AxisHelper.GetLabelName(this, coordinateWidth, i, context.destMinValue, context.destMaxValue, dataZoom, forcePercent);
|
||||
context.labelObjectList[i].SetText(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal Vector3 GetLabelObjectPosition(int index)
|
||||
{
|
||||
if (context.labelObjectList != null && index < context.labelObjectList.Count)
|
||||
|
||||
@@ -69,7 +69,6 @@ namespace XCharts.Runtime
|
||||
public List<string> runtimeData { get { return m_RuntimeData; } }
|
||||
public List<double> labelValueList { get { return m_LabelValueList; } }
|
||||
public List<ChartLabel> labelObjectList { get { return m_AxisLabelList; } }
|
||||
public List<int> sortedDataIndices { get { return m_SortedDataIndices; } }
|
||||
public int dataZoomStartIndex;
|
||||
/// <summary>
|
||||
/// 添加过的历史数据总数
|
||||
@@ -87,7 +86,6 @@ namespace XCharts.Runtime
|
||||
private List<ChartLabel> m_AxisLabelList = new List<ChartLabel>();
|
||||
private List<double> m_LabelValueList = new List<double>();
|
||||
private List<string> m_RuntimeData = new List<string>();
|
||||
private List<int> m_SortedDataIndices = new List<int>();
|
||||
|
||||
internal void Clear()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using XCharts.Runtime;
|
||||
@@ -150,10 +149,6 @@ namespace XCharts
|
||||
axis.context.minValue = 0;
|
||||
axis.context.maxValue = axis.data.Count > 0 ? axis.data.Count - 1 : SeriesHelper.GetMaxSerieDataCount(chart.series) - 1;
|
||||
axis.context.minMaxRange = axis.context.maxValue;
|
||||
if (chart.HasRealtimeSortSerie(axis.gridIndex))
|
||||
{
|
||||
UpdateAxisLabelText(axis);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -241,64 +236,7 @@ namespace XCharts
|
||||
var isPercentStack = SeriesHelper.IsPercentStack<Bar>(chart.series);
|
||||
var dataZoom = chart.GetDataZoomOfAxis(axis);
|
||||
|
||||
UpdateLabelText(axis, runtimeWidth, dataZoom, isPercentStack);
|
||||
}
|
||||
|
||||
internal void UpdateLabelText(Axis axis, float coordinateWidth, DataZoom dataZoom, bool forcePercent)
|
||||
{
|
||||
var context = axis.context;
|
||||
var destMaxValue = context.destMaxValue;
|
||||
var destMinValue = context.destMinValue;
|
||||
var isCategory = axis.IsCategory();
|
||||
var serie = chart.GetSerie(0);
|
||||
if (isCategory && serie != null && serie.useSortData)
|
||||
{
|
||||
var showData = serie.GetDataList(dataZoom, true);
|
||||
var isChanged = CheckSortedDataChanged(axis, showData);
|
||||
if (isChanged)
|
||||
{
|
||||
for (int i = 0; i < context.labelObjectList.Count; i++)
|
||||
{
|
||||
if (context.labelObjectList[i] != null)
|
||||
{
|
||||
var index = i < showData.Count ? showData[i].index : i;
|
||||
var text = AxisHelper.GetLabelName(axis, coordinateWidth, index, destMinValue, destMaxValue, dataZoom, forcePercent, i);
|
||||
context.labelObjectList[i].SetText(text);
|
||||
}
|
||||
}
|
||||
SaveSortedDataIndex(axis, showData);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < context.labelObjectList.Count; i++)
|
||||
{
|
||||
if (context.labelObjectList[i] != null)
|
||||
{
|
||||
var text = AxisHelper.GetLabelName(axis, coordinateWidth, i, destMinValue, destMaxValue, dataZoom, forcePercent);
|
||||
context.labelObjectList[i].SetText(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckSortedDataChanged(Axis axis, List<SerieData> dataList)
|
||||
{
|
||||
if (dataList.Count != axis.context.sortedDataIndices.Count) return true;
|
||||
for (int i = 0; i < dataList.Count; i++)
|
||||
{
|
||||
if (dataList[i].index != axis.context.sortedDataIndices[i]) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void SaveSortedDataIndex(Axis axis, List<SerieData> dataList)
|
||||
{
|
||||
axis.context.sortedDataIndices.Clear();
|
||||
for (int i = 0; i < dataList.Count; i++)
|
||||
{
|
||||
axis.context.sortedDataIndices.Add(dataList[i].index);
|
||||
}
|
||||
axis.UpdateLabelText(runtimeWidth, dataZoom, isPercentStack);
|
||||
}
|
||||
|
||||
internal void UpdateAxisTickValueList(Axis axis)
|
||||
@@ -478,21 +416,13 @@ namespace XCharts
|
||||
if (axis.IsCategory() && axis.boundaryGap)
|
||||
splitNumber -= 1;
|
||||
axis.context.aligment = defaultAlignment;
|
||||
var sortSerie = chart.GetRealtimeSortSerie(axis.gridIndex);
|
||||
if (sortSerie != null)
|
||||
{
|
||||
SerieHelper.UpdateSerieRuntimeFilterData(sortSerie);
|
||||
}
|
||||
var showData = sortSerie != null ? sortSerie.GetDataList(dataZoom, true) : null;
|
||||
|
||||
for (int i = 0; i < splitNumber; i++)
|
||||
{
|
||||
var labelWidth = AxisHelper.GetScaleWidth(axis, axisLength, i + 1, dataZoom);
|
||||
var sortIndex = sortSerie != null ? (i < showData.Count ? showData[i].index : i) : i;
|
||||
var labelName = AxisHelper.GetLabelName(axis, axisLength, sortIndex,
|
||||
var labelName = AxisHelper.GetLabelName(axis, axisLength, i,
|
||||
axis.context.destMinValue,
|
||||
axis.context.destMaxValue,
|
||||
dataZoom, isPercentStack, i);
|
||||
dataZoom, isPercentStack);
|
||||
|
||||
var label = ChartHelper.AddAxisLabelObject(splitNumber, i,
|
||||
ChartCached.GetAxisLabelName(i),
|
||||
@@ -598,20 +528,13 @@ namespace XCharts
|
||||
if (axis.IsCategory() && axis.boundaryGap)
|
||||
splitNumber -= 1;
|
||||
axis.context.aligment = defaultAlignment;
|
||||
var sortSerie = chart.GetRealtimeSortSerie(axis.gridIndex);
|
||||
if (sortSerie != null)
|
||||
{
|
||||
SerieHelper.UpdateSerieRuntimeFilterData(sortSerie);
|
||||
}
|
||||
var showData = sortSerie != null ? sortSerie.GetDataList(dataZoom, true) : null;
|
||||
for (int i = 0; i < splitNumber; i++)
|
||||
{
|
||||
var labelWidth = AxisHelper.GetScaleWidth(axis, axisLength, i + 1, dataZoom);
|
||||
var sortIndex = sortSerie != null ? (i < showData.Count ? showData[i].index : i) : i;
|
||||
var labelName = AxisHelper.GetLabelName(axis, axisLength, sortIndex,
|
||||
var labelName = AxisHelper.GetLabelName(axis, axisLength, i,
|
||||
axis.context.destMinValue,
|
||||
axis.context.destMaxValue,
|
||||
dataZoom, isPercentStack, i);
|
||||
dataZoom, isPercentStack);
|
||||
|
||||
var label = ChartHelper.AddAxisLabelObject(splitNumber, i,
|
||||
ChartCached.GetAxisLabelName(i),
|
||||
@@ -635,8 +558,8 @@ namespace XCharts
|
||||
}
|
||||
if (axis.axisName.show)
|
||||
{
|
||||
ChartLabel label;
|
||||
var relativedDist = relativedAxis == null ? 0 : relativedAxis.context.offset;
|
||||
ChartLabel label = null;
|
||||
var relativedDist = (relativedAxis == null ? 0 : relativedAxis.context.offset);
|
||||
var zeroPos = new Vector3(axisStartX, axisStartY + relativedDist);
|
||||
var offset = axis.axisName.labelStyle.offset;
|
||||
var autoColor = axis.axisLine.GetColor(chart.theme.axis.lineColor);
|
||||
|
||||
@@ -116,10 +116,9 @@ namespace XCharts.Runtime
|
||||
/// <param name="dataZoom"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetLabelName(Axis axis, float coordinateWidth, int index, double minValue, double maxValue,
|
||||
DataZoom dataZoom, bool forcePercent, int sortIndex = -1)
|
||||
DataZoom dataZoom, bool forcePercent)
|
||||
{
|
||||
int split = GetSplitNumber(axis, coordinateWidth, dataZoom);
|
||||
if (sortIndex == -1) sortIndex = index;
|
||||
if (axis.type == Axis.AxisType.Value)
|
||||
{
|
||||
if (minValue == 0 && maxValue == 0)
|
||||
@@ -138,7 +137,7 @@ namespace XCharts.Runtime
|
||||
if (forcePercent)
|
||||
return string.Format("{0}%", (int)value);
|
||||
else
|
||||
return axis.axisLabel.GetFormatterContent(sortIndex, axis.context.labelValueList.Count, value, minValue, maxValue);
|
||||
return axis.axisLabel.GetFormatterContent(index, value, minValue, maxValue);
|
||||
}
|
||||
else if (axis.type == Axis.AxisType.Log)
|
||||
{
|
||||
@@ -151,7 +150,7 @@ namespace XCharts.Runtime
|
||||
minValue = -minValue;
|
||||
maxValue = -maxValue;
|
||||
}
|
||||
return axis.axisLabel.GetFormatterContent(sortIndex, 0, value, minValue, maxValue, true);
|
||||
return axis.axisLabel.GetFormatterContent(index, value, minValue, maxValue, true);
|
||||
}
|
||||
else if (axis.type == Axis.AxisType.Time)
|
||||
{
|
||||
@@ -161,7 +160,7 @@ namespace XCharts.Runtime
|
||||
return string.Empty;
|
||||
|
||||
var value = axis.GetLabelValue(index);
|
||||
return axis.axisLabel.GetFormatterDateTime(sortIndex, axis.context.labelValueList.Count, value, minValue, maxValue);
|
||||
return axis.axisLabel.GetFormatterDateTime(index, value, minValue, maxValue);
|
||||
}
|
||||
var showData = axis.GetDataList(dataZoom);
|
||||
int dataCount = showData.Count;
|
||||
@@ -173,18 +172,18 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (index > 0)
|
||||
{
|
||||
var residue = dataCount - 1 - split * rate;
|
||||
var residue = (dataCount - 1) - split * rate;
|
||||
var newIndex = residue + (index - 1) * rate;
|
||||
if (newIndex < 0)
|
||||
newIndex = 0;
|
||||
return axis.axisLabel.GetFormatterContent(sortIndex, dataCount, showData[newIndex]);
|
||||
return axis.axisLabel.GetFormatterContent(newIndex, showData[newIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (axis.boundaryGap && coordinateWidth / dataCount > 5)
|
||||
return string.Empty;
|
||||
else
|
||||
return axis.axisLabel.GetFormatterContent(sortIndex, dataCount, showData[0]);
|
||||
return axis.axisLabel.GetFormatterContent(0, showData[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -192,7 +191,7 @@ namespace XCharts.Runtime
|
||||
int newIndex = index * rate;
|
||||
if (newIndex < dataCount)
|
||||
{
|
||||
return axis.axisLabel.GetFormatterContent(sortIndex, dataCount, showData[newIndex]);
|
||||
return axis.axisLabel.GetFormatterContent(newIndex, showData[newIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -200,7 +199,7 @@ namespace XCharts.Runtime
|
||||
if (axis.boundaryGap && ((diff > 0 && diff / rate < 0.4f) || dataCount >= axis.data.Count))
|
||||
return string.Empty;
|
||||
else
|
||||
return axis.axisLabel.GetFormatterContent(sortIndex, dataCount, showData[dataCount - 1]);
|
||||
return axis.axisLabel.GetFormatterContent(dataCount - 1, showData[dataCount - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace XCharts.Runtime
|
||||
m_TextLimit.SetRelatedText(txt, labelWidth);
|
||||
}
|
||||
|
||||
public override string GetFormatterContent(int labelIndex, int totalIndex, string category)
|
||||
public override string GetFormatterContent(int labelIndex, string category)
|
||||
{
|
||||
if (string.IsNullOrEmpty(category))
|
||||
return GetFormatterFunctionContent(labelIndex, category, category);
|
||||
@@ -157,18 +157,18 @@ namespace XCharts.Runtime
|
||||
else
|
||||
{
|
||||
var content = m_Formatter;
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, category, labelIndex, totalIndex);
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, category);
|
||||
return GetFormatterFunctionContent(labelIndex, category, m_TextLimit.GetLimitContent(content));
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetFormatterContent(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
public override string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
{
|
||||
if (showAsPositiveNumber && value < 0)
|
||||
{
|
||||
value = Math.Abs(value);
|
||||
}
|
||||
return base.GetFormatterContent(labelIndex, totalIndex, value, minValue, maxValue, isLog);
|
||||
return base.GetFormatterContent(labelIndex, value, minValue, maxValue, isLog);
|
||||
}
|
||||
|
||||
public bool IsNeedShowLabel(int index, int total)
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace XCharts.Runtime
|
||||
InitRadiusAxis(axis);
|
||||
else
|
||||
{
|
||||
UpdateLabelText(axis, polar.context.radius, null, false);
|
||||
axis.UpdateLabelText(polar.context.radius, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,16 +152,18 @@ namespace XCharts.Runtime
|
||||
/// <summary>
|
||||
/// 根据指定的sizeType获得标记的大小
|
||||
/// </summary>
|
||||
public float GetSize(SerieData serieData, float themeSize)
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public float GetSize(List<double> data, float themeSize)
|
||||
{
|
||||
switch (m_SizeType)
|
||||
{
|
||||
case SymbolSizeType.Custom:
|
||||
return size == 0 ? themeSize : size;
|
||||
case SymbolSizeType.FromData:
|
||||
if (serieData != null && dataIndex >= 0 && dataIndex < serieData.data.Count)
|
||||
if (data != null && dataIndex >= 0 && dataIndex < data.Count)
|
||||
{
|
||||
var value = (float) serieData.data[dataIndex] * m_DataScale;
|
||||
var value = (float) data[dataIndex] * m_DataScale;
|
||||
if (m_MinSize != 0 && value < m_MinSize) value = m_MinSize;
|
||||
if (m_MaxSize != 0 && value > m_MaxSize) value = m_MaxSize;
|
||||
return value;
|
||||
@@ -171,7 +173,7 @@ namespace XCharts.Runtime
|
||||
return size == 0 ? themeSize : size;
|
||||
}
|
||||
case SymbolSizeType.Function:
|
||||
if (sizeFunction != null) return sizeFunction(themeSize, serieData);
|
||||
if (data != null && sizeFunction != null) return sizeFunction(data);
|
||||
else return size == 0 ? themeSize : size;
|
||||
default:
|
||||
return size == 0 ? themeSize : size;
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace XCharts.Runtime
|
||||
label.SetActive(comment.show && item.show, true);
|
||||
label.SetPosition(labelPos);
|
||||
label.text.SetLocalPosition(labelStyle.offset);
|
||||
item.labelObject = label;
|
||||
}
|
||||
};
|
||||
comment.refreshComponent();
|
||||
|
||||
@@ -15,9 +15,7 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private Rect m_MarkRect;
|
||||
[SerializeField] private CommentMarkStyle m_MarkStyle = new CommentMarkStyle() { show = false };
|
||||
[SerializeField] private LabelStyle m_LabelStyle = new LabelStyle() { show = false };
|
||||
[SerializeField][Since("v3.5.0")] private Location m_Location = new Location() { align = Location.Align.TopLeft, top = 0.125f };
|
||||
|
||||
public ChartLabel labelObject { get; set; }
|
||||
[SerializeField] [Since("v3.5.0")]private Location m_Location = new Location() { align = Location.Align.TopLeft, top = 0.125f };
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -29,18 +27,7 @@ namespace XCharts.Runtime
|
||||
/// content of comment.
|
||||
/// ||注解的文本内容。支持模板参数,可以参考Tooltip的itemFormatter。
|
||||
/// </summary>
|
||||
public string content
|
||||
{
|
||||
get { return m_Content; }
|
||||
set
|
||||
{
|
||||
if (PropertyUtil.SetClass(ref m_Content, value))
|
||||
{
|
||||
if (labelObject != null) labelObject.SetText(value);
|
||||
else SetComponentDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string content { get { return m_Content; } set { if (PropertyUtil.SetClass(ref m_Content, value)) SetComponentDirty(); } }
|
||||
/// <summary>
|
||||
/// the mark rect of comment.
|
||||
/// ||注解区域。
|
||||
|
||||
@@ -131,8 +131,7 @@ namespace XCharts.Runtime
|
||||
/// `{g}` : indicates the total number of data. <br />
|
||||
/// `{h}` : hexadecimal color value. <br />
|
||||
/// `{y}` : category value of y axis. <br />
|
||||
/// `{value}` : the value of the axis or legend. <br />
|
||||
/// `{index}` : the index of the axis. <br />
|
||||
/// `{value}` : The value of the axis or legend. <br />
|
||||
/// The following placeholder apply to `UITable` components: <br />
|
||||
/// `{name}` : indicates the row name of the table. <br />
|
||||
/// `{index}` : indicates the row number of the table. <br />
|
||||
@@ -162,7 +161,6 @@ namespace XCharts.Runtime
|
||||
/// `{h}`:十六进制颜色值。<br/>
|
||||
/// `{y}`:Y轴的类目名。<br/>
|
||||
/// `{value}`:坐标轴或图例的值。<br/>
|
||||
/// `{index}`:坐标轴编号。<br/>
|
||||
/// 以下通配符适用UITable组件:<br/>
|
||||
/// `{name}`: 表格的行名。<br/>
|
||||
/// `{index}`:表格的行号。<br/>
|
||||
@@ -400,7 +398,7 @@ namespace XCharts.Runtime
|
||||
m_TextStyle.Copy(label.m_TextStyle);
|
||||
}
|
||||
|
||||
public virtual string GetFormatterContent(int labelIndex, int totalIndex, string category)
|
||||
public virtual string GetFormatterContent(int labelIndex, string category)
|
||||
{
|
||||
if (string.IsNullOrEmpty(category))
|
||||
return GetFormatterFunctionContent(labelIndex, category, category);
|
||||
@@ -412,12 +410,12 @@ namespace XCharts.Runtime
|
||||
else
|
||||
{
|
||||
var content = m_Formatter;
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, category, labelIndex, totalIndex);
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, category);
|
||||
return GetFormatterFunctionContent(labelIndex, category, category);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string GetFormatterContent(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
public virtual string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||
{
|
||||
var newNumericFormatter = numericFormatter;
|
||||
if (value == 0 && !DateTimeUtil.IsDateOrTimeRegex(newNumericFormatter))
|
||||
@@ -454,14 +452,14 @@ namespace XCharts.Runtime
|
||||
else
|
||||
{
|
||||
var content = m_Formatter;
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, newNumericFormatter, value, labelIndex, totalIndex);
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, newNumericFormatter, value);
|
||||
return GetFormatterFunctionContent(labelIndex, value, content);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isDateFormatter = false;
|
||||
private static string newFormatter = null;
|
||||
public string GetFormatterDateTime(int labelIndex, int totalIndex, double value, double minValue, double maxValue)
|
||||
public string GetFormatterDateTime(int labelIndex, double value, double minValue, double maxValue)
|
||||
{
|
||||
var timestamp = (int)value;
|
||||
var dateTime = DateTimeUtil.GetDateTime(timestamp);
|
||||
@@ -474,9 +472,9 @@ namespace XCharts.Runtime
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DateTimeUtil.IsDateOrTimeRegex(numericFormatter, ref isDateFormatter, ref newFormatter))
|
||||
if(DateTimeUtil.IsDateOrTimeRegex(numericFormatter, ref isDateFormatter, ref newFormatter))
|
||||
{
|
||||
if (isDateFormatter)
|
||||
if(isDateFormatter)
|
||||
dateString = ChartCached.NumberToDateStr(timestamp, newFormatter);
|
||||
else
|
||||
dateString = ChartCached.NumberToTimeStr(timestamp, newFormatter);
|
||||
@@ -494,7 +492,7 @@ namespace XCharts.Runtime
|
||||
if (!string.IsNullOrEmpty(m_Formatter))
|
||||
{
|
||||
var content = m_Formatter;
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, dateString, labelIndex, totalIndex);
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, dateString);
|
||||
return GetFormatterFunctionContent(labelIndex, value, content);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -464,16 +464,16 @@ namespace XCharts.Runtime
|
||||
indicatorList.Clear();
|
||||
}
|
||||
|
||||
public string GetFormatterIndicatorContent(int indicatorIndex, int totalIndex)
|
||||
public string GetFormatterIndicatorContent(int indicatorIndex)
|
||||
{
|
||||
var indicator = GetIndicator(indicatorIndex);
|
||||
if (indicator == null)
|
||||
return string.Empty;
|
||||
else
|
||||
return GetFormatterIndicatorContent(indicator.name, indicatorIndex, totalIndex);
|
||||
return GetFormatterIndicatorContent(indicator.name);
|
||||
}
|
||||
|
||||
public string GetFormatterIndicatorContent(string indicatorName, int index, int totalIndex)
|
||||
public string GetFormatterIndicatorContent(string indicatorName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(indicatorName))
|
||||
return indicatorName;
|
||||
@@ -485,7 +485,7 @@ namespace XCharts.Runtime
|
||||
else
|
||||
{
|
||||
var content = m_AxisName.labelStyle.formatter;
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, indicatorName, index, totalIndex);
|
||||
FormatterHelper.ReplaceAxisLabelContent(ref content, indicatorName);
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace XCharts.Runtime
|
||||
var indicator = radar.indicatorList[i];
|
||||
var pos = radar.GetIndicatorPosition(i);
|
||||
var objName = INDICATOR_TEXT + "_" + i;
|
||||
var content = radar.GetFormatterIndicatorContent(i, radar.indicatorList.Count);
|
||||
|
||||
var label = ChartHelper.AddChartLabel(objName, radarObject.transform, radar.axisName.labelStyle,
|
||||
chart.theme.common, content, Color.clear, TextAnchor.MiddleCenter);
|
||||
chart.theme.common, radar.GetFormatterIndicatorContent(i), Color.clear, TextAnchor.MiddleCenter);
|
||||
label.SetActive(radar.axisName.show && radar.indicator && radar.axisName.labelStyle.show, true);
|
||||
AxisHelper.AdjustCircleLabelPos(label, pos, radar.context.center, txtHig, radar.axisName.labelStyle.offset);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,6 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private float m_TitleHeight = 25f;
|
||||
[SerializeField] private float m_ItemHeight = 25f;
|
||||
[SerializeField] private Color32 m_BorderColor = new Color32(230, 230, 230, 255);
|
||||
[SerializeField][Since("v3.14.0")] private List<float> m_ColumnGapWidths = new List<float>{15};
|
||||
[SerializeField] private LineStyle m_LineStyle = new LineStyle(LineStyle.Type.None);
|
||||
[SerializeField]
|
||||
private LabelStyle m_TitleLabelStyle = new LabelStyle()
|
||||
@@ -155,7 +154,7 @@ namespace XCharts.Runtime
|
||||
[SerializeField]
|
||||
private List<LabelStyle> m_ContentLabelStyles = new List<LabelStyle>()
|
||||
{
|
||||
new LabelStyle() { textPadding = new TextPadding(0, 5, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleCenter } },
|
||||
new LabelStyle() { textPadding = new TextPadding(0, 5, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleLeft } },
|
||||
new LabelStyle() { textPadding = new TextPadding(0, 20, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleLeft } },
|
||||
new LabelStyle() { textPadding = new TextPadding(0, 0, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleRight } }
|
||||
};
|
||||
@@ -454,15 +453,6 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_ItemHeight, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the column gap width of content. When there is only one column, it only represents the gap width of the second column.
|
||||
/// ||内容部分的列间距。当只有一列时,只表示第二列的间距。
|
||||
/// </summary>
|
||||
public List<float> columnGapWidths
|
||||
{
|
||||
get { return m_ColumnGapWidths; }
|
||||
set { if (value != null) { m_ColumnGapWidths = value; SetComponentDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// the textstyle of title.
|
||||
/// ||标题的文本样式。
|
||||
/// </summary>
|
||||
@@ -472,8 +462,8 @@ namespace XCharts.Runtime
|
||||
set { if (value != null) { m_TitleLabelStyle = value; SetComponentDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// the column text style list of content. The first represents the text style of the first column, and so on.
|
||||
/// ||内容部分的列文本样式列表。第一个表示第一列的文本样式,以此类推。
|
||||
/// the textstyle list of content.
|
||||
/// ||内容部分的文本样式列表。和列一一对应。
|
||||
/// </summary>
|
||||
public List<LabelStyle> contentLabelStyles
|
||||
{
|
||||
|
||||
@@ -264,15 +264,15 @@ namespace XCharts.Runtime
|
||||
var index = (int)axis.context.pointerValue;
|
||||
var dataZoom = chart.GetDataZoomOfAxis(axis);
|
||||
var category = axis.GetData(index, dataZoom);
|
||||
label.SetText(axis.indicatorLabel.GetFormatterContent(index, 0, category));
|
||||
label.SetText(axis.indicatorLabel.GetFormatterContent(index, category));
|
||||
}
|
||||
else if (axis.IsTime())
|
||||
{
|
||||
label.SetText(axis.indicatorLabel.GetFormatterDateTime(0, 0, axis.context.pointerValue, axis.context.minValue, axis.context.maxValue));
|
||||
label.SetText(axis.indicatorLabel.GetFormatterDateTime(0, axis.context.pointerValue, axis.context.minValue, axis.context.maxValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
label.SetText(axis.indicatorLabel.GetFormatterContent(0, 0, axis.context.pointerValue, axis.context.minValue, axis.context.maxValue, axis.IsLog()));
|
||||
label.SetText(axis.indicatorLabel.GetFormatterContent(0, axis.context.pointerValue, axis.context.minValue, axis.context.maxValue, axis.IsLog()));
|
||||
}
|
||||
var textColor = axis.axisLabel.textStyle.GetColor(chart.theme.axis.textColor);
|
||||
if (ChartHelper.IsClearColor(axis.indicatorLabel.background.color))
|
||||
@@ -356,7 +356,6 @@ namespace XCharts.Runtime
|
||||
if (isTriggerAxis)
|
||||
{
|
||||
var index = serie.context.dataZoomStartIndex + (int)yAxis.context.pointerValue;
|
||||
if(serie.useSortData) index = yAxis.context.sortedDataIndices[index];
|
||||
serie.context.pointerEnter = true;
|
||||
serie.context.pointerAxisDataIndexs.Add(index);
|
||||
serie.context.pointerItemDataIndex = index;
|
||||
@@ -376,7 +375,6 @@ namespace XCharts.Runtime
|
||||
if (isTriggerAxis)
|
||||
{
|
||||
var index = serie.context.dataZoomStartIndex + (int)xAxis.context.pointerValue;
|
||||
if(serie.useSortData) index = xAxis.context.sortedDataIndices[index];
|
||||
if (chart.isTriggerOnClick)
|
||||
{
|
||||
if (serie.insertDataToHead)
|
||||
@@ -454,7 +452,7 @@ namespace XCharts.Runtime
|
||||
var dataCount = serie.dataCount;
|
||||
var themeSymbolSize = chart.theme.serie.scatterSymbolSize;
|
||||
var data = serie.data;
|
||||
if (!isTimeAxis)// || serie.useSortData)
|
||||
if (!isTimeAxis)
|
||||
{
|
||||
serie.context.sortedData.Clear();
|
||||
for (int i = 0; i < dataCount; i++)
|
||||
|
||||
@@ -60,7 +60,6 @@ namespace XCharts.Runtime
|
||||
ChartHelper.SetActive(gameObject, m_Active);
|
||||
if (!flag)
|
||||
{
|
||||
m_ColumnMaxWidth.Clear();
|
||||
foreach (var item in m_Items)
|
||||
item.gameObject.SetActive(false);
|
||||
}
|
||||
@@ -76,6 +75,8 @@ namespace XCharts.Runtime
|
||||
ChartHelper.SetActive(title, titleActive);
|
||||
title.SetText(data.title);
|
||||
|
||||
m_ColumnMaxWidth.Clear();
|
||||
var contentLabelStyle0 = tooltip.GetContentLabelStyle(0);
|
||||
for (int i = 0; i < data.param.Count; i++)
|
||||
{
|
||||
var item = GetItem(i);
|
||||
@@ -88,21 +89,17 @@ namespace XCharts.Runtime
|
||||
item.gameObject.SetActive(true);
|
||||
for (int j = 0; j < param.columns.Count; j++)
|
||||
{
|
||||
var column = GetItemColumn(item, j, j == 0 && IsSecondaryMark(param, param.columns[j]));
|
||||
var column = GetItemColumn(item, j);
|
||||
column.SetActive(true);
|
||||
column.SetText(param.columns[j]);
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
var labelStyle = tooltip.GetContentLabelStyle(j);
|
||||
if (labelStyle != null && ChartHelper.IsClearColor(labelStyle.textStyle.color))
|
||||
column.text.SetColor(param.color);
|
||||
}
|
||||
if (j == 0 && contentLabelStyle0 != null && ChartHelper.IsClearColor(contentLabelStyle0.textStyle.color))
|
||||
column.text.SetColor(param.color);
|
||||
|
||||
if (j >= m_ColumnMaxWidth.Count)
|
||||
m_ColumnMaxWidth.Add(0);
|
||||
|
||||
var columnWidth = column.text.GetPreferredWidth() + GetTooltipColumnGapWidth(tooltip, j);
|
||||
var columnWidth = column.GetWidth();
|
||||
if (m_ColumnMaxWidth[j] < columnWidth)
|
||||
m_ColumnMaxWidth[j] = columnWidth;
|
||||
}
|
||||
@@ -120,22 +117,6 @@ namespace XCharts.Runtime
|
||||
tooltip.gameObject.transform.SetAsLastSibling();
|
||||
}
|
||||
|
||||
private static float GetTooltipColumnGapWidth(Tooltip tooltip, int index)
|
||||
{
|
||||
if (tooltip == null || tooltip.columnGapWidths.Count == 0) return 0;
|
||||
if (tooltip.columnGapWidths.Count == 1) return index == 1 ? tooltip.columnGapWidths[0] : 0;
|
||||
if (index < tooltip.columnGapWidths.Count)
|
||||
{
|
||||
return tooltip.columnGapWidths[index];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static bool IsSecondaryMark(SerieParams sp, string mark)
|
||||
{
|
||||
return sp.isSecondaryMark && mark == sp.marker;
|
||||
}
|
||||
|
||||
private void ResetSize()
|
||||
{
|
||||
var maxHig = 0f;
|
||||
@@ -177,10 +158,8 @@ namespace XCharts.Runtime
|
||||
var xPos = 0f;
|
||||
for (int j = 0; j < m_ColumnMaxWidth.Count; j++)
|
||||
{
|
||||
if (j >= item.columns.Count) break;
|
||||
var deltaX = j == m_ColumnMaxWidth.Count - 1 ? maxWid - xPos : m_ColumnMaxWidth[j];
|
||||
item.columns[j].text.SetSizeDelta(new Vector2(deltaX, tooltip.itemHeight));
|
||||
item.columns[j].SetSize(deltaX, tooltip.itemHeight);
|
||||
item.columns[j].SetRectPosition(new Vector3(xPos, 0));
|
||||
xPos += m_ColumnMaxWidth[j];
|
||||
}
|
||||
@@ -213,24 +192,19 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
private ChartLabel GetItemColumn(TooltipViewItem item, int i, bool isSecondaryMark = false)
|
||||
private ChartLabel GetItemColumn(TooltipViewItem item, int i)
|
||||
{
|
||||
if (i < 0) i = 0;
|
||||
ChartLabel column;
|
||||
if (i < item.columns.Count)
|
||||
{
|
||||
column = item.columns[i];
|
||||
return item.columns[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
column = CreateViewItemColumn(i, item.gameObject.transform, tooltip, theme);
|
||||
var column = CreateViewItemColumn(i, item.gameObject.transform, tooltip, theme);
|
||||
item.columns.Add(column);
|
||||
return column;
|
||||
}
|
||||
if (isSecondaryMark)
|
||||
{
|
||||
column.text.text.fontSize = (int)(tooltip.GetContentLabelStyle(i).textStyle.fontSize * 0.6f);
|
||||
}
|
||||
return column;
|
||||
}
|
||||
|
||||
public static TooltipView CreateView(Tooltip tooltip, ThemeStyle theme, Transform parent)
|
||||
@@ -292,9 +266,8 @@ namespace XCharts.Runtime
|
||||
private static ChartLabel CreateViewItemColumn(int i, Transform parent, Tooltip tooltip, ComponentTheme theme)
|
||||
{
|
||||
var labelStyle = tooltip.GetContentLabelStyle(i);
|
||||
labelStyle.textStyle.autoAlign = false;
|
||||
var label = ChartHelper.AddChartLabel("column" + i, parent, labelStyle, theme,
|
||||
"", Color.clear, TextAnchor.MiddleLeft, true);
|
||||
"", Color.clear, TextAnchor.MiddleLeft);
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace XCharts.Runtime
|
||||
private static Regex s_RegexSubForAxisLabel = new Regex(@"(value)|([c-g|x|p|r]\d*)", RegexOptions.IgnoreCase);
|
||||
private static Regex s_RegexForSerieLabel = new Regex(@"{[a-h|\.|y]\d*(:[c-g|x|p|r]\d*)?}", RegexOptions.IgnoreCase);
|
||||
private static Regex s_RegexSubForSerieLabel = new Regex(@"(\.)|([a-h|y]\d*)|([c-g|x|p|r]\d*)", RegexOptions.IgnoreCase);
|
||||
private static Regex s_RegexForAxisIndex = new Regex(@"\{(-?)index([+-]\d+)?\}", RegexOptions.IgnoreCase);
|
||||
|
||||
public static bool NeedFormat(string content)
|
||||
{
|
||||
@@ -335,7 +334,7 @@ namespace XCharts.Runtime
|
||||
return s_RegexNewLine.Replace(content.Trim(), PH_NN);
|
||||
}
|
||||
|
||||
public static void ReplaceAxisLabelContent(ref string content, string numericFormatter, double value, int index, int totalIndex)
|
||||
public static void ReplaceAxisLabelContent(ref string content, string numericFormatter, double value)
|
||||
{
|
||||
var mc = s_RegexForAxisLabel.Matches(content);
|
||||
foreach (var m in mc)
|
||||
@@ -350,11 +349,10 @@ namespace XCharts.Runtime
|
||||
}
|
||||
content = content.Replace(old, ChartCached.FloatToStr(value, numericFormatter));
|
||||
}
|
||||
ReplaceIndexContent(ref content, index, totalIndex);
|
||||
content = TrimAndReplaceLine(content);
|
||||
}
|
||||
|
||||
public static void ReplaceAxisLabelContent(ref string content, string value, int index, int totalIndex)
|
||||
public static void ReplaceAxisLabelContent(ref string content, string value)
|
||||
{
|
||||
var mc = s_RegexForAxisLabel.Matches(content);
|
||||
foreach (var m in mc)
|
||||
@@ -365,26 +363,8 @@ namespace XCharts.Runtime
|
||||
if (argsCount <= 0) continue;
|
||||
content = content.Replace(old, value);
|
||||
}
|
||||
ReplaceIndexContent(ref content, index, totalIndex);
|
||||
content = TrimAndReplaceLine(content);
|
||||
}
|
||||
|
||||
public static void ReplaceIndexContent(ref string content, int currIndex, int totalIndex)
|
||||
{
|
||||
if (totalIndex <= 0) return;
|
||||
content = s_RegexForAxisIndex.Replace(content, (match) =>
|
||||
{
|
||||
bool isNegative = match.Groups[1].Value == "-";
|
||||
int offset = 0;
|
||||
int parsedOffset = 0;
|
||||
if (match.Groups[2].Success &&
|
||||
int.TryParse(match.Groups[2].Value, out parsedOffset))
|
||||
{
|
||||
offset = parsedOffset;
|
||||
}
|
||||
int baseValue = isNegative ? totalIndex - currIndex : currIndex + 1;
|
||||
return (baseValue + offset).ToString();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,6 @@ namespace XCharts.Runtime
|
||||
|
||||
public MainComponent AddChartComponent(Type type)
|
||||
{
|
||||
InitListForFieldInfos();
|
||||
if (!CanAddChartComponent(type))
|
||||
{
|
||||
Debug.LogError("XCharts ERROR: CanAddChartComponent:" + type.Name);
|
||||
|
||||
@@ -101,28 +101,6 @@ namespace XCharts.Runtime
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasRealtimeSortSerie(int gridIndex)
|
||||
{
|
||||
foreach (var serie in m_Series)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (serie.useSortData)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Serie GetRealtimeSortSerie(int gridIndex)
|
||||
{
|
||||
foreach (var serie in m_Series)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (serie.useSortData)
|
||||
return serie;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public T GetSerie<T>() where T : Serie
|
||||
{
|
||||
foreach (var serie in m_Series)
|
||||
@@ -853,7 +831,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
public float GetSerieBarGap<T>(int gridIndex) where T : Serie
|
||||
public float GetSerieBarGap<T>() where T : Serie
|
||||
{
|
||||
float gap = 0f;
|
||||
for (int i = 0; i < m_Series.Count; i++)
|
||||
@@ -861,7 +839,6 @@ namespace XCharts.Runtime
|
||||
var serie = m_Series[i];
|
||||
if (serie.show && serie is T)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (serie.barGap != 0)
|
||||
{
|
||||
gap = serie.barGap;
|
||||
@@ -871,7 +848,7 @@ namespace XCharts.Runtime
|
||||
return gap;
|
||||
}
|
||||
|
||||
public double GetSerieSameStackTotalValue<T>(string stack, int dataIndex, int gridIndex) where T : Serie
|
||||
public double GetSerieSameStackTotalValue<T>(string stack, int dataIndex) where T : Serie
|
||||
{
|
||||
if (string.IsNullOrEmpty(stack)) return 0;
|
||||
double total = 0;
|
||||
@@ -879,7 +856,6 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (serie is T)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (stack.Equals(serie.stack))
|
||||
{
|
||||
total += serie.data[dataIndex].data[1];
|
||||
@@ -889,7 +865,7 @@ namespace XCharts.Runtime
|
||||
return total;
|
||||
}
|
||||
|
||||
public int GetSerieBarRealCount<T>(int gridIndex) where T : Serie
|
||||
public int GetSerieBarRealCount<T>() where T : Serie
|
||||
{
|
||||
var count = 0;
|
||||
barStackSet.Clear();
|
||||
@@ -899,7 +875,6 @@ namespace XCharts.Runtime
|
||||
if (!serie.show) continue;
|
||||
if (serie is T)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (!string.IsNullOrEmpty(serie.stack))
|
||||
{
|
||||
if (barStackSet.Contains(serie.stack)) continue;
|
||||
@@ -912,26 +887,8 @@ namespace XCharts.Runtime
|
||||
return count;
|
||||
}
|
||||
|
||||
private bool CheckSerieGridIndex(Serie serie, int gridIndex)
|
||||
{
|
||||
if (gridIndex >= 0)
|
||||
{
|
||||
if (serie.xAxisIndex >= 0 && serie.xAxisIndex < m_XAxes.Count)
|
||||
{
|
||||
var xAxis = m_XAxes[serie.xAxisIndex];
|
||||
if (xAxis.gridIndex != gridIndex) return false;
|
||||
}
|
||||
if (serie.yAxisIndex >= 0 && serie.yAxisIndex < m_YAxes.Count)
|
||||
{
|
||||
var yAxis = m_YAxes[serie.yAxisIndex];
|
||||
if (yAxis.gridIndex != gridIndex) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private HashSet<string> barStackSet = new HashSet<string>();
|
||||
public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount, int gridIndex) where T : Serie
|
||||
public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount) where T : Serie
|
||||
{
|
||||
float total = 0;
|
||||
float lastGap = 0;
|
||||
@@ -942,7 +899,6 @@ namespace XCharts.Runtime
|
||||
if (!serie.show) continue;
|
||||
if (serie is T)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (!string.IsNullOrEmpty(serie.stack))
|
||||
{
|
||||
if (barStackSet.Contains(serie.stack)) continue;
|
||||
@@ -965,12 +921,12 @@ namespace XCharts.Runtime
|
||||
return total;
|
||||
}
|
||||
|
||||
public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index, int gridIndex) where T : Serie
|
||||
public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index) where T : Serie
|
||||
{
|
||||
if (index <= 0) return 0;
|
||||
var total = 0f;
|
||||
var count = 0;
|
||||
var totalRealBarCount = GetSerieBarRealCount<T>(gridIndex);
|
||||
var totalRealBarCount = GetSerieBarRealCount<T>();
|
||||
barStackSet.Clear();
|
||||
for (int i = 0; i < m_Series.Count; i++)
|
||||
{
|
||||
@@ -978,7 +934,6 @@ namespace XCharts.Runtime
|
||||
if (!serie.show) continue;
|
||||
if (serie is T)
|
||||
{
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (!string.IsNullOrEmpty(serie.stack))
|
||||
{
|
||||
if (barStackSet.Contains(serie.stack)) continue;
|
||||
@@ -1028,7 +983,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
|
||||
private List<string> tempList = new List<string>();
|
||||
public int GetSerieIndexIfStack<T>(Serie currSerie, int gridIndex) where T : Serie
|
||||
public int GetSerieIndexIfStack<T>(Serie currSerie) where T : Serie
|
||||
{
|
||||
tempList.Clear();
|
||||
int index = 0;
|
||||
@@ -1037,7 +992,6 @@ namespace XCharts.Runtime
|
||||
var serie = m_Series[i];
|
||||
if (!serie.show) continue;
|
||||
if (!(serie is T)) continue;
|
||||
if (!CheckSerieGridIndex(serie, gridIndex)) continue;
|
||||
if (string.IsNullOrEmpty(serie.stack))
|
||||
{
|
||||
if (serie.index == currSerie.index) return index;
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace XCharts.Runtime
|
||||
serie.index = i;
|
||||
SetPainterActive(i, true);
|
||||
}
|
||||
if (m_PainterTop != null && transform.childCount - 3 != m_PainterTop.transform.GetSiblingIndex())
|
||||
if (transform.childCount - 3 != m_PainterTop.transform.GetSiblingIndex())
|
||||
{
|
||||
m_PainterTop.transform.SetSiblingIndex(transform.childCount - 3);
|
||||
}
|
||||
@@ -724,7 +724,7 @@ namespace XCharts.Runtime
|
||||
|
||||
private void InitListForFieldInfos()
|
||||
{
|
||||
if (m_TypeListForSerie.Count != 0 || m_TypeListForComponent.Count != 0) return;
|
||||
if (m_TypeListForSerie.Count != 0) return;
|
||||
m_TypeListForComponent.Clear();
|
||||
m_TypeListForSerie.Clear();
|
||||
var fileds1 = GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
@@ -18,7 +18,9 @@ namespace XCharts.Runtime
|
||||
/// <summary>
|
||||
/// 获取标记大小的回调。
|
||||
/// </summary>
|
||||
public delegate float SymbolSizeFunction(float defaultSize, SerieData serieData);
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public delegate float SymbolSizeFunction(List<double> data);
|
||||
public delegate void CustomDrawGaugePointerFunction(VertexHelper vh, int serieIndex, int dataIndex, float currentAngle);
|
||||
/// <summary>
|
||||
/// DataZoom的start和end变更时的委托方法。
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (!s_ColorDotStr.ContainsKey(color))
|
||||
{
|
||||
s_ColorDotStr[color] = "<color=#" + ColorToStr(color) + ">●</color>";
|
||||
s_ColorDotStr[color] = "<color=#" + ColorToStr(color) + ">● </color>";
|
||||
}
|
||||
return s_ColorDotStr[color];
|
||||
}
|
||||
|
||||
@@ -204,25 +204,6 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveTMPComponents(GameObject gameObject)
|
||||
{
|
||||
var coms = gameObject.GetComponents<Component>();
|
||||
foreach (var com in coms)
|
||||
{
|
||||
if (com.GetType().FullName.Contains("TMPro"))
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
GameObject.DestroyImmediate(com as UnityEngine.Object);
|
||||
else
|
||||
GameObject.Destroy(com as UnityEngine.Object);
|
||||
#else
|
||||
GameObject.Destroy(com as UnityEngine.Object);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Obsolete("Use EnsureComponent instead")]
|
||||
public static T GetOrAddComponent<T>(Transform transform) where T : Component
|
||||
{
|
||||
@@ -258,13 +239,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
if (gameObject.GetComponent<T>() == null)
|
||||
{
|
||||
var com = gameObject.AddComponent<T>();
|
||||
if (com == null)
|
||||
{
|
||||
RemoveTMPComponents(gameObject);
|
||||
return gameObject.AddComponent<T>();
|
||||
}
|
||||
return com;
|
||||
return gameObject.AddComponent<T>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -468,21 +443,16 @@ namespace XCharts.Runtime
|
||||
}
|
||||
|
||||
public static ChartLabel AddChartLabel(string name, Transform parent, LabelStyle labelStyle,
|
||||
ComponentTheme theme, string content, Color autoColor, TextAnchor autoAlignment = TextAnchor.MiddleCenter,
|
||||
bool isObjectAnchor = false)
|
||||
ComponentTheme theme, string content, Color autoColor, TextAnchor autoAlignment = TextAnchor.MiddleCenter)
|
||||
{
|
||||
Vector2 anchorMin, anchorMax, pivot;
|
||||
var sizeDelta = new Vector2(labelStyle.width, labelStyle.height);
|
||||
var textStyle = labelStyle.textStyle;
|
||||
var alignment = isObjectAnchor ? autoAlignment : textStyle.GetAlignment(autoAlignment);
|
||||
var alignment = textStyle.GetAlignment(autoAlignment);
|
||||
UpdateAnchorAndPivotByTextAlignment(alignment, out anchorMin, out anchorMax, out pivot);
|
||||
var labelObj = AddObject(name, parent, anchorMin, anchorMax, pivot, sizeDelta);
|
||||
//ChartHelper.RemoveComponent<Text>(labelObj);
|
||||
var label = EnsureComponent<ChartLabel>(labelObj);
|
||||
if(isObjectAnchor)
|
||||
{
|
||||
UpdateAnchorAndPivotByTextAlignment(textStyle.GetAlignment(autoAlignment), out anchorMin, out anchorMax, out pivot);
|
||||
}
|
||||
label.text = AddTextObject("Text", label.gameObject.transform, anchorMin, anchorMax, pivot,
|
||||
sizeDelta, textStyle, theme, autoColor, autoAlignment, label.text);
|
||||
label.icon = ChartHelper.AddIcon("Icon", label.gameObject.transform, labelStyle.icon);
|
||||
@@ -1064,12 +1034,12 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var cam = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera;
|
||||
var pos = RectTransformUtility.WorldToScreenPoint(cam, rectTransform.position);
|
||||
var width = (int)(rectTransform.rect.width * canvas.scaleFactor);
|
||||
var height = (int)(rectTransform.rect.height * canvas.scaleFactor);
|
||||
var width = rectTransform.rect.width * canvas.scaleFactor;
|
||||
var height = rectTransform.rect.height * canvas.scaleFactor;
|
||||
var posX = pos.x + rectTransform.rect.xMin * canvas.scaleFactor;
|
||||
var posY = pos.y + rectTransform.rect.yMin * canvas.scaleFactor;
|
||||
var rect = new Rect(posX, posY, width, height);
|
||||
var tex = new Texture2D(width, height, TextureFormat.ARGB32, false);
|
||||
var tex = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, false);
|
||||
tex.ReadPixels(rect, 0, 0);
|
||||
tex.Apply();
|
||||
byte[] bytes;
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace XCharts.Runtime
|
||||
[ExecuteInEditMode]
|
||||
public static class XChartsMgr
|
||||
{
|
||||
public static readonly string version = "3.14.0";
|
||||
public static readonly int versionDate = 20250315;
|
||||
public static readonly string version = "3.13.0";
|
||||
public static readonly int versionDate = 20250101;
|
||||
public static string fullVersion { get { return version + "-" + versionDate; } }
|
||||
|
||||
internal static List<BaseChart> chartList = new List<BaseChart>();
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts.Runtime
|
||||
{
|
||||
[System.Serializable]
|
||||
@@ -13,8 +11,6 @@ namespace XCharts.Runtime
|
||||
[SerieDataExtraField("m_Ignore")]
|
||||
public class Bar : Serie, INeedSerieContainer
|
||||
{
|
||||
public override bool useSortData { get { return realtimeSort; } }
|
||||
|
||||
public int containerIndex { get; internal set; }
|
||||
public int containterInstanceId { get; internal set; }
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace XCharts.Runtime
|
||||
foreach (var serieData in serie.data)
|
||||
{
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
var symbolSize = symbol.GetSize(serieData, chart.theme.serie.lineSymbolSize);
|
||||
var symbolSize = symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
|
||||
serieData.context.highlight = false;
|
||||
serieData.interact.SetValue(ref needAnimation1, symbolSize);
|
||||
}
|
||||
@@ -125,17 +125,16 @@ namespace XCharts.Runtime
|
||||
if (isStack)
|
||||
SeriesHelper.UpdateStackDataList(chart.series, serie, null, m_StackSerieData);
|
||||
|
||||
var barCount = chart.GetSerieBarRealCount<Bar>(-1);
|
||||
var barCount = chart.GetSerieBarRealCount<Bar>();
|
||||
var categoryWidth = m_AngleAxis.IsCategory() ?
|
||||
AxisHelper.GetDataWidth(m_AngleAxis, 360, datas.Count, null) :
|
||||
AxisHelper.GetDataWidth(m_RadiusAxis, m_SeriePolar.context.radius, datas.Count, null);
|
||||
var barGap = chart.GetSerieBarGap<Bar>(-1);
|
||||
var totalBarWidth = chart.GetSerieTotalWidth<Bar>(categoryWidth, barGap, barCount, -1);
|
||||
var barGap = chart.GetSerieBarGap<Bar>();
|
||||
var totalBarWidth = chart.GetSerieTotalWidth<Bar>(categoryWidth, barGap, barCount);
|
||||
var barWidth = serie.GetBarWidth(categoryWidth, barCount);
|
||||
var offset = (categoryWidth - totalBarWidth) * 0.5f;
|
||||
var serieReadIndex = chart.GetSerieIndexIfStack<Bar>(serie, -1);
|
||||
float gap = serie.barGap == -1 ? offset :
|
||||
offset + chart.GetSerieTotalGap<Bar>(categoryWidth, barGap, serieReadIndex, -1);
|
||||
var serieReadIndex = chart.GetSerieIndexIfStack<Bar>(serie);
|
||||
float gap = serie.barGap == -1 ? offset : offset + chart.GetSerieTotalGap<Bar>(categoryWidth, barGap, serieReadIndex);
|
||||
|
||||
var areaColor = ColorUtil.clearColor32;
|
||||
var areaToColor = ColorUtil.clearColor32;
|
||||
@@ -158,7 +157,7 @@ namespace XCharts.Runtime
|
||||
angleValue = serieData.GetData(1);
|
||||
if (m_AngleAxis.IsCategory())
|
||||
{
|
||||
start = (float)(startAngle + categoryWidth * angleValue + gap);
|
||||
start = (float) (startAngle + categoryWidth * angleValue + gap);
|
||||
end = start + barWidth;
|
||||
inside = m_SeriePolar.context.insideRadius;
|
||||
if (isStack)
|
||||
@@ -179,7 +178,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
end = start + m_AngleAxis.GetValueLength(angleValue, 360);
|
||||
serieData.context.stackHeight = end - start;
|
||||
inside = m_SeriePolar.context.insideRadius + categoryWidth * (float)radiusValue + gap;
|
||||
inside = m_SeriePolar.context.insideRadius + categoryWidth * (float) radiusValue + gap;
|
||||
outside = inside + barWidth;
|
||||
}
|
||||
serieData.context.startAngle = start;
|
||||
|
||||
@@ -161,13 +161,9 @@ namespace XCharts.Runtime
|
||||
m_SerieGrid = chart.GetChartComponent<GridCoord>(axis.gridIndex);
|
||||
if (m_SerieGrid == null)
|
||||
return;
|
||||
if (serie.useSortData)
|
||||
{
|
||||
SerieHelper.UpdateSerieRuntimeFilterData(serie);
|
||||
}
|
||||
|
||||
var dataZoom = chart.GetDataZoomOfAxis(axis);
|
||||
var showData = serie.GetDataList(dataZoom, true);
|
||||
var showData = serie.GetDataList(dataZoom);
|
||||
|
||||
if (showData.Count <= 0)
|
||||
return;
|
||||
@@ -180,16 +176,15 @@ namespace XCharts.Runtime
|
||||
if (isStack)
|
||||
SeriesHelper.UpdateStackDataList(chart.series, serie, dataZoom, m_StackSerieData);
|
||||
|
||||
var barCount = chart.GetSerieBarRealCount<Bar>(m_SerieGrid.index);
|
||||
var barCount = chart.GetSerieBarRealCount<Bar>();
|
||||
float categoryWidth = AxisHelper.GetDataWidth(axis, axisLength, showData.Count, dataZoom);
|
||||
float relativedCategoryWidth = AxisHelper.GetDataWidth(relativedAxis, relativedAxisLength, showData.Count, dataZoom);
|
||||
float barGap = chart.GetSerieBarGap<Bar>(m_SerieGrid.index);
|
||||
float totalBarWidth = chart.GetSerieTotalWidth<Bar>(categoryWidth, barGap, barCount, m_SerieGrid.index);
|
||||
float barGap = chart.GetSerieBarGap<Bar>();
|
||||
float totalBarWidth = chart.GetSerieTotalWidth<Bar>(categoryWidth, barGap, barCount);
|
||||
float barWidth = serie.GetBarWidth(categoryWidth, barCount);
|
||||
float offset = (categoryWidth - totalBarWidth) * 0.5f;
|
||||
var serieReadIndex = chart.GetSerieIndexIfStack<Bar>(serie, m_SerieGrid.index);
|
||||
float gap = serie.barGap == -1 ? offset :
|
||||
offset + chart.GetSerieTotalGap<Bar>(categoryWidth, barGap, serieReadIndex, m_SerieGrid.index);
|
||||
var serieReadIndex = chart.GetSerieIndexIfStack<Bar>(serie);
|
||||
float gap = serie.barGap == -1 ? offset : offset + chart.GetSerieTotalGap<Bar>(categoryWidth, barGap, serieReadIndex);
|
||||
int maxCount = serie.maxShow > 0 ?
|
||||
(serie.maxShow > showData.Count ? showData.Count : serie.maxShow) :
|
||||
showData.Count;
|
||||
@@ -241,7 +236,7 @@ namespace XCharts.Runtime
|
||||
var barHig = 0f;
|
||||
if (isPercentStack)
|
||||
{
|
||||
var valueTotal = chart.GetSerieSameStackTotalValue<Bar>(serie.stack, i, m_SerieGrid.index);
|
||||
var valueTotal = chart.GetSerieSameStackTotalValue<Bar>(serie.stack, i);
|
||||
barHig = valueTotal != 0 ? (float)(relativedValue / valueTotal * relativedAxisLength) : 0;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -122,11 +122,11 @@ namespace XCharts.Runtime
|
||||
var relativedAxisLength = isY ? m_SerieGrid.context.width : m_SerieGrid.context.height;
|
||||
var axisXY = isY ? m_SerieGrid.context.y : m_SerieGrid.context.x;
|
||||
|
||||
var barCount = chart.GetSerieBarRealCount<SimplifiedBar>(m_SerieGrid.index);
|
||||
var barCount = chart.GetSerieBarRealCount<SimplifiedBar>();
|
||||
float categoryWidth = AxisHelper.GetDataWidth(axis, axisLength, showData.Count, dataZoom);
|
||||
float relativedCategoryWidth = AxisHelper.GetDataWidth(relativedAxis, relativedAxisLength, showData.Count, dataZoom);
|
||||
float barGap = chart.GetSerieBarGap<SimplifiedBar>(m_SerieGrid.index);
|
||||
float totalBarWidth = chart.GetSerieTotalWidth<SimplifiedBar>(categoryWidth, barGap, barCount,m_SerieGrid.index);
|
||||
float barGap = chart.GetSerieBarGap<SimplifiedBar>();
|
||||
float totalBarWidth = chart.GetSerieTotalWidth<SimplifiedBar>(categoryWidth, barGap, barCount);
|
||||
float barWidth = serie.GetBarWidth(categoryWidth, barCount);
|
||||
float offset = (categoryWidth - totalBarWidth) * 0.5f;
|
||||
float barGapWidth = barWidth + barWidth * barGap;
|
||||
|
||||
@@ -33,19 +33,37 @@ namespace XCharts.Runtime
|
||||
var newMarker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
var newItemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
var isEmptyItemFormatter = string.IsNullOrEmpty(newItemFormatter);
|
||||
|
||||
if (isEmptyItemFormatter)
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = 1;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = 0;
|
||||
param.total = 0;
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = newItemFormatter;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serie.serieName);
|
||||
param.columns.Add(string.Empty);
|
||||
|
||||
paramList.Add(param);
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
var param = serie.context.param;
|
||||
param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = 1;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = 0;
|
||||
param.total = 0;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = SerieHelper.GetMaxData(serie, i);
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = newItemFormatter;
|
||||
@@ -53,56 +71,10 @@ namespace XCharts.Runtime
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serie.serieName);
|
||||
param.columns.Add(string.Empty);
|
||||
param.columns.Add(XCSettings.lang.GetCandlestickDimensionName(i - 1));
|
||||
param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = SerieHelper.GetMaxData(serie, i);
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = newItemFormatter;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.isSecondaryMark = true;
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(XCSettings.lang.GetCandlestickDimensionName(i - 1));
|
||||
param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newItemFormatter = newItemFormatter.Replace("\\n", "\n");
|
||||
var temp = newItemFormatter.Split('\n');
|
||||
foreach (var str in temp)
|
||||
{
|
||||
var param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = 0;
|
||||
param.total = 0;
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = str;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.isSecondaryMark = false;
|
||||
param.columns.Clear();
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,19 +33,37 @@ namespace XCharts.Runtime
|
||||
var newMarker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
var newItemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
var isEmptyItemFormatter = string.IsNullOrEmpty(newItemFormatter);
|
||||
|
||||
if (isEmptyItemFormatter)
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = 1;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = 0;
|
||||
param.total = 0;
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = newItemFormatter;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serie.serieName);
|
||||
param.columns.Add(string.Empty);
|
||||
|
||||
paramList.Add(param);
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
var param = serie.context.param;
|
||||
param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = 1;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = 0;
|
||||
param.total = 0;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = SerieHelper.GetMaxData(serie, i);
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = newItemFormatter;
|
||||
@@ -53,56 +71,10 @@ namespace XCharts.Runtime
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serie.serieName);
|
||||
param.columns.Add(string.Empty);
|
||||
param.columns.Add(XCSettings.lang.GetCandlestickDimensionName(i - 1));
|
||||
param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = SerieHelper.GetMaxData(serie, i);
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = newItemFormatter;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.isSecondaryMark = true;
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(XCSettings.lang.GetCandlestickDimensionName(i - 1));
|
||||
param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newItemFormatter = newItemFormatter.Replace("\\n", "\n");
|
||||
var temp = newItemFormatter.Split('\n');
|
||||
foreach (var str in temp)
|
||||
{
|
||||
var param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = 0;
|
||||
param.total = 0;
|
||||
param.color = color;
|
||||
param.marker = newMarker;
|
||||
param.itemFormatter = str;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.isSecondaryMark = false;
|
||||
param.columns.Clear();
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace XCharts.Runtime
|
||||
foreach (var serieData in serie.data)
|
||||
{
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
var symbolSize = symbol.GetSize(serieData, chart.theme.serie.lineSymbolSize);
|
||||
var symbolSize = symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
|
||||
serieData.context.highlight = false;
|
||||
serieData.interact.SetValue(ref needAnimation1, symbolSize);
|
||||
}
|
||||
|
||||
@@ -59,36 +59,24 @@ namespace XCharts.Runtime
|
||||
var dimension = VisualMapHelper.GetDimension(visualMap, defaultDimension);
|
||||
|
||||
title = serie.serieName;
|
||||
itemFormatter = SerieHelper.GetItemFormatter(serie, null, itemFormatter);
|
||||
numericFormatter = SerieHelper.GetNumericFormatter(serie, null, numericFormatter);
|
||||
marker = SerieHelper.GetItemMarker(serie, null, marker);
|
||||
var color = visualMap.GetColor(value);
|
||||
|
||||
if (itemFormatter == null) itemFormatter = "";
|
||||
itemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var temp = itemFormatter.Split('\n');
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = dimension;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.serieData = null;
|
||||
param.color = visualMap.GetColor(value);
|
||||
param.marker = SerieHelper.GetItemMarker(serie, null, marker);
|
||||
param.itemFormatter = SerieHelper.GetItemFormatter(serie, null, itemFormatter);
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, null, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = dimension;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.serieData = null;
|
||||
param.color = color;
|
||||
param.marker = marker;
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = numericFormatter;
|
||||
param.columns.Clear();
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add("count");
|
||||
param.columns.Add(ChartCached.NumberToStr(value, param.numericFormatter));
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add("count");
|
||||
param.columns.Add(ChartCached.NumberToStr(value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
paramList.Add(param);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -108,35 +96,24 @@ namespace XCharts.Runtime
|
||||
category = xAxis.GetData((int)serieData.GetData(0));
|
||||
}
|
||||
title = serie.serieName;
|
||||
itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
|
||||
if (itemFormatter == null) itemFormatter = "";
|
||||
itemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var temp = itemFormatter.Split('\n');
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = dimension;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.serieData = serieData;
|
||||
param.color = serieData.context.color;
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = dimension;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.serieData = serieData;
|
||||
param.color = serieData.context.color;
|
||||
param.marker = marker;
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = numericFormatter;
|
||||
param.columns.Clear();
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(category);
|
||||
param.columns.Add(ChartCached.NumberToStr(serieData.GetData(dimension), param.numericFormatter));
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(category);
|
||||
param.columns.Add(ChartCached.NumberToStr(serieData.GetData(dimension), param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +236,7 @@ namespace XCharts.Runtime
|
||||
var xValue = serieData.GetData(0);
|
||||
var yValue = serieData.GetData(1);
|
||||
var i = AxisHelper.GetAxisValueSplitIndex(xAxis, xValue, true, xCount);
|
||||
var j = AxisHelper.GetAxisValueSplitIndex(yAxis, yValue, true, yCount);
|
||||
var j = AxisHelper.GetAxisValueSplitIndex(yAxis, yValue,true, yCount);
|
||||
|
||||
if (serie.IsIgnoreValue(serieData, dimension))
|
||||
{
|
||||
@@ -391,7 +368,7 @@ namespace XCharts.Runtime
|
||||
var xValue = serieData.GetData(0);
|
||||
var yValue = serieData.GetData(1);
|
||||
var i = AxisHelper.GetAxisValueSplitIndex(xAxis, xValue, true, xCount);
|
||||
var j = AxisHelper.GetAxisValueSplitIndex(yAxis, yValue, true, yCount);
|
||||
var j = AxisHelper.GetAxisValueSplitIndex(yAxis, yValue,true, yCount);
|
||||
var key = GetGridKey(i, j);
|
||||
var count = 0;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace XCharts.Runtime
|
||||
foreach (var serieData in serie.data)
|
||||
{
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
var symbolSize = symbol.GetSize(serieData, chart.theme.serie.lineSymbolSize);
|
||||
var symbolSize = symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
|
||||
serieData.context.highlight = false;
|
||||
serieData.interact.SetValue(ref needAnimation1, symbolSize);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace XCharts.Runtime
|
||||
foreach (var serieData in serie.data)
|
||||
{
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
var symbolSize = symbol.GetSize(serieData, chart.theme.serie.lineSymbolSize);
|
||||
var symbolSize = symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
|
||||
serieData.context.highlight = false;
|
||||
serieData.interact.SetValue(ref needAnimation1, symbolSize);
|
||||
}
|
||||
|
||||
@@ -59,63 +59,31 @@ namespace XCharts.Runtime
|
||||
var colorIndex = serie.colorByData ? chart.GetLegendRealShowNameIndex(serieData.legendName) : serie.context.colorIndex;
|
||||
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal);
|
||||
title = serieData.name;
|
||||
|
||||
itemFormatter = SerieHelper.GetItemFormatter(serie, null, itemFormatter);
|
||||
numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
if (string.IsNullOrEmpty(itemFormatter))
|
||||
for (int i = 0; i < serieData.data.Count; i++)
|
||||
{
|
||||
for (int i = 0; i < serieData.data.Count; i++)
|
||||
{
|
||||
var indicator = radar.GetIndicator(i);
|
||||
if (indicator == null) continue;
|
||||
var indicator = radar.GetIndicator(i);
|
||||
if (indicator == null) continue;
|
||||
|
||||
var param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = indicator.max;
|
||||
param.color = color;
|
||||
param.category = radar.GetIndicatorName(i);
|
||||
param.marker = marker;
|
||||
param.itemFormatter = itemFormatter;
|
||||
param.numericFormatter = numericFormatter;
|
||||
param.columns.Clear();
|
||||
var param = new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = indicator.max;
|
||||
param.color = color;
|
||||
param.category = radar.GetIndicatorName(i);
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(indicator.name);
|
||||
param.columns.Add(ChartCached.NumberToStr(serieData.GetData(i), param.numericFormatter));
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(indicator.name);
|
||||
param.columns.Add(ChartCached.NumberToStr(serieData.GetData(i), param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var temp = itemFormatter.Split('\n');
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.dimension = i;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(i);
|
||||
param.total = serie.yTotal;
|
||||
param.color = color;
|
||||
param.category = radar.GetIndicatorName(i);
|
||||
param.marker = marker;
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = numericFormatter;
|
||||
param.columns.Clear();
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
paramList.Add(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +123,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serieData = serie.data[i];
|
||||
var symbol = SerieHelper.GetSerieSymbol(serie, serieData);
|
||||
var symbolSize = symbol.GetSize(serieData, chart.theme.serie.lineSymbolSize);
|
||||
var symbolSize = symbol.GetSize(serieData.data, chart.theme.serie.lineSymbolSize);
|
||||
if (m_LegendEnter)
|
||||
{
|
||||
serieData.context.highlight = true;
|
||||
@@ -316,7 +284,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
if (max - min == 0) continue;
|
||||
var radius = (float)(m_RadarCoord.context.dataRadius * (value - min) / (max - min));
|
||||
var radius = (float) (m_RadarCoord.context.dataRadius * (value - min) / (max - min));
|
||||
var currAngle = startAngle + (n + (m_RadarCoord.positionType == RadarCoord.PositionType.Between ? 0.5f : 0)) * angle;
|
||||
radius *= rate;
|
||||
if (n == 0)
|
||||
@@ -447,7 +415,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
lineColor = m_RadarCoord.outRangeColor;
|
||||
}
|
||||
var radius = (float)(max < 0 ? m_RadarCoord.context.dataRadius - m_RadarCoord.context.dataRadius * value / max :
|
||||
var radius = (float) (max < 0 ? m_RadarCoord.context.dataRadius - m_RadarCoord.context.dataRadius * value / max :
|
||||
m_RadarCoord.context.dataRadius * value / max);
|
||||
var currAngle = startAngle + (index + (m_RadarCoord.positionType == RadarCoord.PositionType.Between ? 0.5f : 0)) * angle;
|
||||
radius *= rate;
|
||||
|
||||
@@ -86,37 +86,27 @@ namespace XCharts.Runtime
|
||||
return;
|
||||
Color32 color, toColor;
|
||||
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, dataIndex);
|
||||
itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
|
||||
if (itemFormatter == null) itemFormatter = "";
|
||||
itemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var temp = itemFormatter.Split('\n');
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = defaultDimension;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(0);
|
||||
param.total = serieData.GetData(1);
|
||||
param.color = color;
|
||||
param.marker = marker;
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = numericFormatter;
|
||||
param.columns.Clear();
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = defaultDimension;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(0);
|
||||
param.total = serieData.GetData(1);
|
||||
param.color = color;
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serieData.name);
|
||||
param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serieData.name);
|
||||
param.columns.Add(ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
paramList.Add(param);
|
||||
}
|
||||
|
||||
private Vector3 GetLabelLineEndPosition(Serie serie, SerieData serieData, LabelLine labelLine)
|
||||
|
||||
@@ -29,38 +29,25 @@ namespace XCharts.Runtime
|
||||
|
||||
title = serie.serieName;
|
||||
|
||||
itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
var color = chart.GetMarkColor(serie, serieData);
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = 1;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.serieData = serieData;
|
||||
param.color = chart.GetMarkColor(serie, serieData);
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
if (itemFormatter == null) itemFormatter = "";
|
||||
itemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var temp = itemFormatter.Split('\n');
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
param.columns.Add(param.marker);
|
||||
if (!string.IsNullOrEmpty(serieData.name))
|
||||
param.columns.Add(serieData.name);
|
||||
param.columns.Add(ChartCached.NumberToStr(serieData.GetData(1), param.numericFormatter));
|
||||
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = 1;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.serieData = serieData;
|
||||
param.color = color;
|
||||
param.marker = marker;
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = numericFormatter;
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
if (!string.IsNullOrEmpty(serieData.name))
|
||||
param.columns.Add(serieData.name);
|
||||
param.columns.Add(ChartCached.NumberToStr(serieData.GetData(1), param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
paramList.Add(param);
|
||||
}
|
||||
|
||||
public override void DrawSerie(VertexHelper vh)
|
||||
|
||||
@@ -305,7 +305,6 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private float m_Top;
|
||||
[SerializeField] private float m_Bottom;
|
||||
[SerializeField] private bool m_InsertDataToHead;
|
||||
[SerializeField][Since("v3.14.0")] private bool m_RealtimeSort = false;
|
||||
|
||||
[SerializeField] private LineStyle m_LineStyle = new LineStyle();
|
||||
[SerializeField] private SerieSymbol m_Symbol = new SerieSymbol();
|
||||
@@ -984,15 +983,6 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_MinShowLabelValue, value)) { SetVerticesDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Whether to enable realtime sorting, which is used for bar-racing effect. Currently only available in Bar.
|
||||
/// ||是否开启实时排序,用来实现动态排序图效果。目前仅在Bar中生效。
|
||||
/// </summary>
|
||||
public bool realtimeSort
|
||||
{
|
||||
get { return m_RealtimeSort; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_RealtimeSort, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 系列中的数据内容数组。SerieData可以设置1到n维数据。
|
||||
/// </summary>
|
||||
public List<SerieData> data { get { return m_Data; } }
|
||||
@@ -1750,7 +1740,7 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
/// <param name="dataZoom"></param>
|
||||
/// <returns></returns>
|
||||
public List<SerieData> GetDataList(DataZoom dataZoom = null, bool sorted = false)
|
||||
public List<SerieData> GetDataList(DataZoom dataZoom = null)
|
||||
{
|
||||
if (dataZoom != null && dataZoom.enable &&
|
||||
(dataZoom.IsContainsXAxis(xAxisIndex) || dataZoom.IsContainsYAxis(yAxisIndex)))
|
||||
@@ -1760,7 +1750,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
else
|
||||
{
|
||||
return useSortData && sorted && context.sortedData.Count > 0 ? context.sortedData : m_Data;
|
||||
return useSortData && context.sortedData.Count > 0 ? context.sortedData : m_Data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2029,7 +2019,6 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public void AnimationFadeIn()
|
||||
{
|
||||
if (dataCount <= 0) return;
|
||||
ResetInteract();
|
||||
if (animation.enable) animation.FadeIn();
|
||||
SetVerticesDirty();
|
||||
@@ -2040,7 +2029,6 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public void AnimationFadeOut()
|
||||
{
|
||||
if (dataCount <= 0) return;
|
||||
ResetInteract();
|
||||
if (animation.enable) animation.FadeOut();
|
||||
SetVerticesDirty();
|
||||
@@ -2051,7 +2039,6 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public void AnimationPause()
|
||||
{
|
||||
if (dataCount <= 0) return;
|
||||
if (animation.enable) animation.Pause();
|
||||
SetVerticesDirty();
|
||||
}
|
||||
@@ -2061,7 +2048,6 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public void AnimationResume()
|
||||
{
|
||||
if (dataCount <= 0) return;
|
||||
if (animation.enable) animation.Resume();
|
||||
SetVerticesDirty();
|
||||
}
|
||||
@@ -2071,7 +2057,6 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public void AnimationReset()
|
||||
{
|
||||
if (dataCount <= 0) return;
|
||||
if (animation.enable) animation.Reset();
|
||||
SetVerticesDirty();
|
||||
}
|
||||
@@ -2081,7 +2066,6 @@ namespace XCharts.Runtime
|
||||
/// </summary>
|
||||
public void AnimationRestart()
|
||||
{
|
||||
if (dataCount <= 0) return;
|
||||
if (animation.enable) animation.Restart();
|
||||
SetVerticesDirty();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace XCharts.Runtime
|
||||
|
||||
public ChartLabel labelObject { get; set; }
|
||||
public ChartLabel titleObject { get; set; }
|
||||
public int sortIndex { get; set; }
|
||||
|
||||
private bool m_Show = true;
|
||||
/// <summary>
|
||||
@@ -759,18 +758,17 @@ namespace XCharts.Runtime
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void SetLabelActive(bool flag, bool force = false)
|
||||
public void SetLabelActive(bool flag)
|
||||
{
|
||||
if (labelObject != null) labelObject.SetActive(flag, force);
|
||||
if (labelObject != null) labelObject.SetActive(flag);
|
||||
foreach (var labelObject in context.dataLabels)
|
||||
{
|
||||
labelObject.SetActive(flag, force);
|
||||
labelObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIconActive(bool flag)
|
||||
{
|
||||
if (labelObject != null) labelObject.SetIconActive(flag);
|
||||
if (labelObject != null) labelObject.SetActive(flag);
|
||||
}
|
||||
|
||||
public void SetPolygon(params Vector2[] points)
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
serieData.SetLabelActive(false);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
var currLabel = SerieHelper.GetSerieLabel(serie, serieData);
|
||||
var isIgnore = serie.IsIgnoreIndex(serieData.index, defaultDimension);
|
||||
if (serie.show &&
|
||||
@@ -669,35 +669,28 @@ namespace XCharts.Runtime
|
||||
itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
|
||||
if (serie.placeHolder || TooltipHelper.IsIgnoreFormatter(itemFormatter))
|
||||
return;
|
||||
if (itemFormatter == null) itemFormatter = "";
|
||||
var newItemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
var temp = newItemFormatter.Split('\n');
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = dimension;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(dimension);
|
||||
param.ignore = ignore;
|
||||
param.total = serie.yTotal;
|
||||
param.color = chart.GetMarkColor(serie, serieData);
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.columns.Clear();
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(showCategory ? category : serie.serieName);
|
||||
param.columns.Add(ignore ? ignoreDataDefaultContent : ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = dimension;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(dimension);
|
||||
param.ignore = ignore;
|
||||
param.total = serie.yTotal;
|
||||
param.color = chart.GetMarkColor(serie, serieData);
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = itemFormatter;
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(showCategory ? category : serie.serieName);
|
||||
param.columns.Add(ignore ? ignoreDataDefaultContent : ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
|
||||
protected void UpdateItemSerieParams(ref List<SerieParams> paramList, ref string title,
|
||||
@@ -728,40 +721,29 @@ namespace XCharts.Runtime
|
||||
|
||||
Color32 color, toColor;
|
||||
SerieHelper.GetItemColor(out color, out toColor, serie, serieData, chart.theme, colorIndex, SerieState.Normal);
|
||||
var param = serie.context.param;
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
|
||||
if (itemFormatter == null) itemFormatter = "";
|
||||
var newItemFormatter = itemFormatter.Replace("\\n", "\n");
|
||||
var newNumericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
var temp = newItemFormatter.Split('\n');
|
||||
var mark = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
var total = serie.multiDimensionLabel ? serieData.GetTotalData() : serie.GetDataTotal(defaultDimension);
|
||||
for (int i = 0; i < temp.Length; i++)
|
||||
{
|
||||
var formatter = temp[i];
|
||||
var param = i == 0 ? serie.context.param : new SerieParams();
|
||||
param.serieName = serie.serieName;
|
||||
param.serieIndex = serie.index;
|
||||
param.category = category;
|
||||
param.dimension = dimension;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(param.dimension);
|
||||
param.ignore = ignore;
|
||||
param.total = serie.multiDimensionLabel ? serieData.GetTotalData() : serie.GetDataTotal(defaultDimension);
|
||||
param.color = color;
|
||||
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
|
||||
param.itemFormatter = itemFormatter;
|
||||
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);
|
||||
param.columns.Clear();
|
||||
|
||||
param.category = category;
|
||||
param.dimension = dimension;
|
||||
param.serieData = serieData;
|
||||
param.dataCount = serie.dataCount;
|
||||
param.value = serieData.GetData(param.dimension);
|
||||
param.ignore = ignore;
|
||||
param.total = total;
|
||||
param.color = color;
|
||||
param.marker = mark;
|
||||
param.itemFormatter = formatter;
|
||||
param.numericFormatter = newNumericFormatter;
|
||||
param.columns.Clear();
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serieData.name);
|
||||
|
||||
param.columns.Add(param.marker);
|
||||
param.columns.Add(serieData.name);
|
||||
param.columns.Add(ignore ? ignoreDataDefaultContent : ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
param.columns.Add(ignore ? ignoreDataDefaultContent : ChartCached.NumberToStr(param.value, param.numericFormatter));
|
||||
|
||||
paramList.Add(param);
|
||||
}
|
||||
paramList.Add(param);
|
||||
}
|
||||
|
||||
public void DrawLabelLineSymbol(VertexHelper vh, LabelLine labelLine, Vector3 startPos, Vector3 endPos, Color32 defaultColor)
|
||||
|
||||
@@ -705,7 +705,7 @@ namespace XCharts.Runtime
|
||||
if (stateStyle == null)
|
||||
{
|
||||
var symbol = GetSerieSymbol(serie, serieData, SerieState.Normal);
|
||||
size = symbol.GetSize(serieData, defaultSize);
|
||||
size = symbol.GetSize(serieData == null ? null : serieData.data, defaultSize);
|
||||
switch (state)
|
||||
{
|
||||
case SerieState.Emphasis:
|
||||
@@ -719,7 +719,7 @@ namespace XCharts.Runtime
|
||||
else
|
||||
{
|
||||
var symbol = stateStyle.symbol;
|
||||
size = symbol.GetSize(serieData, defaultSize);
|
||||
size = symbol.GetSize(serieData == null ? null : serieData.data, defaultSize);
|
||||
}
|
||||
if (serieData != null && checkAnimation)
|
||||
{
|
||||
@@ -955,10 +955,6 @@ namespace XCharts.Runtime
|
||||
|
||||
public static void UpdateSerieRuntimeFilterData(Serie serie, bool filterInvisible = true)
|
||||
{
|
||||
var realtimeData = true;
|
||||
var dataChangeDuration = serie.animation.GetChangeDuration();
|
||||
var dataAddDuration = serie.animation.GetAdditionDuration();
|
||||
var unscaledTime = serie.animation.unscaledTime;
|
||||
serie.context.sortedData.Clear();
|
||||
foreach (var serieData in serie.data)
|
||||
{
|
||||
@@ -970,12 +966,8 @@ namespace XCharts.Runtime
|
||||
case SerieDataSortType.Ascending:
|
||||
serie.context.sortedData.Sort(delegate (SerieData data1, SerieData data2)
|
||||
{
|
||||
var value1 = realtimeData ?
|
||||
data1.GetCurrData(1, dataAddDuration, dataChangeDuration, false, 0, 0, unscaledTime) :
|
||||
data1.GetData(1);
|
||||
var value2 = realtimeData ?
|
||||
data2.GetCurrData(1, dataAddDuration, dataChangeDuration, false, 0, 0, unscaledTime) :
|
||||
data2.GetData(1);
|
||||
var value1 = data1.GetData(1);
|
||||
var value2 = data2.GetData(1);
|
||||
if (value1 == value2) return 0;
|
||||
else if (value1 > value2) return 1;
|
||||
else return -1;
|
||||
@@ -984,12 +976,8 @@ namespace XCharts.Runtime
|
||||
case SerieDataSortType.Descending:
|
||||
serie.context.sortedData.Sort(delegate (SerieData data1, SerieData data2)
|
||||
{
|
||||
var value1 = realtimeData ?
|
||||
data1.GetCurrData(1, dataAddDuration, dataChangeDuration, false, 0, 0, unscaledTime) :
|
||||
data1.GetData(1);
|
||||
var value2 = realtimeData ?
|
||||
data2.GetCurrData(1, dataAddDuration, dataChangeDuration, false, 0, 0, unscaledTime) :
|
||||
data2.GetData(1);
|
||||
var value1 = data1.GetData(1);
|
||||
var value2 = data2.GetData(1);
|
||||
if (value1 == value2) return 0;
|
||||
else if (value1 > value2) return -1;
|
||||
else return 1;
|
||||
@@ -998,10 +986,6 @@ namespace XCharts.Runtime
|
||||
case SerieDataSortType.None:
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < serie.context.sortedData.Count; i++)
|
||||
{
|
||||
serie.context.sortedData[i].sortIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
public static T CloneSerie<T>(Serie serie) where T : Serie
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace XCharts.Runtime
|
||||
public int serieIndex;
|
||||
public string serieName;
|
||||
public string marker = "●";
|
||||
public bool isSecondaryMark;
|
||||
public string category;
|
||||
public int dimension;
|
||||
public SerieData serieData;
|
||||
@@ -21,6 +20,6 @@ namespace XCharts.Runtime
|
||||
public string itemFormatter;
|
||||
public string numericFormatter;
|
||||
public bool ignore;
|
||||
public List<string> columns = new List<string>();
|
||||
public List<string> columns = new List<string>();
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
"displayName": "XCharts",
|
||||
"author": "monitor1394",
|
||||
"license": "MIT",
|
||||
"version": "3.14.0",
|
||||
"date": "20250315",
|
||||
"checkdate": "20250315",
|
||||
"version": "3.13.0",
|
||||
"date": "20250101",
|
||||
"checkdate": "20250101",
|
||||
"unity": "2018.3",
|
||||
"description": "A charting and data visualization library for Unity. Support line chart, bar chart, pie chart, radar chart, scatter chart, heatmap chart, ring chart, candlestick chart, polar chart and parallel coordinates.",
|
||||
"keywords": [
|
||||
|
||||