Compare commits

...

91 Commits

Author SHA1 Message Date
monitor1394
3b7e8184b0 3.11.0 2024-06-16 21:59:31 +08:00
monitor1394
33b7e5c1a4 3.11.0 2024-06-16 19:21:25 +08:00
monitor1394
24270e5c69 3.11.0 2024-06-16 19:05:40 +08:00
monitor1394
e3fb5685bf 增加EditorData的添加、删除、上下移动操作按钮 2024-06-15 13:21:38 +08:00
monitor1394
89e7a09e64 增加Edge判断接口 2024-06-13 23:04:35 +08:00
monitor1394
ee5efa9f8d 增加DrawEdge绘制由上下坐标列表组成的边 2024-06-13 22:59:37 +08:00
monitor1394
2fe9a40f42 3.11.0-preview2 2024-06-11 08:28:46 +08:00
monitor1394
ddbd82bebf 修复AxisIndicatorLabel可能会遮挡住Tooltip的问题 2024-06-11 08:14:34 +08:00
monitor1394
549ee43a37 修复TooltipCrossAxisIndicatorLabel可能不显示的问题 (#315) 2024-06-11 08:11:27 +08:00
monitor1394
3b9af0f8ec 调整TooltipCorss重命名为Cross 2024-06-10 22:42:20 +08:00
monitor1394
caee79630b 增加Axism_MinCategorySpacing设置类目轴默认的最小类目间距 2024-06-09 22:59:38 +08:00
monitor1394
a12c98b1a5 修复TooltipCross在开启DataZoom时指示位置不准确的问题 2024-06-09 22:13:26 +08:00
monitor1394
8617475808 优化一个Chart里有多个Serie时的Tooltip显示问题 2024-06-08 13:24:24 +08:00
monitor1394
922901380e 修复SerieClone时动画异常问题 (#320) 2024-06-06 13:07:34 +08:00
monitor1394
96cb7ffc74 修复Seriestate在代码动态设置时不刷新的问题 2024-06-04 08:40:43 +08:00
monitor1394
74cf4fe4ce 优化坐标轴Tick最小间距 2024-06-03 08:13:17 +08:00
monitor1394
eb948f03d5 完善关系图初始化 2024-06-03 08:12:32 +08:00
monitor1394
6a6ab72ed8 调整XChartsHierarchy视图下的右键菜单到UI/XCharts 2024-05-29 21:58:31 +08:00
monitor1394
df66f5c7ee 增加3D坐标系显示边框参数 2024-05-29 13:14:21 +08:00
monitor1394
042f9d3c01 增加3D坐标系对类目轴的支持 2024-05-29 08:33:00 +08:00
monitor1394
1e6140a138 3.11.0-preview1 2024-05-20 08:33:09 +08:00
monitor1394
86125c597e 优化Editor下编辑性能 2024-05-19 11:02:03 +08:00
monitor1394
fc346d30fb 优化第三方数据导入 2024-05-19 11:01:46 +08:00
monitor1394
3e8bf7caee 优化Line3D绘制 2024-05-15 13:19:34 +08:00
monitor1394
4e3182edfc 增加JsonUtil工具类 2024-05-09 13:13:51 +08:00
monitor1394
b86cae6717 Merge pull request #311 from stefanbursuc/fix-gc-allocations-in-tooltiphandler
Fix for GC Allocations inside TooltipHandler
2024-05-01 22:22:04 +08:00
monitor1394
0c92d08f0d 修复ConvertXYAxis()多次调用后图表异常的问题 2024-04-23 22:16:28 +08:00
monitor1394
b1522a27d4 修复DataZoom控制多个轴时的GridCoord获取可能不正确的问题 (#317) 2024-04-22 22:35:39 +08:00
monitor1394
120c6d5408 增加GridCoord3D3D坐标系 2024-04-22 22:25:12 +08:00
monitor1394
e2120b3da6 优化DateTimeUtil时间戳转DateTime接口时区的问题 2024-04-16 22:30:04 +08:00
monitor1394
58e6108bb2 优化GridCoord在开启GridLayout时也显示Left Right Top Bottom参数 (#316) 2024-04-15 08:18:12 +08:00
monitor1394
3ef2e7c23c 修复TooltipCross在开启DataZoom的情况下label位置不正确的问题 (#315) 2024-04-14 19:09:08 +08:00
monitor1394
a361e191da 修复Candlesticks效果不对的问题 (#313) 2024-04-12 08:30:34 +08:00
Stefan Bursuc
f5a41b5119 Fix for GC Allocations inside TooltipHandler
In the case where the pointer is not in the chart, both calls to
ListPool<Serie>.Get() from inside the function UpdateTooltipData
are executed.

And because the pointer is not in the chart, m_ShowTooltip is set to
false in the last else clause.

This makes UpdateTooltip to skip all logic and miss the chance to release
the list back to the pool.
2024-04-08 11:24:28 +02:00
monitor1394
42079848dc 优化桑吉图折叠显示 2024-03-20 22:23:58 +08:00
monitor1394
4b8374b1ae 修复Pie在设置ItemStyleopacity时颜色不对的问题 (#309) 2024-03-20 13:36:31 +08:00
monitor1394
0990b11c1c 增加TooltiptriggerOn指定触发条件 2024-03-20 13:34:21 +08:00
monitor1394
99b1624b54 增加数据图的折叠和展开支持 2024-03-20 08:31:05 +08:00
monitor1394
113c3887ae 3.10.2 2024-03-11 08:12:28 +08:00
monitor1394
9f5040435f 修复Tooltip移出坐标系后还显示的问题 2024-03-11 08:04:07 +08:00
monitor1394
f21e9c6a32 修复Legendformatter在设置{d}通配符时显示可能不匹配的问题 (#304) 2024-03-11 08:04:00 +08:00
monitor1394
a071956675 修复Legendformatter在设置{d}通配符时显示可能不匹配的问题 2024-03-11 08:03:53 +08:00
monitor1394
eab4f9530b 修复Tooltiptitle从旧版本升级后可能不显示的问题 2024-03-11 08:03:48 +08:00
monitor1394
ce8b03b692 3.10.1 2024-02-21 08:38:45 +08:00
monitor1394
2505a48ac2 修复Tooltip的圆点标记不会自适应颜色的问题 2024-02-19 08:53:31 +08:00
monitor1394
74e75e93af 修复Tooltip的圆点标记不会自适应颜色的问题 2024-02-19 08:51:06 +08:00
monitor1394
4f8390b515 3.10.0 2024-02-01 13:23:04 +08:00
monitor1394
d91ebeee3a 修复divide by zero的问题 2024-01-31 22:40:50 +08:00
monitor1394
b9c5623687 修复Tooltip在设置itemFormatter-后整个不显示的问题 2024-01-31 13:21:20 +08:00
monitor1394
34b4096482 修复Attempted to divide by zero报错 #302 2024-01-30 23:40:27 +08:00
monitor1394
bc75865a5e 修复TextLimit在开启TextMeshPro后无效的问题 (#301) 2024-01-27 13:40:16 +08:00
monitor1394
c987cb1ef7 修复TextLimit在开启TextMeshPro后无效的问题 (#301) 2024-01-27 13:35:47 +08:00
monitor1394
d93f7830de 增加Bar支持X轴和Y轴都为Category类目轴 2024-01-24 13:31:06 +08:00
monitor1394
61a2da10ba 增加{y}通配符用于获取Y轴的类目名 2024-01-23 22:56:03 +08:00
monitor1394
9e39150009 增加Line支持X轴和Y轴都为Category类目轴 2024-01-23 22:55:46 +08:00
monitor1394
653b81cc48 3.10.0 2024-01-21 22:33:45 +08:00
monitor1394
e68e41a939 3.10.0 2024-01-21 21:17:34 +08:00
monitor1394
d0448a5b11 修复Animationtype代码动态修改无效的问题 2024-01-18 22:41:32 +08:00
monitor1394
daec83c4a5 调整UI组件相关代码 2024-01-16 22:29:15 +08:00
monitor1394
6aa11249c5 Editor上添加第二个X轴或Y轴时自动设置位置 2024-01-14 10:56:36 +08:00
monitor1394
9a56985b3a 增加Chart的更多快捷创建图表菜单 2024-01-13 22:37:13 +08:00
monitor1394
fff04347fa 增加Chart的更多快捷创建图表菜单 2024-01-13 22:16:16 +08:00
monitor1394
5a5ad1e108 优化图表细节 2024-01-13 22:11:01 +08:00
monitor1394
3c233d1cb1 屏蔽ChartInit()接口,动态创建图表不再需要调用 2024-01-12 13:23:46 +08:00
monitor1394
c44583772c 完善动态创建图表功能 2024-01-12 08:29:02 +08:00
monitor1394
29e9593179 增加MainComponent的order设置执行优先级 2024-01-11 22:34:18 +08:00
monitor1394
318bdcb1f2 增加BackgroundborderStyle,给图表默认设置圆角 2024-01-11 08:03:36 +08:00
monitor1394
c3489fbc1e 修复Tooltop的第一个ContentLabelStyle设置color无效的问题 2024-01-07 22:13:03 +08:00
monitor1394
91db00a173 增加BorderStyle边框样式 2024-01-01 22:57:50 +08:00
monitor1394
a3533dbc02 增加DrawRoundRectangleWithBorder接口 2024-01-01 22:55:50 +08:00
monitor1394
f1c504e81a 增加HeatmapmaxCache参数支持 2023-12-26 23:08:41 +08:00
monitor1394
178215d980 修复Line开启clip时绘制的顶点数可能反而增加的问题 2023-12-25 23:05:06 +08:00
monitor1394
cbd527316e 修复Scatter散点图部分边界数据不显示的问题 2023-12-22 17:16:21 +08:00
monitor1394
3580df9117 修复TriggerTooltip()接口在指定0或最大index时可能无法触发的问题 2023-12-21 22:41:12 +08:00
monitor1394
11bdbba286 update doc 2023-12-20 13:26:29 +08:00
monitor1394
4ed22190d6 update doc 2023-12-20 13:19:07 +08:00
monitor1394
06ef86a9d6 修复LegendLabelStyleformatter不生效的问题 2023-12-19 22:02:05 +08:00
monitor1394
3d73578063 更新FAQ 2023-12-17 22:11:35 +08:00
monitor1394
07caa54631 更新FAQ 2023-12-17 22:05:57 +08:00
monitor1394
023eeb9ea8 优化border 2023-12-16 22:34:00 +08:00
monitor1394
2431a001b1 优化border 2023-12-16 22:31:34 +08:00
monitor1394
e83eeabf9c 优化Bar的边框绘制 2023-12-16 10:03:28 +08:00
monitor1394
9c5b83dc22 修复settings的lineSmoothness用代码设置无效的问题 2023-12-14 19:33:11 +08:00
monitor1394
9d2b14afef 代码优化 2023-12-14 19:22:02 +08:00
monitor1394
63173cdce6 代码优化 2023-12-14 10:20:48 +08:00
monitor1394
922a944881 增加LegendTextLimit可限制图例显示文本的长度 2023-12-12 10:22:32 +08:00
monitor1394
53c7ddf9d4 修复Serie添加double.MaxValue时坐标绘制失败的问题 2023-12-11 13:43:03 +08:00
monitor1394
a50bda5344 增加SerieminShowLabel可隐藏小于指定值的label 2023-12-10 21:23:57 +08:00
monitor1394
e8c8ab87aa 增加桑基图相关支持 2023-12-09 23:22:00 +08:00
monitor1394
1c6904f074 增加ResetChartStatus()可主动重置图表状态 2023-12-05 22:43:49 +08:00
monitor1394
225fc69e70 3.9.0 2023-12-01 21:26:27 +08:00
182 changed files with 6706 additions and 994 deletions

View File

@@ -22,6 +22,7 @@ slug: /api
- [AreaStyle](#areastyle)
- [ArrowStyle](#arrowstyle)
- [Axis](#axis)
- [Axis3DHelper](#axis3dhelper)
- [AxisAnimation](#axisanimation)
- [AxisContext](#axiscontext)
- [AxisHandler&lt;T&gt;](#axishandlert)
@@ -45,6 +46,7 @@ slug: /api
- [BaseScatter](#basescatter)
- [BaseSerie](#baseserie)
- [BlurStyle](#blurstyle)
- [BorderStyle](#borderstyle)
- [CalendarCoord](#calendarcoord)
- [Candlestick](#candlestick)
- [CandlestickChart](#candlestickchart)
@@ -66,6 +68,7 @@ slug: /api
- [ComponentTheme](#componenttheme)
- [CoordOptionsAttribute](#coordoptionsattribute)
- [CoordSystem](#coordsystem)
- [DataHelper](#datahelper)
- [DataZoom](#datazoom)
- [DataZoomContext](#datazoomcontext)
- [DataZoomHelper](#datazoomhelper)
@@ -79,7 +82,12 @@ slug: /api
- [EmphasisStyle](#emphasisstyle)
- [EndLabelStyle](#endlabelstyle)
- [FormatterHelper](#formatterhelper)
- [GraphData](#graphdata)
- [GraphEdge](#graphedge)
- [GraphNode](#graphnode)
- [GridCoord](#gridcoord)
- [GridCoord3D](#gridcoord3d)
- [GridCoord3DContext](#gridcoord3dcontext)
- [GridCoordContext](#gridcoordcontext)
- [GridLayout](#gridlayout)
- [GridLayoutContext](#gridlayoutcontext)
@@ -99,6 +107,7 @@ slug: /api
- [ISimplifiedSerie](#isimplifiedserie)
- [ItemStyle](#itemstyle)
- [IUpdateRuntimeData](#iupdateruntimedata)
- [JsonUtil](#jsonutil)
- [LabelLine](#labelline)
- [LabelStyle](#labelstyle)
- [Lang](#lang)
@@ -115,10 +124,12 @@ slug: /api
- [Line](#line)
- [LineArrow](#linearrow)
- [LineChart](#linechart)
- [LineHelper](#linehelper)
- [LineStyle](#linestyle)
- [ListFor](#listfor)
- [ListForComponent](#listforcomponent)
- [ListForSerie](#listforserie)
- [ListPool&lt;T&gt;](#listpoolt)
- [Location](#location)
- [MainComponent](#maincomponent)
- [MainComponentContext](#maincomponentcontext)
@@ -169,6 +180,7 @@ slug: /api
- [SerieDataComponentAttribute](#seriedatacomponentattribute)
- [SerieDataContext](#seriedatacontext)
- [SerieDataExtraFieldAttribute](#seriedataextrafieldattribute)
- [SerieDataLink](#seriedatalink)
- [SerieEventData](#serieeventdata)
- [SerieEventDataPool](#serieeventdatapool)
- [SerieHandler](#seriehandler)
@@ -195,7 +207,6 @@ slug: /api
- [StateStyle](#statestyle)
- [SubTitleTheme](#subtitletheme)
- [SVG](#svg)
- [SVGImage](#svgimage)
- [SVGPath](#svgpath)
- [SVGPathSeg](#svgpathseg)
- [SymbolStyle](#symbolstyle)
@@ -220,12 +231,15 @@ slug: /api
- [UIComponent](#uicomponent)
- [UIComponentTheme](#uicomponenttheme)
- [UIHelper](#uihelper)
- [ViewControl](#viewcontrol)
- [VisualMap](#visualmap)
- [VisualMapContext](#visualmapcontext)
- [VisualMapHelper](#visualmaphelper)
- [VisualMapRange](#visualmaprange)
- [VisualMapTheme](#visualmaptheme)
- [Wrapper&lt;T&gt;](#wrappert)
- [XAxis](#xaxis)
- [XAxis3D](#xaxis3d)
- [XChartsMgr](#xchartsmgr)
- [XCResourceImporterWindow](#xcresourceimporterwindow)
- [XCResourcesImporter](#xcresourcesimporter)
@@ -233,6 +247,8 @@ slug: /api
- [XCThemeMgr](#xcthememgr)
- [XLog](#xlog)
- [YAxis](#yaxis)
- [YAxis3D](#yaxis3d)
- [ZAxis3D](#zaxis3d)
## AngleAxis
@@ -385,7 +401,7 @@ the animation of serie. support animation type: fadeIn, fadeOut, change, additio
|public method|since|description|
|--|--|--|
|CheckDataAnimation()||public static float CheckDataAnimation(BaseChart chart, Serie serie, int dataIndex, float destProgress, float startPorgress = 0)|
|GetAnimationPosition()||public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip)|
|GetAnimationPosition()||public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip, ref float rate)|
|UpdateAnimationType()||public static void UpdateAnimationType(AnimationStyle animation, AnimationType defaultType, bool enableSerieDataAnimation)|
|UpdateSerieAnimation()||public static void UpdateSerieAnimation(Serie serie)|
@@ -413,7 +429,7 @@ The style of area.
## Axis
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [AngleAxis](#angleaxis),[ParallelAxis](#parallelaxis),[RadiusAxis](#radiusaxis),[SingleAxis](#singleaxis),[XAxis](#xaxis),[YAxis](#yaxis)
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [AngleAxis](#angleaxis),[ParallelAxis](#parallelaxis),[RadiusAxis](#radiusaxis),[SingleAxis](#singleaxis),[XAxis](#xaxis),[XAxis3D](#xaxis3d),[YAxis](#yaxis),[YAxis3D](#yaxis3d),[ZAxis3D](#zaxis3d)
The axis in rectangular coordinate.
@@ -426,9 +442,11 @@ The axis in rectangular coordinate.
|ClearVerticesDirty()||public override void ClearVerticesDirty()|
|Clone()||public Axis Clone()|
|Copy()||public void Copy(Axis axis)|
|GetAddedDataCount()||public int GetAddedDataCount()<br/>get the history data count. |
|GetCategoryPosition()||public Vector3 GetCategoryPosition(int categoryIndex, int dataCount = 0)|
|GetData()||public string GetData(int index)<br/>获得指定索引的类目数据 |
|GetData()||public string GetData(int index, DataZoom dataZoom)<br/>获得在dataZoom范围内指定索引的类目数据 |
|GetDistance()||public float GetDistance(double value, float axisLength)<br/>获得值在坐标轴上的距离 |
|GetDistance()||public float GetDistance(double value, float axisLength = 0)<br/>获得值在坐标轴上的距离 |
|GetIcon()||public Sprite GetIcon(int index)|
|GetLabelValue()||public double GetLabelValue(int index)|
|GetLastLabelValue()||public double GetLastLabelValue()|
@@ -446,12 +464,24 @@ The axis in rectangular coordinate.
|IsTop()||public bool IsTop()|
|IsValue()||public bool IsValue()<br/>是否为数值轴。 |
|RemoveData()||public void RemoveData(int dataIndex)|
|ResetStatus()||public override void ResetStatus()<br/>重置状态。 |
|SetComponentDirty()||public override void SetComponentDirty()|
|SetNeedUpdateFilterData()||public void SetNeedUpdateFilterData()|
|UpdateData()||public void UpdateData(int index, string category)<br/>更新类目数据 |
|UpdateIcon()||public void UpdateIcon(int index, Sprite icon)<br/>更新图标 |
|UpdateZeroOffset()||public void UpdateZeroOffset(float axisLength)|
## Axis3DHelper
> class in XCharts.Runtime
|public method|since|description|
|--|--|--|
|Get3DGridPosition()||public static Vector3 Get3DGridPosition(GridCoord3D grid, XAxis3D xAxis, YAxis3D yAxis, double xValue, double yValue)|
|Get3DGridPosition()||public static Vector3 Get3DGridPosition(GridCoord3D grid, XAxis3D xAxis, YAxis3D yAxis, ZAxis3D zAxis, double xValue, double yValue, double zValue)|
|GetLabelPosition()||public static Vector3 GetLabelPosition(int i, Axis axis, Axis relativedAxis, AxisTheme theme, float scaleWid)|
## AxisAnimation
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
@@ -492,7 +522,7 @@ animation style of axis.
|GetAxisValueDistance()||public static float GetAxisValueDistance(GridCoord grid, Axis axis, float scaleWidth, double value)<br/>获得数值value在坐标轴上相对起点的距离 |
|GetAxisValueLength()||public static float GetAxisValueLength(GridCoord grid, Axis axis, float scaleWidth, double value)<br/>获得数值value在坐标轴上对应的长度 |
|GetAxisValuePosition()||public static float GetAxisValuePosition(GridCoord grid, Axis axis, float scaleWidth, double value)<br/>获得数值value在坐标轴上的坐标位置 |
|GetAxisValueSplitIndex()||public static int GetAxisValueSplitIndex(Axis axis, double value, int totalSplitNumber = -1)<br/>获得数值value在坐标轴上对应的split索引 |
|GetAxisValueSplitIndex()||public static int GetAxisValueSplitIndex(Axis axis, double value, bool checkMaxCache, int totalSplitNumber = -1)<br/>获得数值value在坐标轴上对应的split索引 |
|GetAxisXOrY()||public static float GetAxisXOrY(GridCoord grid, Axis axis, Axis relativedAxis)|
|GetDataWidth()||public static float GetDataWidth(Axis axis, float coordinateWidth, int dataCount, DataZoom dataZoom)<br/>获得一个类目数据在坐标系中代表的宽度 |
|GetEachWidth()||public static float GetEachWidth(Axis axis, float coordinateWidth, DataZoom dataZoom = null)|
@@ -638,6 +668,21 @@ Background component.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Bar chart shows different data through the height of a bar, which is used in rectangular coordinate with at least 1 category axis.
|public method|since|description|
|--|--|--|
|DefaultBarChart()||public void DefaultBarChart()<br/>default bar chart. |
|DefaultCapsuleBarChart()||public void DefaultCapsuleBarChart()<br/>default capsule bar chart. |
|DefaultCapsuleColumnChart()||public void DefaultCapsuleColumnChart()<br/>default capsule column chart. |
|DefaultGroupedBarChart()||public void DefaultGroupedBarChart()<br/>default grouped bar chart. |
|DefaultGroupedColumnChart()||public void DefaultGroupedColumnChart()<br/>default grouped column chart. |
|DefaultPercentBarChart()||public void DefaultPercentBarChart()<br/>default percent bar chart. |
|DefaultPercentColumnChart()||public void DefaultPercentColumnChart()<br/>default percent column chart. |
|DefaultStackedBarChart()||public void DefaultStackedBarChart()<br/>default stacked bar chart. |
|DefaultStackedColumnChart()||public void DefaultStackedColumnChart()<br/>default stacked column chart. |
|DefaultZebraBarChart()||public void DefaultZebraBarChart()<br/>default zebra bar chart. |
|DefaultZebraColumnChart()||public void DefaultZebraColumnChart()<br/>default zebra column chart. |
## BaseAxisTheme
@@ -689,6 +734,7 @@ Background component.
|AddData()||public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)<br/>Add a (x,y) data to serie. |
|AddData()||public SerieData AddData(string serieName, List&lt;double&gt; multidimensionalData, string dataName = null, string dataId = null)<br/>Add an arbitray dimension data to serie,such as (x,y,z,...). |
|AddData()||public SerieData AddData(string serieName, params double[] multidimensionalData)<br/>Add an arbitray dimension data to serie,such as (x,y,z,...). |
|AddLink()||public SerieDataLink AddLink(int serieIndex, string sourceId, string targetId, double value = 0)<br/>Add a link data to serie. |
|AddSerie&lt;T&gt;()||public T AddSerie&lt;T&gt;(string serieName = null, bool show = true, bool addToHead = false) where T : Serie|
|AddXAxisData()||public void AddXAxisData(string category, int xAxisIndex = 0)<br/>Add a category data to xAxis. |
|AddXAxisIcon()||public void AddXAxisIcon(Sprite icon, int xAxisIndex = 0)<br/>Add an icon to xAxis. |
@@ -707,9 +753,10 @@ Background component.
|CanMultipleComponent()||public bool CanMultipleComponent(Type type)|
|ClampInChart()||public void ClampInChart(ref Vector3 pos)|
|ClampInGrid()||public Vector3 ClampInGrid(GridCoord grid, Vector3 pos)|
|ClearComponentData()||public virtual void ClearComponentData()<br/>Clear the data of all components. |
|ClearComponentData()|v3.4.0|public virtual void ClearComponentData()<br/>Clear the data of all components. |
|ClearData()||public virtual void ClearData()<br/>Clear all components and series data. Note: serie only empties the data and does not remove serie. |
|ClearSerieData()||public virtual void ClearSerieData()<br/>Clear the data of all series. |
|ClearSerieData()|v3.4.0|public virtual void ClearSerieData()<br/>Clear the data of all series. |
|ClearSerieLinks()|v3.10.0|public virtual void ClearSerieLinks()<br/>Clear the link data of all series. |
|ClickLegendButton()||public void ClickLegendButton(int legendIndex, string legendName, bool show)<br/>点击图例按钮 |
|ConvertSerie()||public bool ConvertSerie(Serie serie, Type type)|
|ConvertSerie&lt;T&gt;()||public bool ConvertSerie&lt;T&gt;(Serie serie) where T : Serie|
@@ -733,7 +780,7 @@ Background component.
|GetItemColor()||public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)|
|GetLegendRealShowNameColor()||public Color32 GetLegendRealShowNameColor(string name)|
|GetLegendRealShowNameIndex()||public int GetLegendRealShowNameIndex(string name)|
|GetMarkColor()||public Color32 GetMarkColor(Serie serie, SerieData serieData)<br/>获得Serie的标识颜色。 |
|GetMarkColor()|v3.4.0|public Color32 GetMarkColor(Serie serie, SerieData serieData)<br/>获得Serie的标识颜色。 |
|GetOrAddChartComponent&lt;T&gt;()||public T GetOrAddChartComponent&lt;T&gt;() where T : MainComponent|
|GetPainter()||public Painter GetPainter(int index)|
|GetSerie()||public Serie GetSerie(int serieIndex)|
@@ -809,8 +856,10 @@ Background component.
|RemoveSerie()||public void RemoveSerie(string serieName)|
|RemoveSerie&lt;T&gt;()||public void RemoveSerie&lt;T&gt;() where T : Serie|
|ReplaceSerie()||public bool ReplaceSerie(Serie oldSerie, Serie newSerie)|
|ResetChartStatus()|v3.10.0|public void ResetChartStatus()<br/>reset chart status. When some parameters are set, due to the animation effect, the chart status may not be correct. |
|ResetDataIndex()||public bool ResetDataIndex(int serieIndex)<br/>重置serie的数据项索引。避免数据项索引异常。 |
|SetBasePainterMaterial()||public void SetBasePainterMaterial(Material material)<br/>设置Base Painter的材质球 |
|SetInsertDataToHead()|v3.11.0|public void SetInsertDataToHead(bool insertDataToHead)<br/>set insert data to head. |
|SetMaxCache()||public void SetMaxCache(int maxCache)<br/>设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。 |
|SetPainterActive()||public void SetPainterActive(int index, bool flag)|
|SetSerieActive()||public void SetSerieActive(int serieIndex, bool active)<br/>Whether to show serie. |
@@ -930,6 +979,20 @@ Settings related to base line.
Configurations of blur state.
## BorderStyle
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.10.0`
The style of border.
|public method|since|description|
|--|--|--|
|GetRuntimeBorderColor()||public Color32 GetRuntimeBorderColor()|
|GetRuntimeBorderWidth()||public float GetRuntimeBorderWidth()|
|GetRuntimeCornerRadius()||public float[] GetRuntimeCornerRadius()|
## CalendarCoord
> class in XCharts.Runtime / Inherits from: [CoordSystem](#coordsystem),[IUpdateRuntimeData](#iupdateruntimedata),[ISerieContainer](#iseriecontainer)
@@ -953,6 +1016,7 @@ Configurations of blur state.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
A candlestick chart is a style of financial chart used to describe price movements of a security, derivative, or currency.
## ChartCached
@@ -1046,6 +1110,7 @@ Configurations of blur state.
|SetActive()||public static void SetActive(Image image, bool active)|
|SetActive()||public static void SetActive(Text text, bool active)|
|SetActive()||public static void SetActive(Transform transform, bool active)<br/>通过设置scale实现是否显示优化性能减少GC |
|SetBackground()||public static void SetBackground(Image background, Background imageStyle)|
|SetBackground()||public static void SetBackground(Image background, ImageStyle imageStyle)|
|SetColorOpacity()||public static void SetColorOpacity(ref Color32 color, float opacity)|
@@ -1097,6 +1162,7 @@ Configurations of blur state.
|--|--|--|
|ChartText()||public ChartText()|
|ChartText()||public ChartText(GameObject textParent)|
|GetColor()||public Color GetColor()|
|GetPreferredHeight()||public float GetPreferredHeight()|
|GetPreferredText()||public string GetPreferredText(string content, string suffix, float maxWidth)|
|GetPreferredWidth()||public float GetPreferredWidth()|
@@ -1129,7 +1195,7 @@ Configurations of blur state.
## ChildComponent
> class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle)
> class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle)
|public method|since|description|
@@ -1185,8 +1251,8 @@ the comment mark style.
|public method|since|description|
|--|--|--|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler)|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler, bool allowMultiple)|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler, bool allowMultiple, int order = 3)|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler, int order = 3)|
## ComponentHelper
@@ -1227,10 +1293,15 @@ the comment mark style.
## CoordSystem
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord),[SingleAxisCoord](#singleaxiscoord)
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridCoord3D](#gridcoord3d),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord),[SingleAxisCoord](#singleaxiscoord)
Coordinate system component.
## DataHelper
> class in XCharts.Runtime
## DataZoom
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent),[IUpdateRuntimeData](#iupdateruntimedata)
@@ -1290,6 +1361,7 @@ DataZoom component is used for zooming a specific area, which enables user to in
|GetDateTime()||public static DateTime GetDateTime(int timestamp)|
|GetTimestamp()||public static int GetTimestamp()|
|GetTimestamp()||public static int GetTimestamp(DateTime time)|
|GetTimestamp()||public static int GetTimestamp(string dateTime)|
## DebugInfo
@@ -1369,6 +1441,61 @@ Configurations of emphasis state.
|TrimAndReplaceLine()||public static string TrimAndReplaceLine(string content)|
|TrimAndReplaceLine()||public static string TrimAndReplaceLine(StringBuilder sb)|
## GraphData
> class in XCharts.Runtime
the data struct of graph.
|public method|since|description|
|--|--|--|
|AddEdge()||public GraphEdge AddEdge(string nodeId1, string nodeId2, double value)|
|AddNode()||public GraphNode AddNode(string nodeId, string nodeName, int dataIndex, double value)|
|BreadthFirstTraverse()||public void BreadthFirstTraverse(GraphNode startNode, System.Action&lt;GraphNode&gt; onTraverse)|
|Clear()||public void Clear()|
|DeepFirstTraverse()||public void DeepFirstTraverse(GraphNode startNode, System.Action&lt;GraphNode&gt; onTraverse)|
|EachNode()||public void EachNode(System.Action&lt;GraphNode&gt; onEach)|
|ExpandAllNodes()||public void ExpandAllNodes(bool flag, int level = -1)|
|ExpandNode()||public void ExpandNode(string nodeId, bool flag)|
|GetDepthNodes()||public List&lt;List&lt;GraphNode&gt;&gt; GetDepthNodes()|
|GetEdge()||public GraphEdge GetEdge(string nodeId1, string nodeId2)|
|GetExpandedNodesCount()||public static int GetExpandedNodesCount(List&lt;GraphNode&gt; nodes)|
|GetMaxDepth()||public int GetMaxDepth()|
|GetNode()||public GraphNode GetNode(string nodeId)|
|GetNodeDepth()||// public int GetNodeDepth(GraphNode node)|
|GetNodeDepth()||// public void GetNodeDepth(GraphNode node, ref int depth, int recursiveCount = 0)|
|GetNodeDepth()||public int GetNodeDepth(GraphNode node, int recursiveCount = 0)|
|GetNodesTotalValue()||public static double GetNodesTotalValue(List&lt;GraphNode&gt; nodes)|
|GetRootNodes()||public List&lt;GraphNode&gt; GetRootNodes()|
|GraphData()||public GraphData(bool directed)|
|IsAllNodeInZeroPosition()||public bool IsAllNodeInZeroPosition()|
|Refresh()||public void Refresh()|
## GraphEdge
> class in XCharts.Runtime
The edge of graph.
|public method|since|description|
|--|--|--|
|GraphEdge()||public GraphEdge(GraphNode node1, GraphNode node2, double value)|
|IsPointInEdge()||public bool IsPointInEdge(Vector2 point)|
## GraphNode
> class in XCharts.Runtime
The node of graph.
|public method|since|description|
|--|--|--|
|Expand()||public void Expand(bool flag)|
|GraphNode()||public GraphNode(string id, string name, int dataIndex)|
|IsAllInEdgesCollapsed()||public bool IsAllInEdgesCollapsed()|
|IsAnyInEdgesExpanded()||public bool IsAnyInEdgesExpanded()|
|ToString()||public override string ToString()|
## GridCoord
> class in XCharts.Runtime / Inherits from: [CoordSystem](#coordsystem),[IUpdateRuntimeData](#iupdateruntimedata),[ISerieContainer](#iseriecontainer)
@@ -1388,8 +1515,31 @@ Grid component.
|ContainsX()|v3.7.0|public bool ContainsX(float x)<br/>Whether the given x is in the grid. |
|ContainsY()|v3.7.0|public bool ContainsY(float y)<br/>Whether the given y is in the grid. |
|IsPointerEnter()||public bool IsPointerEnter()<br/>Whether the pointer is in the grid. |
|NotAnyIntersect()|v3.10.0|public bool NotAnyIntersect(Vector3 sp, Vector3 ep)<br/>Determines whether a given line segment will not intersect the Grid boundary at all. |
|UpdateRuntimeData()||public void UpdateRuntimeData(BaseChart chart)|
## GridCoord3D
> class in XCharts.Runtime / Inherits from: [CoordSystem](#coordsystem),[IUpdateRuntimeData](#iupdateruntimedata),[ISerieContainer](#iseriecontainer)
> Since `v3.11.0`
Grid component.
|public method|since|description|
|--|--|--|
|Clamp()||public void Clamp(ref Vector3 pos)<br/>Clamp the position of pos to the grid. |
|Contains()||public bool Contains(Vector3 pos)<br/>Whether the given position is in the grid. |
|IsLeft()||public bool IsLeft()<br/>The opening of the coordinate system faces to the left. 坐标系开口朝向左边。 |
|IsPointerEnter()||public bool IsPointerEnter()<br/>Whether the pointer is in the grid. |
|NotAnyIntersect()||public bool NotAnyIntersect(Vector3 sp, Vector3 ep)<br/>Determines whether a given line segment will not intersect the Grid boundary at all. |
|UpdateRuntimeData()||public void UpdateRuntimeData(BaseChart chart)|
## GridCoord3DContext
> class in XCharts.Runtime / Inherits from: [MainComponentContext](#maincomponentcontext)
## GridCoordContext
> class in XCharts.Runtime / Inherits from: [MainComponentContext](#maincomponentcontext)
@@ -1425,6 +1575,11 @@ Grid layout component. Used to manage the layout of multiple `GridCoord`, and th
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Heat map mainly use colors to represent values, which must be used along with visualMap component. It can be used in either rectangular coordinate or geographic coordinate. But the behaviour on them are quite different. Rectangular coordinate must have two categories to use it.
|public method|since|description|
|--|--|--|
|DefaultCountHeatmapChart()||public void DefaultCountHeatmapChart()<br/>default count heatmap chart. |
## IconStyle
@@ -1535,7 +1690,7 @@ The interface for serie component.
## ISerieContainer
> class in XCharts.Runtime / Subclasses: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord)
> class in XCharts.Runtime / Subclasses: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridCoord3D](#gridcoord3d),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord)
## ISerieDataComponent
@@ -1567,14 +1722,25 @@ The interface for serie data component.
|GetToColor()||public Color32 GetToColor()|
|IsNeedCorner()||public bool IsNeedCorner()|
|IsNeedGradient()||public bool IsNeedGradient()|
|NeedShowBorder()||public bool NeedShowBorder()<br/>是否需要显示边框。 |
|Reset()||public void Reset()|
## IUpdateRuntimeData
> class in XCharts.Runtime / Subclasses: [SingleAxis](#singleaxis),[DataZoom](#datazoom),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridLayout](#gridlayout),[ParallelCoord](#parallelcoord)
> class in XCharts.Runtime / Subclasses: [SingleAxis](#singleaxis),[DataZoom](#datazoom),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridLayout](#gridlayout),[GridCoord3D](#gridcoord3d),[ParallelCoord](#parallelcoord)
## JsonUtil
> class in XCharts.Runtime
|public method|since|description|
|--|--|--|
|GetJsonArray&lt;T&gt;()||public static T[] GetJsonArray&lt;T&gt;(string json)|
|GetJsonObject&lt;T&gt;()||public static T GetJsonObject&lt;T&gt;(string json)|
|GetWebJson&lt;T&gt;()||public static IEnumerator GetWebJson&lt;T&gt;(string url, Action&lt;T[]&gt; callback)|
|GetWebJson&lt;T&gt;()||public static IEnumerator GetWebJson&lt;T&gt;(string url, Action&lt;T&gt; callback)|
## LabelLine
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
@@ -1735,6 +1901,8 @@ Legend component.The legend component shows different sets of tags, colors, and
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.10.0`
## Line
@@ -1755,6 +1923,29 @@ Legend component.The legend component shows different sets of tags, colors, and
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Line chart relates all the data points symbol by broken lines, which is used to show the trend of data changing. It could be used in both rectangular coordinate andpolar coordinate.
|public method|since|description|
|--|--|--|
|DefaultAreaLineChart()||public void DefaultAreaLineChart()<br/>default area line chart. |
|DefaultDashLineChart()||public void DefaultDashLineChart()<br/>default dash line chart. |
|DefaultLogLineChart()||public void DefaultLogLineChart()<br/>default logarithmic line chart. |
|DefaultSmoothAreaLineChart()||public void DefaultSmoothAreaLineChart()<br/>default smooth area line chart. |
|DefaultSmoothLineChart()||public void DefaultSmoothLineChart()<br/>default smooth line chart. |
|DefaultStackAreaLineChart()||public void DefaultStackAreaLineChart()<br/>default stack area line chart. |
|DefaultStackLineChart()||public void DefaultStackLineChart()<br/>default stack line chart. |
|DefaultStepLineChart()||public void DefaultStepLineChart()<br/>default step line chart. |
|DefaultTimeLineChart()||public void DefaultTimeLineChart()<br/>default time line chart. |
## LineHelper
> class in XCharts.Runtime
|public method|since|description|
|--|--|--|
|GetDataAverageRate()||public static int GetDataAverageRate(Serie serie, float axisLength, int maxCount, bool isYAxis)|
|GetLineWidth()||public static float GetLineWidth(ref bool interacting, Serie serie, float defaultWidth)|
## LineStyle
@@ -1806,6 +1997,17 @@ The style of line.
|--|--|--|
|ListForSerie()||public ListForSerie(Type type) : base(type)|
## ListPool&lt;T&gt;
> class in XCharts.Runtime
|public method|since|description|
|--|--|--|
|ClearAll()||public static void ClearAll()|
|Get()||public static List&lt;T&gt; Get()|
|Release()||public static void Release(List&lt;T&gt; toRelease)|
## Location
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent),[IPropertyChanged](#ipropertychanged)
@@ -1835,6 +2037,7 @@ Location type. Quick to set the general location.
|CompareTo()||public int CompareTo(object obj)|
|OnRemove()||public virtual void OnRemove()|
|Reset()||public virtual void Reset() { }|
|ResetStatus()||public virtual void ResetStatus() { }|
|SetAllDirty()||public virtual void SetAllDirty()|
|SetComponentDirty()||public virtual void SetComponentDirty()|
|SetDefaultValue()||public virtual void SetDefaultValue() { }|
@@ -1842,7 +2045,7 @@ Location type. Quick to set the general location.
## MainComponentContext
> class in XCharts.Runtime / Subclasses: [AxisContext](#axiscontext),[DataZoomContext](#datazoomcontext),[LegendContext](#legendcontext),[RadarCoordContext](#radarcoordcontext),[VisualMapContext](#visualmapcontext),[GridCoordContext](#gridcoordcontext),[GridLayoutContext](#gridlayoutcontext),[ParallelCoordContext](#parallelcoordcontext),[PolarCoordContext](#polarcoordcontext)
> class in XCharts.Runtime / Subclasses: [AxisContext](#axiscontext),[DataZoomContext](#datazoomcontext),[LegendContext](#legendcontext),[RadarCoordContext](#radarcoordcontext),[VisualMapContext](#visualmapcontext),[GridCoordContext](#gridcoordcontext),[GridLayoutContext](#gridlayoutcontext),[GridCoord3DContext](#gridcoord3dcontext),[ParallelCoordContext](#parallelcoordcontext),[PolarCoordContext](#polarcoordcontext)
## MainComponentHandler
@@ -2018,6 +2221,7 @@ padding setting of item or text.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Parallel Coordinates is a common way of visualizing high-dimensional geometry and analyzing multivariate data.
## ParallelCoord
@@ -2051,6 +2255,15 @@ Grid component.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
The pie chart is mainly used for showing proportion of different categories. Each arc length represents the proportion of data quantity.
|public method|since|description|
|--|--|--|
|DefaultAreaRosePieChart()||public void DefaultAreaRosePieChart()<br/>default area rose pie chart. |
|DefaultDonutPieChart()||public void DefaultDonutPieChart()<br/>default donut pie chart. |
|DefaultLabelDonutPieChart()||public void DefaultLabelDonutPieChart()<br/>default label donut pie chart. |
|DefaultLabelPieChart()||public void DefaultLabelPieChart()<br/>default label pie chart. |
|DefaultRadiusRosePieChart()||public void DefaultRadiusRosePieChart()<br/>default rose pie chart. |
## PolarAxisTheme
@@ -2065,6 +2278,13 @@ Grid component.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Polar coordinates are usually used in a circular layout.
|public method|since|description|
|--|--|--|
|DefaultHeatmapPolarChart()||public void DefaultHeatmapPolarChart()<br/>default heatmap polar chart. |
|DefaultRadialBarPolarChart()||public void DefaultRadialBarPolarChart()<br/>default radial bar polar chart. |
|DefaultTangentialBarPolarChart()||public void DefaultTangentialBarPolarChart()<br/>default tangential bar polar chart. |
## PolarCoord
@@ -2116,6 +2336,11 @@ Polar coordinate can be used in scatter and line chart. Every polar coordinate h
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Radar chart is mainly used to show multi-variable data, such as the analysis of a football player's varied attributes. It relies radar component.
|public method|since|description|
|--|--|--|
|DefaultCircleRadarChart()||public void DefaultCircleRadarChart()<br/>default circle radar chart. |
## RadarCoord
@@ -2186,6 +2411,11 @@ Radial axis of polar coordinate.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Ring chart is mainly used to show the proportion of each item and the relationship between the items.
|public method|since|description|
|--|--|--|
|DefaultMultipleRingChart()||public void DefaultMultipleRingChart()<br/>default multiple ring chart. |
## RuntimeUtil
@@ -2214,6 +2444,11 @@ Radial axis of polar coordinate.
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
Scatter chart is mainly used to show the relationship between two data dimensions.
|public method|since|description|
|--|--|--|
|DefaultBubbleChart()||public void DefaultBubbleChart()<br/>default bubble chart. |
## SelectStyle
@@ -2242,7 +2477,8 @@ Configurations of select state.
|AddData()||public SerieData AddData(List&lt;double&gt; valueList, string dataName = null, string dataId = null)<br/>将一组数据添加到系列中。 如果数据只有一个默认添加到维度Y中。 |
|AddData()||public SerieData AddData(params double[] values)<br/>添加任意维数据到系列中。 |
|AddExtraComponent&lt;T&gt;()||public T AddExtraComponent&lt;T&gt;() where T : ChildComponent, ISerieComponent|
|AddSerieData()||public void AddSerieData(SerieData serieData)|
|AddLink()||public virtual SerieDataLink AddLink(string sourceId, string targetId, double value = 0)<br/>Add a link data. |
|AddSerieData()||public virtual void AddSerieData(SerieData serieData)|
|AddXYData()||public SerieData AddXYData(double xValue, double yValue, string dataName = null, string dataId = null)<br/>添加xy数据到维度X和维度Y |
|AddYData()||public SerieData AddYData(double value, string dataName = null, string dataId = null)<br/>添加一个数据到维度Y此时维度X对应的数据是索引 |
|AnimationEnable()||public void AnimationEnable(bool flag)<br/>启用或取消初始动画 |
@@ -2258,6 +2494,7 @@ Configurations of select state.
|ClearData()||public override void ClearData()<br/>清空所有数据 |
|ClearDirty()||public override void ClearDirty()|
|ClearHighlight()||public void ClearHighlight()<br/>清除所有数据的高亮标志 |
|ClearLinks()||public void ClearLinks()<br/>清空所有Link数据 |
|ClearSerieNameDirty()||public void ClearSerieNameDirty()|
|ClearVerticesDirty()||public override void ClearVerticesDirty()|
|Clone()||public Serie Clone()|
@@ -2265,7 +2502,7 @@ Configurations of select state.
|CompareTo()||public int CompareTo(object obj)|
|EnsureComponent()||public ISerieComponent EnsureComponent(Type type)|
|EnsureComponent&lt;T&gt;()||public T EnsureComponent&lt;T&gt;() where T : ChildComponent, ISerieComponent<br/>Ensure the serie has the component. If not, add it. |
|GetBarWidth()||public float GetBarWidth(float categoryWidth, int barCount = 0)|
|GetBarWidth()||public float GetBarWidth(float categoryWidth, int barCount = 0, float defaultRate = 0.6f)|
|GetComponent()||public ISerieComponent GetComponent(Type type)|
|GetComponent&lt;T&gt;()||public T GetComponent&lt;T&gt;() where T : ChildComponent, ISerieComponent|
|GetData()||public double GetData(int index, int dimension, DataZoom dataZoom = null)<br/>获得指定index指定维数的数据 |
@@ -2284,6 +2521,9 @@ Configurations of select state.
|IsIgnoreValue()||public bool IsIgnoreValue(SerieData serieData, double value)|
|IsIgnoreValue()||public bool IsIgnoreValue(SerieData serieData, int dimension = 1)|
|IsLegendName()||public bool IsLegendName(string legendName)|
|IsMinShowLabelValue()||public bool IsMinShowLabelValue(double value)|
|IsMinShowLabelValue()||public bool IsMinShowLabelValue(int index, int dimension = 1)|
|IsMinShowLabelValue()||public bool IsMinShowLabelValue(SerieData serieData, int dimension = 1)|
|IsPerformanceMode()||public bool IsPerformanceMode()<br/>是否为性能模式。性能模式下不绘制Symbol不刷新Label不单独设置数据项配置。 |
|IsSerie&lt;T&gt;()||public bool IsSerie&lt;T&gt;() where T : Serie|
|IsSerieDataLegendName()||public bool IsSerieDataLegendName(string legendName)|
@@ -2435,6 +2675,14 @@ The attribute for serie data component.
|SerieDataExtraFieldAttribute()||public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)|
|SerieDataExtraFieldAttribute()||public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)|
## SerieDataLink
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.10.0`
the link of serie data. Used for sankey chart. Sankey chart only supports directed acyclic graph. make sure the data link is directed acyclic graph.
## SerieEventData
> class in XCharts.Runtime
@@ -2472,6 +2720,7 @@ the data of serie event.
|ForceUpdateSerieContext()||public virtual void ForceUpdateSerieContext() { }|
|InitComponent()||public virtual void InitComponent() { }|
|OnBeginDrag()||public virtual void OnBeginDrag(PointerEventData eventData) { }|
|OnDataUpdate()||public virtual void OnDataUpdate() { }|
|OnDrag()||public virtual void OnDrag(PointerEventData eventData) { }|
|OnEndDrag()||public virtual void OnEndDrag(PointerEventData eventData) { }|
|OnLegendButtonClick()||public virtual void OnLegendButtonClick(int index, string legendName, bool show) { }|
@@ -2674,6 +2923,7 @@ Global parameter setting component. The default value can be used in general, an
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
A simplified bar chart is a simplified mode of a bar chart that provides better performance by simplifying components and configurations.
## SimplifiedCandlestick
@@ -2689,6 +2939,7 @@ Global parameter setting component. The default value can be used in general, an
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
A simplified candlestick chart is a simplified mode of a bar chart that provides better performance by simplifying components and configurations.
## SimplifiedLine
@@ -2704,6 +2955,7 @@ Global parameter setting component. The default value can be used in general, an
> class in XCharts.Runtime / Inherits from: [BaseChart](#basechart)
A simplified line chart is a simplified mode of a bar chart that provides better performance by simplifying components and configurations.
## Since
@@ -2773,11 +3025,6 @@ the state style of serie.
|DrawPath()||public static void DrawPath(VertexHelper vh, SVGPath path)|
|Test()||public static void Test(VertexHelper vh)|
## SVGImage
> class in XCharts.Runtime / Inherits from: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
## SVGPath
> class in XUGL
@@ -2925,6 +3172,7 @@ Tooltip component.
|public method|since|description|
|--|--|--|
|onClickIndex||public System.Action&lt;int&gt; onClickIndex<br/>the callback of tooltip click index. |
|AddSerieDataIndex()||public void AddSerieDataIndex(int serieIndex, int dataIndex)|
|ClearComponentDirty()||public override void ClearComponentDirty()|
|ClearData()||public override void ClearData()|
@@ -3050,6 +3298,7 @@ UGUI Graphics Library.
|IsClearColor()||public static bool IsClearColor(Color32 color)|
|IsPointInPolygon()||public static bool IsPointInPolygon(Vector3 p, List&lt;Vector2&gt; polyons)|
|IsPointInPolygon()||public static bool IsPointInPolygon(Vector3 p, List&lt;Vector3&gt; polyons)|
|IsPointInPolygon()||public static bool IsPointInPolygon(Vector3 p, params Vector3[] polyons)|
|IsPointInTriangle()||public static bool IsPointInTriangle(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 check)|
|IsValueEqualsColor()||public static bool IsValueEqualsColor(Color color1, Color color2)|
|IsValueEqualsColor()||public static bool IsValueEqualsColor(Color32 color1, Color32 color2)|
@@ -3079,15 +3328,23 @@ UI组件基类。
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
|public method|since|description|
|--|--|--|
|GetBackgroundColor()||public Color32 GetBackgroundColor(Background background)|
## UIHelper
> class in XCharts.Runtime
UI帮助类。
|public method|since|description|
|--|--|--|
|GetBackgroundColor()||public static Color32 GetBackgroundColor(UIComponent component)|
## ViewControl
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.11.0`
View control component in 3D coordinate system.
## VisualMap
@@ -3102,6 +3359,7 @@ VisualMap component. Mapping data to visual elements such as colors.
|ClearComponentDirty()||public override void ClearComponentDirty()|
|ClearVerticesDirty()||public override void ClearVerticesDirty()|
|GetColor()||public Color32 GetColor(double value)|
|GetColor()||public Color32 GetColor(double xValue, double yValue, double zValue, byte alpha = 255)|
|GetIndex()||public int GetIndex(double value)|
|GetValue()||public double GetValue(Vector3 pos, Rect chartRect)|
|IsInRangeMaxRect()||public bool IsInRangeMaxRect(Vector3 local, Rect chartRect, float triangleLen)|
@@ -3149,6 +3407,11 @@ VisualMap component. Mapping data to visual elements such as colors.
|Copy()||public void Copy(VisualMapTheme theme)|
|VisualMapTheme()||public VisualMapTheme(ThemeType theme) : base(theme)|
## Wrapper&lt;T&gt;
> class in XCharts.Runtime
## XAxis
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
@@ -3159,6 +3422,18 @@ The x axis in cartesian(rectangular) coordinate.
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>The x axis in cartesian(rectangular) coordinate. |
## XAxis3D
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
> Since `v3.11.0`
The x axis in cartesian(rectangular) coordinate.
|public method|since|description|
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>The x axis in cartesian(rectangular) coordinate. |
## XChartsMgr
> class in XCharts.Runtime
@@ -3264,3 +3539,27 @@ The x axis in cartesian(rectangular) coordinate.
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>The x axis in cartesian(rectangular) coordinate. |
## YAxis3D
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
> Since `v3.11.0`
The x axis in cartesian(rectangular) coordinate.
|public method|since|description|
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>The x axis in cartesian(rectangular) coordinate. |
## ZAxis3D
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
> Since `v3.11.0`
The x axis in cartesian(rectangular) coordinate.
|public method|since|description|
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>The x axis in cartesian(rectangular) coordinate. |

View File

@@ -2,6 +2,10 @@
# 更新日志
[master](#master)
[v3.11.0](#v3110)
[v3.10.2](#v3102)
[v3.10.1](#v3101)
[v3.10.0](#v3100)
[v3.9.0](#v390)
[v3.8.1](#v381)
[v3.8.0](#v380)
@@ -65,6 +69,94 @@
## master
## v3.11.0
Release Highlights:
* Added `Line3DChart` for 3D line charts
* Added `GraphChart` for relationship graphs
* Added support for 3D coordinate systems
* Added `triggerOn` setting for `Tooltip` to define trigger conditions
* Various bug fixes and optimizations
Changelog Details:
* (2024.06.16) Released version `v3.11.0`
* (2024.06.15) Added buttons for adding, deleting, and moving data up and down under `Editor`
* (2024.06.11) Fixed issue where `Axis`'s `IndicatorLabel` might overlap with `Tooltip`
* (2024.06.11) Fixed issue where `Tooltip`'s `Axis` `IndicatorLabel` might not display when in `Cross` mode (#315)
* (2024.06.10) Renamed `Tooltip`'s `Corss` to `Cross`
* (2024.06.09) Added `minCategorySpacing` setting for `Axis` to define the default minimum category spacing
* (2024.06.09) Fixed inaccurate indicator position of `Tooltip`'s `Cross` when `Axis` is a category axis and `DataZoom` is enabled
* (2024.06.06) Fixed animation issue when `Serie` is cloned (#320)
* (2024.06.04) Fixed issue where `Serie`'s `state` does not refresh when set dynamically via code
* (2024.05.29) Adjusted the right-click menu of `XCharts` in the `Hierarchy` view to `UI/XCharts`
* (2024.05.29) Added support for 3D coordinate systems to category axes
* (2024.05.19) Optimized editing performance in `Editor`
* (2024.05.09) Added utility class `JsonUtil`
* (2024.05.01) Fixed the issue where `Tooltip` caused garbage collection (GC) on every frame (#311) (by @stefanbursuc)
* (2024.04.23) Fixed chart exception issue after multiple calls to `ConvertXYAxis()`
* (2024.04.22) Fixed potential incorrect retrieval of `GridCoord` when `DataZoom` controls multiple axes (#317)
* (2024.04.22) Added 3D coordinate system
* (2024.04.15) Optimized `DateTimeUtil` for timezone issues when converting timestamps to `DateTime`
* (2024.04.15) Optimized `GridCoord` to display `Left` `Right` `Top` `Bottom` parameters even when `GridLayout` is enabled (#316)
* (2024.04.14) Fixed incorrect label position of `Tooltip`'s `Cross` when `DataZoom` is enabled (#315)
* (2024.04.12) Fixed incorrect effect of `Candlesticks` (#313)
* (2024.03.20) Added `triggerOn` setting for `Tooltip` to define trigger conditions
* (2024.03.19) Fixed color issue when setting `opacity` in `Pie`'s `ItemStyle` (#309)
## v3.10.2
* (2024.03.11) Release `v3.10.2`
* (2024.03.11) Fix to `Legend`'s `formatter` showing possible mismatches when setting {d} (#304)
* (2024.03.11) Fix to `Tooltip` still showing after moving out of coordinate system
* (2024.03.08) Fixed an issue where `Tooltip`'s title might not appear after upgrading from an older version
## v3.10.1
* (2024.02.21) Release `v3.10.1`
* (2024.02.19) Fix to `Tooltip` dot markers not adapting to color
## v3.10.0
Highlights:
* Added bi-category axis support
* Added more segmentation shortcut menu to create charts, which can create dozens of charts with one click
* Added chart border Settings to support rounded corner charts
* Fixed several issues
Extended features:
* Added `SankeyChart` Sankey chart
* Added `border` Settings for `UITable`
Log details:
* (2024.02.01) Release `v3.10.0`
* (2024.01.31) Fix to Tooltip not displaying after itemFormatter is set to -
* (2024.01.27) Fix to TextLimit not working after TextMeshPro is enabled (#301)
* (2024.01.24) Added `Bar` to support both X and Y axes as` Category `axes
* (2024.01.23) Added `{y}` wildcard to get the class name of the Y-axis
* (2024.01.23) Added `Line` to support both X and Y axes as` Category `axes
* (2024.01.18) Fixed dynamic modification of `Animation`s `type` code
* (2024.01.13) Added more quick Chart creation menus for Chart
* (2024.01.09) added `borderStyle` to `Background` to give the chart rounded corners by default
* (2024.01.07) Fix to invalid first ContentLabelStyle setting color for Tooltop
* (2024.01.01) Added `BorderStyle` border style
* (2023.12.26) Added support for Heatmap's maxCache parameter
* (2023.12.25) Optimizes the number of vertices drawn when `Line`` opens clip
* (2023.12.22) Fixed an issue where some border data of `Scatter` map was not displayed
* (2023.12.21) Fix to `TriggerTooltip()` interface may not fire when 0 or maximum index is specified
* (2023.12.19) Fixed an issue where `Legend`'s `LabelStyle` does not take effect after setting its formatter
* (2023.12.12) Added TextLimit for Legend to limit the length of the text displayed in the legend
* (2023.12.11) Fix to coordinate drawing failure when `Serie` was added with `double-maxvalue`
* (2023.12.10) Add `Serie` to `minShowLabel` to hide `labels` that are less than the specified value
* (2023.12.09) Add depth to `LevelStyle` to specify the level to which it belongs
* (2023.12.09) Added `LevelStyle` `LineStyle` to set line styles
* (2023.12.09) Adding `Serie` to `Link` can be used to add node-edge relationships to Sankey diagrams
* (2023.12.05) added `ResetChartStatus()` to actively reset chart status
## v3.9.0
Highlights:
@@ -83,6 +175,7 @@ Extended features:
Log details:
* (2023.12.01) Release `v3.9.0`
* (2023.12.01) Fixed inaccurate display of Tooltip's `titleFormatter` set to `{b}`
* (2023.11.30) Added support for `SerieData` to add `Label` separately
* (2023.11.28) Fix to `Tooltip` incorrectly indicating the number line
@@ -144,7 +237,7 @@ Log details:
* (2023.08.22) Fixed `Bar` display hidden drawing performance exception
* (2023.08.22) Improved Zebra histogram rendering performance (#276)
* (2023.08.16) Added Daemon daemon to resolve an error after TMP is enabled locally
* (2023.08.15) Fixed `Data` displaying axes incorrectly when data is between -1 and 1 (#273) (by **Ambitroc**)
* (2023.08.15) Fixed `Data` displaying axes incorrectly when data is between -1 and 1 (#273) (b y@Ambitroc)
* (2023.08.14) Fixed `XCharts` updating error after` TextMeshPro `and` NewInputSystem `are enabled locally (#272)
* (2023.08.12) Fixed `Chart` error when deleted at runtime (#269)
* (2023.08.11) Fixed an issue where data could not be added when DataZoom was enabled
@@ -185,7 +278,7 @@ Log details:
* (2022.06.08) Release v3.7.0
* (2023.06.04) Added `HelpDoc` help document skip
* (2023.05.30) Fixed Serie name with `_` line causing `Legend` to not fire (#252) (by **svr2kos2**)
* (2023.05.30) Fixed Serie name with `_` line causing `Legend` to not fire (#252) (by @svr2kos2)
* (2023.05.10) Added `MinMaxAuto` range type for `Axis`
* (2023.05.10) Added support for `Clip` for `Line`
* (2023.05.04) Fixed `Axis` setting` CeilRate `not taking effect in range -1 to 1
@@ -204,9 +297,9 @@ Log details:
* (2023.04.01) Release `v3.6.0` version
* (2023.03.14) Fix for Tooltip's `titleFormater` setting `{b}` may not take effect
* (2023.03.14) Fix for `BarChart` not drawing bar background when data is 0 (#250) (by **Ambitroc**)
* (2023.03.14) Fix for `BarChart` not drawing bar background when data is 0 (#250) (by @Ambitroc)
* (2023.03.12) Added `LabelStyle` `autoRotate` to set automatic rotation of angled vertical text
* (2023.03.10) Added `VR` and other non-mouse input for Point location acquisition (#248) (by **Ambitroc**)
* (2023.03.10) Added `VR` and other non-mouse input for Point location acquisition (#248) (by @Ambitroc)
* (2023.03.09) Adds callbacks to Chart's `onSerieClick`, `onSerieDown`, `onSerieEnter` and `onSerieExit`
* (2023.03.09) Fixed click-check offset for `Pie` not taking effect
* (2023.03.04) Added Positions for Legend to customize legend positions
@@ -220,7 +313,7 @@ Log details:
* (2023.02.02) Fixed bug where datazoom xaxis label could be displayed off-chart when datazoom is turned on
* (2023.02.02) Optimizes the `ignore` setting of `SerieData` to ignore data
* (2023.02.01) Fix `XChartsMgr.ContainsChart()` interface exception
* (2023.01.31) Added support for `InputSystem` (#242) (by **Bian-Sh**)
* (2023.01.31) Added support for `InputSystem` (#242) (by @Bian-Sh)
* (2023.01.11) Fixed chart not refreshing after removing Component from Inspector (#241)
* (2023.01.06) Fixed bug with `Pie` displaying abnormal Label when the last few values are 0 (#240)
* (2023.01.03) deletes serie `MarkColor` and adds ItemStyle `MarkColor`

View File

@@ -56,6 +56,7 @@ import APITable from '@site/src/components/APITable';
- [CoordSystem](#coordsystem)
- [DataZoom](#datazoom)
- [GridCoord](#gridcoord)
- [GridCoord3D](#gridcoord3d)
- [GridLayout](#gridlayout)
- [Legend](#legend)
- [MarkArea](#markarea)
@@ -72,7 +73,10 @@ import APITable from '@site/src/components/APITable';
- [Tooltip](#tooltip)
- [VisualMap](#visualmap)
- [XAxis](#xaxis)
- [XAxis3D](#xaxis3d)
- [YAxis](#yaxis)
- [YAxis3D](#yaxis3d)
- [ZAxis3D](#zaxis3d)
## ChildComponent
@@ -94,6 +98,7 @@ import APITable from '@site/src/components/APITable';
- [BaseAxisTheme](#baseaxistheme)
- [BaseLine](#baseline)
- [BlurStyle](#blurstyle)
- [BorderStyle](#borderstyle)
- [CommentItem](#commentitem)
- [CommentMarkStyle](#commentmarkstyle)
- [ComponentTheme](#componenttheme)
@@ -121,6 +126,7 @@ import APITable from '@site/src/components/APITable';
- [RadiusAxisTheme](#radiusaxistheme)
- [SelectStyle](#selectstyle)
- [SerieData](#seriedata)
- [SerieDataLink](#seriedatalink)
- [SerieSymbol](#seriesymbol)
- [SerieTheme](#serietheme)
- [StageColor](#stagecolor)
@@ -135,6 +141,7 @@ import APITable from '@site/src/components/APITable';
- [TitleTheme](#titletheme)
- [TooltipTheme](#tooltiptheme)
- [UIComponentTheme](#uicomponenttheme)
- [ViewControl](#viewcontrol)
- [VisualMapRange](#visualmaprange)
- [VisualMapTheme](#visualmaptheme)
@@ -192,6 +199,7 @@ import APITable from '@site/src/components/APITable';
- [LangCandlestick](#langcandlestick)
- [LangTime](#langtime)
- [MainComponent](#maincomponent)
- [Wrapper&lt;T&gt;](#wrappert)
- [XCResourcesImporter](#xcresourcesimporter)
- [XCSettings](#xcsettings)
@@ -383,7 +391,7 @@ The style of area.
## Axis
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [AngleAxis](#angleaxis), [ParallelAxis](#parallelaxis), [RadiusAxis](#radiusaxis), [SingleAxis](#singleaxis), [XAxis](#xaxis), [YAxis](#yaxis)
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [AngleAxis](#angleaxis), [ParallelAxis](#parallelaxis), [RadiusAxis](#radiusaxis), [SingleAxis](#singleaxis), [XAxis](#xaxis), [XAxis3D](#xaxis3d), [YAxis](#yaxis), [YAxis3D](#yaxis3d), [ZAxis3D](#zaxis3d)
The axis in rectangular coordinate.
@@ -400,7 +408,7 @@ The axis in rectangular coordinate.
|gridIndex|||The index of the grid on which the axis are located, by default, is in the first grid.
|polarIndex|||The index of the polar on which the axis are located, by default, is in the first polar.
|parallelIndex|||The index of the parallel on which the axis are located, by default, is in the first parallel.
|position|||the position of axis in grid.<br/>`Axis.AxisPosition`:<br/>- `Left`: the position of axis in grid.<br/>- `Right`: the position of axis in grid.<br/>- `Bottom`: the position of axis in grid.<br/>- `Top`: the position of axis in grid.<br/>|
|position|||the position of axis in grid.<br/>`Axis.AxisPosition`:<br/>- `Left`: the position of axis in grid.<br/>- `Right`: the position of axis in grid.<br/>- `Bottom`: the position of axis in grid.<br/>- `Top`: the position of axis in grid.<br/>- `Center`: the position of axis in grid.<br/>|
|offset|||the offset of axis from the default position. Useful when the same position has multiple axes.
|min|||The minimun value of axis.Valid when `minMaxType` is `Custom`
|max|||The maximum value of axis.Valid when `minMaxType` is `Custom`
@@ -414,6 +422,7 @@ The axis in rectangular coordinate.
|inverse|false||Whether the axis are reversed or not. Invalid in `Category` axis.
|clockwise|true||Whether the positive position of axis is in clockwise. True for clockwise by default.
|insertDataToHead|||Whether to add new data at the head or at the end of the list.
|minCategorySpacing|0|v3.11.0|The minimum spacing between categories.
|icons|||类目数据对应的图标。
|data|||Category data, available in type: 'Category' axis.
|axisLine|||axis Line. [AxisLine](#axisline)|
@@ -604,6 +613,7 @@ Split line of axis in grid area.
|autoColor|||auto color.
|showStartLine|true|v3.3.0|Whether to show the first split line.
|showEndLine|true|v3.3.0|Whether to show the last split line.
|showZLine|true|v3.11.0|Whether to show the Z axis part of the split line. Generally used for 3D coordinate systems.
```mdx-code-block
</APITable>
@@ -655,7 +665,10 @@ Background component.
|image|||the image of background.
|imageType|||the fill type of background image.
|imageColor|||背景图颜色。
|imageWidth|0|v3.10.0|the width of background image.
|imageHeight|0|v3.10.0|the height of background image.
|autoColor|true||Whether to use theme background color for component color when the background component is on.
|borderStyle||v3.10.0|the border style of background. [BorderStyle](#borderstyle)|
```mdx-code-block
</APITable>
@@ -730,6 +743,31 @@ Settings related to base line.
Configurations of blur state.
## BorderStyle
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.10.0`
The style of border.
```mdx-code-block
<APITable name="BorderStyle">
```
|field|default|since|comment|
|--|--|--|--|
|show|false||whether the border is visible.
|borderWidth|||the width of border.
|borderColor|||the color of border.
|roundedCorner|true||whether the border is rounded corner.
|cornerRadius|||The radius of rounded corner. Its unit is px. Use array to respectively specify the 4 corner radiuses((clockwise upper left, upper right, bottom right and bottom left)). When is set to (1,1,1,1), all corners are rounded.
```mdx-code-block
</APITable>
```
## CalendarCoord
> class in XCharts.Runtime / Inherits from: [CoordSystem](#coordsystem), [IUpdateRuntimeData](#iupdateruntimedata), [ISerieContainer](#iseriecontainer)
@@ -744,7 +782,7 @@ Configurations of blur state.
## ChildComponent
> class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle)
> class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle)
## Comment
@@ -835,7 +873,7 @@ the comment mark style.
## CoordSystem
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord), [SingleAxisCoord](#singleaxiscoord)
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) / Subclasses: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridCoord3D](#gridcoord3d), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord), [SingleAxisCoord](#singleaxiscoord)
Coordinate system component.
@@ -979,10 +1017,10 @@ Grid component.
|--|--|--|--|
|show|true||Whether to show the grid in rectangular coordinate.
|layoutIndex|-1|v3.8.0|The index of the grid layout component to which the grid belongs. The default is -1, which means that it does not belong to any grid layout component. When this value is set, the left, right, top, and bottom properties will be invalid.
|left|0.1f||Distance between grid component and the left side of the container.
|left|0.11f||Distance between grid component and the left side of the container.
|right|0.08f||Distance between grid component and the right side of the container.
|top|0.22f||Distance between grid component and the top side of the container.
|bottom|0.12f||Distance between grid component and the bottom side of the container.
|bottom|0.14f||Distance between grid component and the bottom side of the container.
|backgroundColor|||Background color of grid, which is transparent by default.
|showBorder|false||Whether to show the grid border.
|borderWidth|0f||Border width of grid.
@@ -992,6 +1030,37 @@ Grid component.
</APITable>
```
## GridCoord3D
> class in XCharts.Runtime / Inherits from: [CoordSystem](#coordsystem), [IUpdateRuntimeData](#iupdateruntimedata), [ISerieContainer](#iseriecontainer)
> Since `v3.11.0`
Grid component.
```mdx-code-block
<APITable name="GridCoord3D">
```
|field|default|since|comment|
|--|--|--|--|
|show|true||Whether to show the grid in rectangular coordinate.
|left|0.15f||Distance between grid component and the left side of the container.
|right|0.2f||Distance between grid component and the right side of the container.
|top|0.3f||Distance between grid component and the top side of the container.
|bottom|0.15f||Distance between grid component and the bottom side of the container.
|showBorder|false||Whether to show the grid border.
|boxWidth|0.55f||The width of the box in the coordinate system.
|boxHeight|0.4f||The height of the box in the coordinate system.
|boxDepth|0.2f||The depth of the box in the coordinate system.
|xYExchanged|false||
|viewControl|||View control component in 3D coordinate system. [ViewControl](#viewcontrol)|
```mdx-code-block
</APITable>
```
## GridLayout
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent), [IUpdateRuntimeData](#iupdateruntimedata)
@@ -1147,7 +1216,7 @@ The interface for serie component.
## ISerieContainer
> class in XCharts.Runtime / Subclasses: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord)
> class in XCharts.Runtime / Subclasses: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridCoord3D](#gridcoord3d), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord)
## ISerieDataComponent
@@ -1199,7 +1268,7 @@ The interface for serie data component.
## IUpdateRuntimeData
> class in XCharts.Runtime / Subclasses: [SingleAxis](#singleaxis), [DataZoom](#datazoom), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridLayout](#gridlayout), [ParallelCoord](#parallelcoord)
> class in XCharts.Runtime / Subclasses: [SingleAxis](#singleaxis), [DataZoom](#datazoom), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridLayout](#gridlayout), [GridCoord3D](#gridcoord3d), [ParallelCoord](#parallelcoord)
## LabelLine
@@ -1250,7 +1319,7 @@ Text label of chart, to explain some data information about graphic item like va
|rotate|||Rotation of label.
|autoRotate|false|v3.6.0|auto rotate of label.
|distance|||the distance of label to axis line.
|formatter|||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 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 /> `{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 />
|formatter|||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 />
|numericFormatter|||Standard number and date format string. Used to format a Double value or a DateTime date as a string. numericFormatter is used as an argument to either `Double.ToString ()` or `DateTime.ToString()`. <br /> The number format uses the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N digit, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. E.g. F1, E2<br /> Date format Common date formats are: yyyy year, MM month, dd day, HH hour, mm minute, ss second, fff millisecond. For example: yyyy-MM-dd HH:mm:ss<br /> number format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings<br/> date format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings<br/>
|width|0||the width of label. If set as default value 0, it means than the label width auto set as the text width.
|height|0||the height of label. If set as default value 0, it means than the label height auto set as the text height.
@@ -1302,6 +1371,7 @@ Legend component.The legend component shows different sets of tags, colors, and
|itemOpacity|1||the opacity of item color.
|formatter|||No longer used, the use of LabelStyle.formatter instead.
|labelStyle|||the style of text. [LabelStyle](#labelstyle)|
|textLimit||v3.10.0|the limit of text. [TextLimit](#textlimit)|
|data|||Data array of legend. An array item is usually a name representing string. (If it is a pie chart, it could also be the name of a single data in the pie chart) of a series. If data is not specified, it will be auto collected from series.
|icons|||自定义的图例标记图形。
|colors|||the colors of legend item.
@@ -1341,9 +1411,11 @@ Legend component.The legend component shows different sets of tags, colors, and
|field|default|since|comment|
|--|--|--|--|
|label|||文本标签样式。 [LabelStyle](#labelstyle)|
|upperLabel|||上方的文本标签样式。 [LabelStyle](#labelstyle)|
|itemStyle|||数据项样式。 [ItemStyle](#itemstyle)|
|depth|0|v3.10.0|the depth of level.
|label|||the label style of level. [LabelStyle](#labelstyle)|
|upperLabel|||the upper label style of level. [LabelStyle](#labelstyle)|
|lineStyle||v3.10.0|the line style of level. [LineStyle](#linestyle)|
|itemStyle|||the item style of level. [ItemStyle](#itemstyle)|
```mdx-code-block
</APITable>
@@ -1353,6 +1425,8 @@ Legend component.The legend component shows different sets of tags, colors, and
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.10.0`
```mdx-code-block
<APITable name="LevelStyle">
```
@@ -1811,6 +1885,8 @@ Configurations of select state.
|center|||the center of chart.
|radius|||the radius of chart.
|minRadius|0f|v3.8.0|the min radius of chart. It can be used to limit the minimum radius of the rose chart.
|minShowLabel|false|v3.10.0|Whether the label is not displayed when the enabled value is less than the specified value.
|minShowLabelValue|0|v3.10.0|When 'minShowLabel' is enabled, labels are not displayed if the value is less than this value.
|showDataDimension|||数据项里的数据维数。
|showDataName|||在Editor的inpsector上是否显示name参数
|clip|false||If clip the overflow on the coordinate system.
@@ -1836,6 +1912,7 @@ Configurations of select state.
|animation|||The start animation. [AnimationStyle](#animationstyle)|
|itemStyle|||The style of data item. [ItemStyle](#itemstyle)|
|data|||系列中的数据内容数组。SerieData可以设置1到n维数据。
|links|||数据节点的边。
```mdx-code-block
</APITable>
@@ -1868,6 +1945,29 @@ A data item of serie.
</APITable>
```
## SerieDataLink
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.10.0`
the link of serie data. Used for sankey chart. Sankey chart only supports directed acyclic graph. make sure the data link is directed acyclic graph.
```mdx-code-block
<APITable name="SerieDataLink">
```
|field|default|since|comment|
|--|--|--|--|
|source|||the source node name.
|target|||the target node name.
|value|||the value of link. decide the width of link.
```mdx-code-block
</APITable>
```
## SerieSymbol
> class in XCharts.Runtime / Inherits from: [SymbolStyle](#symbolstyle), [ISerieDataComponent](#iseriedatacomponent)
@@ -2239,11 +2339,12 @@ Tooltip component.
|field|default|since|comment|
|--|--|--|--|
|show|true||Whether to show the tooltip component.
|type|||Indicator type.<br/>`Tooltip.Type`:<br/>- `Line`: line indicator.<br/>- `Shadow`: shadow crosshair indicator.<br/>- `None`: no indicator displayed.<br/>- `Corss`: crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.<br/>- `Auto`: Auto select indicator according to serie type.<br/>|
|type|||Indicator type.<br/>`Tooltip.Type`:<br/>- `Line`: line indicator.<br/>- `Shadow`: shadow crosshair indicator.<br/>- `None`: no indicator displayed.<br/>- `Cross`: crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.<br/>- `Auto`: Auto select indicator according to serie type.<br/>|
|trigger|||Type of triggering.<br/>`Tooltip.Trigger`:<br/>- `Item`: Triggered by data item, which is mainly used for charts that don't have a category axis like scatter charts or pie charts.<br/>- `Axis`: Triggered by axes, which is mainly used for charts that have category axes, like bar charts or line charts.<br/>- `None`: Trigger nothing.<br/>- `Auto`: Auto select trigger according to serie type.<br/>|
|triggerOn||v3.11.0|Condition of trigger tooltip.<br/>`Tooltip.TriggerOn`:<br/>- `MouseMove`: Trigger when mouse move.<br/>- `Click`: Trigger when mouse click.<br/>|
|position||v3.3.0|Type of position.<br/>`Tooltip.Position`:<br/>- `Auto`: Auto. The mobile platform is displayed at the top, and the non-mobile platform follows the mouse position.<br/>- `Custom`: Custom. Fully customize display position (x,y).<br/>- `FixedX`: Just fix the coordinate X. Y follows the mouse position.<br/>- `FixedY`: <br/>|
|itemFormatter|||a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. Template variables are {.}, {a}, {b}, {c}, {d}.<br/> {.} is the dot of the corresponding color of a Serie that is currently indicated or whose index is 0.<br/> {a} is the series name of the serie that is currently indicated or whose index is 0.<br/> {b} is the name of the data item serieData that is currently indicated or whose index is 0, or a category value (such as the X-axis of a line chart).<br/> {c} is the value of a Y-dimension (dimesion is 1) from a Serie that is currently indicated or whose index is 0.<br/> {d} is the percentage value of Y-dimensions (dimesion is 1) from serie that is currently indicated or whose index is 0, with no % sign.<br/> {e} is the name of the data item serieData that is currently indicated or whose index is 0.<br/> {f} is sum of data.<br/> {.1} represents a dot from serie corresponding color that specifies index as 1.<br/> 1 in {a1}, {b1}, {c1} represents a serie that specifies an index of 1.<br/> {c1:2} represents the third data from serie's current indication data item indexed to 1 (a data item has multiple data, index 2 represents the third data).<br/> {c1:2-2} represents the third data item from serie's third data item indexed to 1 (i.e., which data item must be specified to specify).<br/> {d1:2: F2} indicates that a formatted string with a value specified separately is F2 (numericFormatter is used when numericFormatter is not specified).<br/> {d:0.##} indicates that a formatted string with a value specified separately is 0.## (used for percentage, reserved 2 valid digits while avoiding the situation similar to "100.00%" when using f2 ).<br/> Example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1} : {c1:1-1: f1}"<br/>
|titleFormatter|||String template formatter for tooltip title content. \n line wrapping is supported. The placeholder {i} can be set separately to indicate that title is ignored and not displayed. Template variables are {.}, {a}, {b}, {c}, {d}, {e}, {f}, and {g}. <br /> {.} is the dot of the corresponding color of serie currently indicated or index 0. <br /> {a} is the series name name of serie currently indicated or index 0. <br /> {b} is the name of the serie data item serieData currently indicated or index 0, or the category value (such as the X-axis of a line chart). <br /> {c} is the value of the serie y-dimension (dimesion is 1) currently indicated or index is 0. <br /> {d} is the serie y-dimensional (dimesion 1) percentage value of the currently indicated or index 0, note without the % sign. <br /> {e} is the name of the serie data item serieData currently indicated or whose index is 0. <br /> {h} is the hexadecimal color value of serieData for the serie data item currently indicated or index 0. <br /> {f} is the sum of data. <br /> {g} indicates the total number of data. <br /> {.1} represents a dot of the corresponding color with serie specified as index 1. <br /> The 1 in {a1}, {b1}, {c1} represents serie where index is specified as 1. <br /> {c1:2} represents the third data of the current indicator data item in serie with index 1 (one data item has multiple data, index 2 represents the third data). <br /> {c1:2-2} represents the third data of serie third data item with index 1 (that is, the number of data items must be specified when specifying the number of data items). <br /> {d1:2:f2} indicates that a format string with a single value is f2 (numericFormatter is used if no value is specified). <br /> {d:0.##} indicates that the format string with a value specified alone is 0.## # (for percentages, preserving a 2-digit significant number while avoiding the "100.00%" situation with f2). <br /> example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1}, {c1:1-1: f1}"
|itemFormatter|||a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. Template variables are {.}, {a}, {b}, {c}, {d}.<br/> {.} is the dot of the corresponding color of a Serie that is currently indicated or whose index is 0.<br/> {a} is the series name of the serie that is currently indicated or whose index is 0.<br/> {b} is the name of the data item serieData that is currently indicated or whose index is 0, or a category value (such as the X-axis of a line chart).<br/> {c} is the value of a Y-dimension (dimesion is 1) from a Serie that is currently indicated or whose index is 0.<br/> {d} is the percentage value of Y-dimensions (dimesion is 1) from serie that is currently indicated or whose index is 0, with no % sign.<br/> {e} is the name of the data item serieData that is currently indicated or whose index is 0.<br/> {f} is sum of data.<br/> {y} is category value of y axis.<br/> {.1} represents a dot from serie corresponding color that specifies index as 1.<br/> 1 in {a1}, {b1}, {c1} represents a serie that specifies an index of 1.<br/> {c1:2} represents the third data from serie's current indication data item indexed to 1 (a data item has multiple data, index 2 represents the third data).<br/> {c1:2-2} represents the third data item from serie's third data item indexed to 1 (i.e., which data item must be specified to specify).<br/> {d1:2: F2} indicates that a formatted string with a value specified separately is F2 (numericFormatter is used when numericFormatter is not specified).<br/> {d:0.##} indicates that a formatted string with a value specified separately is 0.## (used for percentage, reserved 2 valid digits while avoiding the situation similar to "100.00%" when using f2 ).<br/> Example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1} : {c1:1-1: f1}"<br/>
|titleFormatter|||String template formatter for tooltip title content. \n line wrapping is supported. The placeholder {i} can be set separately to indicate that title is ignored and not displayed. Template variables are {.}, {a}, {b}, {c}, {d}, {e}, {f}, and {g}. <br /> {.} is the dot of the corresponding color of serie currently indicated or index 0. <br /> {a} is the series name name of serie currently indicated or index 0. <br /> {b} is the name of the serie data item serieData currently indicated or index 0, or the category value (such as the X-axis of a line chart). <br /> {c} is the value of the serie y-dimension (dimesion is 1) currently indicated or index is 0. <br /> {d} is the serie y-dimensional (dimesion 1) percentage value of the currently indicated or index 0, note without the % sign. <br /> {e} is the name of the serie data item serieData currently indicated or whose index is 0. <br /> {h} is the hexadecimal color value of serieData for the serie data item currently indicated or index 0. <br /> {f} is the sum of data. <br /> {g} indicates the total number of data. <br /> {y} is category value of y axis. <br /> {.1} represents a dot of the corresponding color with serie specified as index 1. <br /> The 1 in {a1}, {b1}, {c1} represents serie where index is specified as 1. <br /> {c1:2} represents the third data of the current indicator data item in serie with index 1 (one data item has multiple data, index 2 represents the third data). <br /> {c1:2-2} represents the third data of serie third data item with index 1 (that is, the number of data items must be specified when specifying the number of data items). <br /> {d1:2:f2} indicates that a format string with a single value is f2 (numericFormatter is used if no value is specified). <br /> {d:0.##} indicates that the format string with a value specified alone is 0.## # (for percentages, preserving a 2-digit significant number while avoiding the "100.00%" situation with f2). <br /> example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1}, {c1:1-1: f1}"
|marker|||the marker of serie.
|fixedWidth|0||Fixed width. Higher priority than minWidth.
|fixedHeight|0||Fixed height. Higher priority than minHeight.
@@ -2315,6 +2416,28 @@ Tooltip component.
</APITable>
```
## ViewControl
> class in XCharts.Runtime / Inherits from: [ChildComponent](#childcomponent)
> Since `v3.11.0`
View control component in 3D coordinate system.
```mdx-code-block
<APITable name="ViewControl">
```
|field|default|since|comment|
|--|--|--|--|
|alpha|90f||The angle of the view in the x-z plane.
|beta|55f||The angle of the view in the y-z plane.
```mdx-code-block
</APITable>
```
## VisualMap
> class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent)
@@ -2399,12 +2522,24 @@ VisualMap component. Mapping data to visual elements such as colors.
</APITable>
```
## Wrapper&lt;T&gt;
> class in XCharts.Runtime
## XAxis
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
The x axis in cartesian(rectangular) coordinate.
## XAxis3D
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
> Since `v3.11.0`
The x axis in cartesian(rectangular) coordinate.
## XCResourcesImporter
> class in XCharts.Runtime
@@ -2466,3 +2601,19 @@ The x axis in cartesian(rectangular) coordinate.
The x axis in cartesian(rectangular) coordinate.
## YAxis3D
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
> Since `v3.11.0`
The x axis in cartesian(rectangular) coordinate.
## ZAxis3D
> class in XCharts.Runtime / Inherits from: [Axis](#axis)
> Since `v3.11.0`
The x axis in cartesian(rectangular) coordinate.

View File

@@ -1,142 +1,168 @@
# XCharts FAQ
[QA 1: How to adjust the margin between the axis and the background?](#How-to-adjust-the-margin-between-the-axis-and-the=-background)
[QA 2: How to play agian the fadeIn animation?](#How-to-play-agian-the-fadeIn-animation)
[QA 3: How to customize the color of data item in line chart and pie chart?](#How-to-customize-the-color-of-data-item-in-line-chart-and-pie-chart)
[QA 4: How to formatter the text of axis label, such as add a units text?](#How-to-formatter-the-text-of-axis-label-such-as-add-a-units-text)
[QA 5: How to stack the bar of bar chart](#How-to-stack-the-bar-of-bar-chart)
[QA 6: How to make the bar serie in the same bar but not stack?](#How-to-make-the-bar-serie-in-the-same-bar-but-not-stack)
[QA 7: How to adjust the bar width and gap of barchart?](#How-to-adjust-the-bar-width-and-gap-of-barchart)
[QA 8: How to adjust the color of bar?](#How-to-adjust-the-color-of-bar)
[QA 9: Can I adjust the anchor of chart?](#Can-I-adjust-the-anchor-of-chart)
[QA 10: Can display more than 1000 data?](#Can-display-more-than-1000-data)
[QA 11: Can line chart drawing be dash, dot and dash-dot?](#Can-line-chart-drawing-be-dash-dot-and-dash-dot)
[QA 12: How to limit the value range of the Y-axis?](#How-to-limit-the-value-range-of-the-Y-axis)
[QA 13: How to customize the tick value range of value axis?](#How-to-customize-the-tick-value-range-of-value-axis)
[QA 14: How to display text at the top of data items?](#How-to-display-text-at-the-top-of-data-items)
[QA 15: How do I customize icons for data items?](#How-do-I-customize-icons-for-data-items)
[QA 16: How to anti-aliasing and make the chart smoother?](#How-to-anti-aliasing-and-make-the-chart-smoother)
[QA 17: Why does mouse over chart Tooltip not show?](#Why-does-mouse-over-chart-Tooltip-not-show)
[QA 18: How not to display the bar line of Tooltip?](#How-not-to-display-the-bar-line-of-Tooltip)
[QA 19: How do I customize the display of Tooltip?](#How-do-I-customize-the-display-of-Tooltip)
[QA 20: How do I get the Y-axis to display multiple decimal places?](#How-do-I-get-the-Y-axis-to-display-multiple-decimal-places)
[QA 21: How do I dynamically update data with code?](#How-do-I-dynamically-update-data-with-code)
[QA 22: How to display legend? Why are legends sometimes not displayed?](#How-to-display-legend?Why-are-legends-sometimes-not-displayed)
[QA 23: How to make chart as prefab?](#How-to-make-chart-as-prefab)
[QA 24: How do I draw custom graphic in chart,such as line or dot?](#How-do-I-draw-custom-content-in-chart-such-as-line-or-dot)
[QA 25: How to achieve similar data movement effect of ELECTRO cardiogram?](#How-to-achieve-similar-data-movement-effect-of-ELECTRO-cardiogram)
[QA 26: How do I use the background component? What are the conditions?](#How-do-I-use-the-background-component-What-are-the-conditions)
[QA 27: Mesh can not have more than 65000 vertices?](#Mesh-cannot-have-more-than-65000-vertices)
[QA 28: Why are the parameters set in Serie reset after they run?](#Why-are-the-parameters-set-in-Serie-reset-after-they-run)
[FAQ 1: How to adjust the margin between the axis and the background?](#how-to-adjust-the-margin-between-the-axis-and-the-background)
[FAQ 2: How to play agian the fadeIn animation?](#how-to-play-agian-the-fadein-animation)
[FAQ 3: How to customize the color of data item in line chart and pie chart?](#how-to-customize-the-color-of-data-item-in-line-chart-and-pie-chart)
[FAQ 4: How to formatter the text of axis label, such as add a units text?](#how-to-formatter-the-text-of-axis-label-such-as-add-a-units-text)
[FAQ 5: How to stack the bar of bar chart](#how-to-stack-the-bar-of-bar-chart)
[FAQ 6: How to make the bar serie in the same bar but not stack?](#how-to-make-the-bar-serie-in-the-same-bar-but-not-stack)
[FAQ 7: How to adjust the bar width and gap of barchart?](#how-to-adjust-the-bar-width-and-gap-of-barchart)
[FAQ 8: How to adjust the color of bar?](#how-to-adjust-the-color-of-bar)
[FAQ 9: Can I adjust the anchor of chart?](#can-i-adjust-the-anchor-of-chart)
[FAQ 10: Can display more than 1000 data?](#can-display-more-than-1000-data)
[FAQ 11: Can line chart drawing be dash, dot and dash-dot?](#can-line-chart-drawing-be-dash-dot-and-dash-dot)
[FAQ 12: How to limit the value range of the Y-axis?](#how-to-limit-the-value-range-of-the-y-axis)
[FAQ 13: How to customize the tick value range of value axis?](#how-to-customize-the-tick-value-range-of-value-axis)
[FAQ 14: How to display text at the top of data items?](#how-to-display-text-at-the-top-of-data-items)
[FAQ 15: How do I customize icons for data items?](#how-do-i-customize-icons-for-data-items)
[FAQ 16: How to anti-aliasing and make the chart smoother?](#how-to-anti-aliasing-and-make-the-chart-smoother)
[FAQ 17: Why does mouse over chart Tooltip not show?](#why-does-mouse-over-chart-tooltip-not-show)
[FAQ 18: How not to display the bar line of Tooltip?](#how-not-to-display-the-bar-line-of-tooltip)
[FAQ 19: How do I customize the display of Tooltip?](#how-do-i-customize-the-display-of-tooltip)
[FAQ 20: How do I get the Y-axis to display multiple decimal places?](#how-do-i-get-the-y-axis-to-display-multiple-decimal-places)
[FAQ 21: How do I dynamically update data with code?](#how-do-i-dynamically-update-data-with-code)
[FAQ 22: How to display legend? Why are legends sometimes not displayed?](#how-to-display-legend-why-are-legends-sometimes-not-displayed)
[FAQ 23: How to make chart as prefab?](#how-to-make-chart-as-prefab)
[FAQ 24: How do I draw custom graphic in chart,such as line or dot?](#how-do-i-draw-custom-content-in-chart-such-as-line-or-dot)
[FAQ 25: How to achieve similar data movement effect of ELECTRO cardiogram?](#how-to-achieve-similar-data-movement-effect-of-electro-cardiogram)
[FAQ 26: How do I use the background component? What are the conditions?](#how-do-i-use-the-background-component-what-are-the-conditions)
[FAQ 27: Mesh can not have more than 65000 vertices?](#mesh-cannot-have-more-than-65000-vertices)
[FAQ 28: Why are the parameters set in Serie reset after they run?](#why-are-the-parameters-set-in-serie-reset-after-they-run)
[FAQ 29: How to change the color of serie symbol?](#how-to-change-the-color-of-serie-symbol)
[FAQ 30: How to deal with TMP errors when importing or updating XCharts?](#what-if-tmp-errors-occur-when-importing-or-updating-xcharts)
[FAQ 31: Support empty data? How to achieve the effect of line chart disconnection?](#support-empty-data-how-to-achieve-the-effect-of-line-chart-disconnection)
[FAQ 32: 2.x What are the common problems when upgrading version 3.x?](#what-are-the-common-problems-when-upgrading-xcharts2-to-xcharts3)
## How-to-adjust-the-margin-between-the-axis-and-the=-background
## how-to-adjust-the-margin-between-the-axis-and-the-background
A: `Grid` conponentwhich can adjust the left, right, up, down margins of chart.
`Grid` conponentwhich can adjust the left, right, up, down margins of chart.
## How-to-play-agian-the-fadeIn-animation
## how-to-play-agian-the-fadein-animation
A: call the `chart.AnimationReset()` API.
call the `chart.AnimationReset()` API.
## How-to-customize-the-color-of-data-item-in-line chart-and-pie-chart
## how-to-customize-the-color-of-data-item-in-line chart-and-pie-chart
A: `Theme`->`colorPalette`, or the sub component `LineStyle` and `ItemStyle` of `Serie`.
`Theme`->`colorPalette`, or the sub component `LineStyle` and `ItemStyle` of `Serie`.
## How-to-formatter-the-text-of-axis-label-such-as-add-a-units-text
## how-to-formatter-the-text-of-axis-label-such-as-add-a-units-text
A: Adjust `formatter` and `numericFormatter` parameter of `Legend`, `AxisLabel`, `Tooltop`, `SerieLabel`.
Adjust `formatter` and `numericFormatter` parameter of `Legend`, `AxisLabel`, `Tooltop`, `SerieLabel`.
## How-to-stack-the-bar-of-bar-chart
## how-to-stack-the-bar-of-bar-chart
A: Set the `stack` parameter of `Serie`, the series will stack in a bar with the same `stack`.
Set the `stack` parameter of `Serie`, the series will stack in a bar with the same `stack`.
## How-to-make-the-bar-serie-in-the-same-bar-but-not-stack
## how-to-make-the-bar-serie-in-the-same-bar-but-not-stack
A: Set the `barGap` of `Serie` to `-1``stack` to null.
Set the `barGap` of `Serie` to `-1``stack` to null.
## How-to-adjust-the-bar-width-and-gap-of-barchart
## how-to-adjust-the-bar-width-and-gap-of-barchart
A: Adjust the `barWidth` and `barGap` parameter of `Serie`, the last `serie`'s `barWidth` and `barGap` are valid when multiple `serie`.
Adjust the `barWidth` and `barGap` parameter of `Serie`, the last `serie`'s `barWidth` and `barGap` are valid when multiple `serie`.
## How-to-adjust-the-color-of-bar
## how-to-adjust-the-color-of-bar
A: Adjust the `ItemStyle` of `Data` in `inspector`.
Adjust the `ItemStyle` of `Data` in `inspector`.
## Can-I-adjust-the-anchor-of-chart
## can-i-adjust-the-anchor-of-chart
A: Yes, you can set any one of 16 anchors but the value use default.
Yes, you can set any one of 16 anchors but the value use default.
## Can-display-more-than-1000-data
## can-display-more-than-1000-data
A: Yes. But `UGUI` limits `65000` vertices to a single `Graphic`, so too much data may not be displayed completely. The sampling simplification curve can be turned on by setting the sampling distance `sampleDist`. You can also set some parameters to reduce the number of vertices in the chart to help show more data. Such as reducing the size of the chart, close or reduce the axis of the client drawing, close `Symbol` and `Label` display. A `Normal` line chart occupies fewer vertices than a `Smooth` line chart. The `1.5.0` and above versions can set `large` and `largeThreshold` parameters to enable performance mode.
Yes. But `UGUI` limits `65000` vertices to a single `Graphic`, so too much data may not be displayed completely. The sampling simplification curve can be turned on by setting the sampling distance `sampleDist`. You can also set some parameters to reduce the number of vertices in the chart to help show more data. Such as reducing the size of the chart, close or reduce the axis of the client drawing, close `Symbol` and `Label` display. A `Normal` line chart occupies fewer vertices than a `Smooth` line chart. The `1.5.0` and above versions can set `large` and `largeThreshold` parameters to enable performance mode.
## Can-line-chart-drawing-be-dash-dot-and-dash-dot
## can-line-chart-drawing-be-dash-dot-and-dash-dot
A: Yes. Adjust the `lineType` of `Serie`.
Yes. Adjust the `lineType` of `Serie`.
## How-to-limit-the-value-range-of-the-Y-axis
## how-to-limit-the-value-range-of-the-y-axis
A: Select the `minMaxType` of `Axis` as `Custom`, then set `min` and `max` to the values you want.
Select the `minMaxType` of `Axis` as `Custom`, then set `min` and `max` to the values you want.
## How-to-customize-the-tick-value-range-of-value-axis
## how-to-customize-the-tick-value-range-of-value-axis
A: By default, it is automatically split by the `splitNumber` of `Axis`. Also, you can customize the `interval` to the range you want.
By default, it is automatically split by the `splitNumber` of `Axis`. Also, you can customize the `interval` to the range you want.
## How-to-display-text-at-the-top-of-data-items
## how-to-display-text-at-the-top-of-data-items
A: Adjust the `Label` of `Serie`.
Adjust the `Label` of `Serie`.
## How-do-I-customize-icons-for-data-items
## how-do-i-customize-icons-for-data-items
A: Set the `Icon` of `Data` in `Serie`.
Set the `Icon` of `Data` in `Serie`.
## How-to-anti-aliasing-and-make-the-chart-smoother
## how-to-anti-aliasing-and-make-the-chart-smoother
A: Open the `Anti-Aliasing` setting in `Unity`. Selected the UI Canvas `Render Mode` as `Screen Space-Camera`, selected `MSAA`, set `4` times or higher anti-aliasing. The sawtooth can only be reduced and unavoidable. The higher the pixel, the less obvious the sawtooth is.
Open the `Anti-Aliasing` setting in `Unity`. Selected the UI Canvas `Render Mode` as `Screen Space-Camera`, selected `MSAA`, set `4` times or higher anti-aliasing. The sawtooth can only be reduced and unavoidable. The higher the pixel, the less obvious the sawtooth is.
## Why-does-mouse-over-chart-Tooltip-not-show
## why-does-mouse-over-chart-tooltip-not-show
A: Verify `Toolip` is opened. Verify that the parent node of chart has turned off mouse events.
Verify `Toolip` is opened. Verify that the parent node of chart has turned off mouse events.
## How-not-to-display-the-bar-line-of-Tooltip
## how-not-to-display-the-bar-line-of-tooltip
A: Set the `type` of `Tooltup` as `None`. Or adjust the parameters of `lineStyle`.
Set the `type` of `Tooltup` as `None`. Or adjust the parameters of `lineStyle`.
## How-do-I-customize-the-display-of-Tooltip
## how-do-i-customize-the-display-of-tooltip
A: See the `formatter`, `itemFormatter`, `titleFormatter` parameters of `Tooltip`.
See the `formatter`, `itemFormatter`, `titleFormatter` parameters of `Tooltip`.
## How-do-I-get-the-Y-axis-to-display-multiple-decimal-places
## how-do-i-get-the-y-axis-to-display-multiple-decimal-places
A: Set the `numericFormatter` parameter of `AxisLabel`.
Set the `numericFormatter` parameter of `AxisLabel`.
## How-do-I-dynamically-update-data-with-code
## how-do-i-dynamically-update-data-with-code
A: See example: `Example01_UpdateData.cs`
See example: `Example01_UpdateData.cs`
## How-to-display-legend?Why-are-legends-sometimes-not-displayed
## how-to-display-legend-why-are-legends-sometimes-not-displayed
A: First, the `name` in `Serie` must have a value that is not null. Then set `Legend` is `show`, where `data` can be empty by default, indicating that all legends are displayed. If you only want to display part of the `Serie` legend, fill in `data` with the `name` of the legend you want to display. If none of the values in `data` are `name` of the series, the legend will not be displayed.
First, the `name` in `Serie` must have a value that is not null. Then set `Legend` is `show`, where `data` can be empty by default, indicating that all legends are displayed. If you only want to display part of the `Serie` legend, fill in `data` with the `name` of the legend you want to display. If none of the values in `data` are `name` of the series, the legend will not be displayed.
## How-to-make-chart-as-prefab
## how-to-make-chart-as-prefab
A: Before make prefab, please delete all sub gameObject under chart which auto-created by `XCharts`.
Before make prefab, please delete all sub gameObject under chart which auto-created by `XCharts`.
## How-do-I-draw-custom-content-in-chart-such-as-line-or-dot
## how-do-i-draw-custom-content-in-chart-such-as-line-or-dot
A: Implement `onCustomDraw` of chart, see `Example12_CustomDrawing.cs`.
Implement `onCustomDraw` of chart, see `Example12_CustomDrawing.cs`.
## How-to-achieve-similar-data-movement-effect-of-ELECTRO-cardiogram
## how-to-achieve-similar-data-movement-effect-of-electro-cardiogram
A: See `Example_Dynamic.cs`.
See `Example_Dynamic.cs`.
## How-do-I-use-the-background-component-What-are-the-conditions
## how-do-i-use-the-background-component-what-are-the-conditions
A: Setting `show` to `true` for the `background` component.
Setting `show` to `true` for the `background` component.
## Mesh-cannot-have-more-than-65000-vertices
## mesh-cannot-have-more-than-65000-vertices
A: This is the limit of `UGUI` on the number of vertices for a single `Graphic`. `XCharts` is draw chart on a single `Graphic`, so there is also this limitation. The solution can be referred to: [QA 10: Can display more than 1000 data](#Can-display-more-than-1000-data)
This is the limit of `UGUI` on the number of vertices for a single `Graphic`. `XCharts` is draw chart on a single `Graphic`, so there is also this limitation. The solution can be referred to: [FAQ 10: Can display more than 1000 data](#can-display-more-than-1000-data)
## Why-are-the-parameters-set-in-Serie-reset-after-they-run
## why-are-the-parameters-set-in-serie-reset-after-they-run
A: Check whether `RemoveData()` and add new `Serie` in the code. If you want to keep the configuration of `Serie`, you can only `ClearData()` which just clear data and then readd the data to the old serie.
Check whether `RemoveData()` and add new `Serie` in the code. If you want to keep the configuration of `Serie`, you can only `ClearData()` which just clear data and then readd the data to the old serie.
## how-to-change-the-color-of-serie-symbol
The color of 'Symbol' is the color of 'ItemStyle' used.
## what-if-tmp-errors-occur-when-importing-or-updating-xcharts
XCharts does not enable TMP by default, so there are no references to TMP on asmdef. This issue may occur when updating XCharts after TMP is enabled locally. It can be solved in the following two ways:
1. Find `XCharts.Runtime.asmdef` and `XCharts.Editor.asmdef` and manually add references to `TextMeshPro`
2. Remove the `dUI_TextMeshPro` macro for Scripting Define Symbols in PlayerSetting
Version ` 3.8.0 ` after adding Daemon [XCharts - Daemon](https://github.com/XCharts-Team/XCharts-Daemon), will be XCharts - Daemon import project, When updating XCharts, the daemon automatically refreshes the asmdef based on the locally enabled TMP to ensure proper compilation.
## support-empty-data-how-to-achieve-the-effect-of-line-chart-disconnection
`data` of `Serie` is of type `double`, so it cannot represent empty data. Empty data can be achieved by turning on Serie's ignore and specifying ignoreValue. You can also set the ignore parameter for each SerieData. The ignoreLineBreak parameter can be set to disconnect or connect after ignoring data.
## what-are-the-common-problems-when-upgrading-xcharts2-to-xcharts3
1. `XCharts.Runtime.XChartsMgr` is missing the class attribute `ExtensionOfNativeClass`!
3.x version does not need to mount XChartsMgr, directly delete the `_xcharts_` node on the scene.

View File

@@ -22,6 +22,7 @@ slug: /api
- [AreaStyle](#areastyle)
- [ArrowStyle](#arrowstyle)
- [Axis](#axis)
- [Axis3DHelper](#axis3dhelper)
- [AxisAnimation](#axisanimation)
- [AxisContext](#axiscontext)
- [AxisHandler&lt;T&gt;](#axishandlert)
@@ -45,6 +46,7 @@ slug: /api
- [BaseScatter](#basescatter)
- [BaseSerie](#baseserie)
- [BlurStyle](#blurstyle)
- [BorderStyle](#borderstyle)
- [CalendarCoord](#calendarcoord)
- [Candlestick](#candlestick)
- [CandlestickChart](#candlestickchart)
@@ -66,6 +68,7 @@ slug: /api
- [ComponentTheme](#componenttheme)
- [CoordOptionsAttribute](#coordoptionsattribute)
- [CoordSystem](#coordsystem)
- [DataHelper](#datahelper)
- [DataZoom](#datazoom)
- [DataZoomContext](#datazoomcontext)
- [DataZoomHelper](#datazoomhelper)
@@ -79,7 +82,12 @@ slug: /api
- [EmphasisStyle](#emphasisstyle)
- [EndLabelStyle](#endlabelstyle)
- [FormatterHelper](#formatterhelper)
- [GraphData](#graphdata)
- [GraphEdge](#graphedge)
- [GraphNode](#graphnode)
- [GridCoord](#gridcoord)
- [GridCoord3D](#gridcoord3d)
- [GridCoord3DContext](#gridcoord3dcontext)
- [GridCoordContext](#gridcoordcontext)
- [GridLayout](#gridlayout)
- [GridLayoutContext](#gridlayoutcontext)
@@ -99,6 +107,7 @@ slug: /api
- [ISimplifiedSerie](#isimplifiedserie)
- [ItemStyle](#itemstyle)
- [IUpdateRuntimeData](#iupdateruntimedata)
- [JsonUtil](#jsonutil)
- [LabelLine](#labelline)
- [LabelStyle](#labelstyle)
- [Lang](#lang)
@@ -115,10 +124,12 @@ slug: /api
- [Line](#line)
- [LineArrow](#linearrow)
- [LineChart](#linechart)
- [LineHelper](#linehelper)
- [LineStyle](#linestyle)
- [ListFor](#listfor)
- [ListForComponent](#listforcomponent)
- [ListForSerie](#listforserie)
- [ListPool&lt;T&gt;](#listpoolt)
- [Location](#location)
- [MainComponent](#maincomponent)
- [MainComponentContext](#maincomponentcontext)
@@ -169,6 +180,7 @@ slug: /api
- [SerieDataComponentAttribute](#seriedatacomponentattribute)
- [SerieDataContext](#seriedatacontext)
- [SerieDataExtraFieldAttribute](#seriedataextrafieldattribute)
- [SerieDataLink](#seriedatalink)
- [SerieEventData](#serieeventdata)
- [SerieEventDataPool](#serieeventdatapool)
- [SerieHandler](#seriehandler)
@@ -195,7 +207,6 @@ slug: /api
- [StateStyle](#statestyle)
- [SubTitleTheme](#subtitletheme)
- [SVG](#svg)
- [SVGImage](#svgimage)
- [SVGPath](#svgpath)
- [SVGPathSeg](#svgpathseg)
- [SymbolStyle](#symbolstyle)
@@ -220,12 +231,15 @@ slug: /api
- [UIComponent](#uicomponent)
- [UIComponentTheme](#uicomponenttheme)
- [UIHelper](#uihelper)
- [ViewControl](#viewcontrol)
- [VisualMap](#visualmap)
- [VisualMapContext](#visualmapcontext)
- [VisualMapHelper](#visualmaphelper)
- [VisualMapRange](#visualmaprange)
- [VisualMapTheme](#visualmaptheme)
- [Wrapper&lt;T&gt;](#wrappert)
- [XAxis](#xaxis)
- [XAxis3D](#xaxis3d)
- [XChartsMgr](#xchartsmgr)
- [XCResourceImporterWindow](#xcresourceimporterwindow)
- [XCResourcesImporter](#xcresourcesimporter)
@@ -233,6 +247,8 @@ slug: /api
- [XCThemeMgr](#xcthememgr)
- [XLog](#xlog)
- [YAxis](#yaxis)
- [YAxis3D](#yaxis3d)
- [ZAxis3D](#zaxis3d)
## AngleAxis
@@ -385,7 +401,7 @@ slug: /api
|API|版本|描述|
|--|--|--|
|CheckDataAnimation()||public static float CheckDataAnimation(BaseChart chart, Serie serie, int dataIndex, float destProgress, float startPorgress = 0)|
|GetAnimationPosition()||public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip)|
|GetAnimationPosition()||public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip, ref float rate)|
|UpdateAnimationType()||public static void UpdateAnimationType(AnimationStyle animation, AnimationType defaultType, bool enableSerieDataAnimation)|
|UpdateSerieAnimation()||public static void UpdateSerieAnimation(Serie serie)|
@@ -413,7 +429,7 @@ slug: /api
## Axis
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [AngleAxis](#angleaxis),[ParallelAxis](#parallelaxis),[RadiusAxis](#radiusaxis),[SingleAxis](#singleaxis),[XAxis](#xaxis),[YAxis](#yaxis)
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [AngleAxis](#angleaxis),[ParallelAxis](#parallelaxis),[RadiusAxis](#radiusaxis),[SingleAxis](#singleaxis),[XAxis](#xaxis),[XAxis3D](#xaxis3d),[YAxis](#yaxis),[YAxis3D](#yaxis3d),[ZAxis3D](#zaxis3d)
直角坐标系的坐标轴组件。
@@ -426,9 +442,11 @@ slug: /api
|ClearVerticesDirty()||public override void ClearVerticesDirty()|
|Clone()||public Axis Clone()|
|Copy()||public void Copy(Axis axis)|
|GetAddedDataCount()||public int GetAddedDataCount()<br/>获得添加过的历史数据总数 |
|GetCategoryPosition()||public Vector3 GetCategoryPosition(int categoryIndex, int dataCount = 0)|
|GetData()||public string GetData(int index)<br/>获得指定索引的类目数据 |
|GetData()||public string GetData(int index, DataZoom dataZoom)<br/>获得在dataZoom范围内指定索引的类目数据 |
|GetDistance()||public float GetDistance(double value, float axisLength)<br/>获得值在坐标轴上的距离 |
|GetDistance()||public float GetDistance(double value, float axisLength = 0)<br/>获得值在坐标轴上的距离 |
|GetIcon()||public Sprite GetIcon(int index)|
|GetLabelValue()||public double GetLabelValue(int index)|
|GetLastLabelValue()||public double GetLastLabelValue()|
@@ -446,12 +464,24 @@ slug: /api
|IsTop()||public bool IsTop()|
|IsValue()||public bool IsValue()<br/>是否为数值轴。 |
|RemoveData()||public void RemoveData(int dataIndex)|
|ResetStatus()||public override void ResetStatus()<br/>重置状态。 |
|SetComponentDirty()||public override void SetComponentDirty()|
|SetNeedUpdateFilterData()||public void SetNeedUpdateFilterData()|
|UpdateData()||public void UpdateData(int index, string category)<br/>更新类目数据 |
|UpdateIcon()||public void UpdateIcon(int index, Sprite icon)<br/>更新图标 |
|UpdateZeroOffset()||public void UpdateZeroOffset(float axisLength)|
## Axis3DHelper
> class in XCharts.Runtime
|API|版本|描述|
|--|--|--|
|Get3DGridPosition()||public static Vector3 Get3DGridPosition(GridCoord3D grid, XAxis3D xAxis, YAxis3D yAxis, double xValue, double yValue)|
|Get3DGridPosition()||public static Vector3 Get3DGridPosition(GridCoord3D grid, XAxis3D xAxis, YAxis3D yAxis, ZAxis3D zAxis, double xValue, double yValue, double zValue)|
|GetLabelPosition()||public static Vector3 GetLabelPosition(int i, Axis axis, Axis relativedAxis, AxisTheme theme, float scaleWid)|
## AxisAnimation
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
@@ -492,7 +522,7 @@ slug: /api
|GetAxisValueDistance()||public static float GetAxisValueDistance(GridCoord grid, Axis axis, float scaleWidth, double value)<br/>获得数值value在坐标轴上相对起点的距离 |
|GetAxisValueLength()||public static float GetAxisValueLength(GridCoord grid, Axis axis, float scaleWidth, double value)<br/>获得数值value在坐标轴上对应的长度 |
|GetAxisValuePosition()||public static float GetAxisValuePosition(GridCoord grid, Axis axis, float scaleWidth, double value)<br/>获得数值value在坐标轴上的坐标位置 |
|GetAxisValueSplitIndex()||public static int GetAxisValueSplitIndex(Axis axis, double value, int totalSplitNumber = -1)<br/>获得数值value在坐标轴上对应的split索引 |
|GetAxisValueSplitIndex()||public static int GetAxisValueSplitIndex(Axis axis, double value, bool checkMaxCache, int totalSplitNumber = -1)<br/>获得数值value在坐标轴上对应的split索引 |
|GetAxisXOrY()||public static float GetAxisXOrY(GridCoord grid, Axis axis, Axis relativedAxis)|
|GetDataWidth()||public static float GetDataWidth(Axis axis, float coordinateWidth, int dataCount, DataZoom dataZoom)<br/>获得一个类目数据在坐标系中代表的宽度 |
|GetEachWidth()||public static float GetEachWidth(Axis axis, float coordinateWidth, DataZoom dataZoom = null)|
@@ -638,6 +668,21 @@ slug: /api
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
柱状图(或称条形图)是一种通过柱形的高度(横向的情况下则是宽度)来表现数据大小的一种常用图表类型。
|API|版本|描述|
|--|--|--|
|DefaultBarChart()||public void DefaultBarChart()<br/>默认条形图。 |
|DefaultCapsuleBarChart()||public void DefaultCapsuleBarChart()<br/>默认胶囊条形图。 |
|DefaultCapsuleColumnChart()||public void DefaultCapsuleColumnChart()<br/>胶囊柱状图。 |
|DefaultGroupedBarChart()||public void DefaultGroupedBarChart()<br/>默认分组条形图。 |
|DefaultGroupedColumnChart()||public void DefaultGroupedColumnChart()<br/>默认分组柱状图。 |
|DefaultPercentBarChart()||public void DefaultPercentBarChart()<br/>默认百分比条形图。 |
|DefaultPercentColumnChart()||public void DefaultPercentColumnChart()<br/>默认百分比柱状图。 |
|DefaultStackedBarChart()||public void DefaultStackedBarChart()<br/>默认堆叠条形图。 |
|DefaultStackedColumnChart()||public void DefaultStackedColumnChart()<br/>默认堆叠分组柱状图。 |
|DefaultZebraBarChart()||public void DefaultZebraBarChart()<br/>默认斑马条形图。 |
|DefaultZebraColumnChart()||public void DefaultZebraColumnChart()<br/>斑马柱状图。 |
## BaseAxisTheme
@@ -689,6 +734,7 @@ slug: /api
|AddData()||public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)<br/>添加x,y数据到指定系列中。 |
|AddData()||public SerieData AddData(string serieName, List&lt;double&gt; multidimensionalData, string dataName = null, string dataId = null)<br/>添加多维数据x,y,z...)到指定的系列中。 |
|AddData()||public SerieData AddData(string serieName, params double[] multidimensionalData)<br/>添加多维数据x,y,z...)到指定的系列中。 |
|AddLink()||public SerieDataLink AddLink(int serieIndex, string sourceId, string targetId, double value = 0)<br/>添加一个关系图的关系数据。 |
|AddSerie&lt;T&gt;()||public T AddSerie&lt;T&gt;(string serieName = null, bool show = true, bool addToHead = false) where T : Serie|
|AddXAxisData()||public void AddXAxisData(string category, int xAxisIndex = 0)<br/>添加一个类目数据到指定的x轴。 |
|AddXAxisIcon()||public void AddXAxisIcon(Sprite icon, int xAxisIndex = 0)<br/>添加一个图标到指定的x轴。 |
@@ -707,9 +753,10 @@ slug: /api
|CanMultipleComponent()||public bool CanMultipleComponent(Type type)|
|ClampInChart()||public void ClampInChart(ref Vector3 pos)|
|ClampInGrid()||public Vector3 ClampInGrid(GridCoord grid, Vector3 pos)|
|ClearComponentData()||public virtual void ClearComponentData()<br/>清空所有组件的数据。 |
|ClearComponentData()|v3.4.0|public virtual void ClearComponentData()<br/>清空所有组件的数据。 |
|ClearData()||public virtual void ClearData()<br/>清空所有组件和Serie的数据。注意Serie只是清空数据不会移除Serie。 |
|ClearSerieData()||public virtual void ClearSerieData()<br/>清空所有serie的数据。 |
|ClearSerieData()|v3.4.0|public virtual void ClearSerieData()<br/>清空所有serie的数据。 |
|ClearSerieLinks()|v3.10.0|public virtual void ClearSerieLinks()<br/>清空所有serie的link数据。 |
|ClickLegendButton()||public void ClickLegendButton(int legendIndex, string legendName, bool show)<br/>点击图例按钮 |
|ConvertSerie()||public bool ConvertSerie(Serie serie, Type type)|
|ConvertSerie&lt;T&gt;()||public bool ConvertSerie&lt;T&gt;(Serie serie) where T : Serie|
@@ -733,7 +780,7 @@ slug: /api
|GetItemColor()||public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)|
|GetLegendRealShowNameColor()||public Color32 GetLegendRealShowNameColor(string name)|
|GetLegendRealShowNameIndex()||public int GetLegendRealShowNameIndex(string name)|
|GetMarkColor()||public Color32 GetMarkColor(Serie serie, SerieData serieData)<br/>获得Serie的标识颜色。 |
|GetMarkColor()|v3.4.0|public Color32 GetMarkColor(Serie serie, SerieData serieData)<br/>获得Serie的标识颜色。 |
|GetOrAddChartComponent&lt;T&gt;()||public T GetOrAddChartComponent&lt;T&gt;() where T : MainComponent|
|GetPainter()||public Painter GetPainter(int index)|
|GetSerie()||public Serie GetSerie(int serieIndex)|
@@ -809,8 +856,10 @@ slug: /api
|RemoveSerie()||public void RemoveSerie(string serieName)|
|RemoveSerie&lt;T&gt;()||public void RemoveSerie&lt;T&gt;() where T : Serie|
|ReplaceSerie()||public bool ReplaceSerie(Serie oldSerie, Serie newSerie)|
|ResetChartStatus()|v3.10.0|public void ResetChartStatus()<br/>重置图表状态。当设置某些参数后,由于动画影响,可能导致图表状态不正确,此时可以调用该接口重置图表状态。 |
|ResetDataIndex()||public bool ResetDataIndex(int serieIndex)<br/>重置serie的数据项索引。避免数据项索引异常。 |
|SetBasePainterMaterial()||public void SetBasePainterMaterial(Material material)<br/>设置Base Painter的材质球 |
|SetInsertDataToHead()|v3.11.0|public void SetInsertDataToHead(bool insertDataToHead)<br/>设置数据插入到头部。 |
|SetMaxCache()||public void SetMaxCache(int maxCache)<br/>设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。 |
|SetPainterActive()||public void SetPainterActive(int index, bool flag)|
|SetSerieActive()||public void SetSerieActive(int serieIndex, bool active)<br/>设置指定系列是否显示。 |
@@ -930,6 +979,20 @@ slug: /api
淡出状态样式。
## BorderStyle
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.10.0` 开始支持
边框样式。
|API|版本|描述|
|--|--|--|
|GetRuntimeBorderColor()||public Color32 GetRuntimeBorderColor()|
|GetRuntimeBorderWidth()||public float GetRuntimeBorderWidth()|
|GetRuntimeCornerRadius()||public float[] GetRuntimeCornerRadius()|
## CalendarCoord
> class in XCharts.Runtime / 继承自: [CoordSystem](#coordsystem),[IUpdateRuntimeData](#iupdateruntimedata),[ISerieContainer](#iseriecontainer)
@@ -953,6 +1016,7 @@ slug: /api
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
蜡烛图也叫K线图用于描述证券、衍生品或货币的价格走势的一种金融图表样式。
## ChartCached
@@ -1046,6 +1110,7 @@ slug: /api
|SetActive()||public static void SetActive(Image image, bool active)|
|SetActive()||public static void SetActive(Text text, bool active)|
|SetActive()||public static void SetActive(Transform transform, bool active)<br/>通过设置scale实现是否显示优化性能减少GC |
|SetBackground()||public static void SetBackground(Image background, Background imageStyle)|
|SetBackground()||public static void SetBackground(Image background, ImageStyle imageStyle)|
|SetColorOpacity()||public static void SetColorOpacity(ref Color32 color, float opacity)|
@@ -1097,6 +1162,7 @@ slug: /api
|--|--|--|
|ChartText()||public ChartText()|
|ChartText()||public ChartText(GameObject textParent)|
|GetColor()||public Color GetColor()|
|GetPreferredHeight()||public float GetPreferredHeight()|
|GetPreferredText()||public string GetPreferredText(string content, string suffix, float maxWidth)|
|GetPreferredWidth()||public float GetPreferredWidth()|
@@ -1129,7 +1195,7 @@ slug: /api
## ChildComponent
> class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle)
> class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle)
|API|版本|描述|
@@ -1185,8 +1251,8 @@ slug: /api
|API|版本|描述|
|--|--|--|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler)|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler, bool allowMultiple)|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler, bool allowMultiple, int order = 3)|
|ComponentHandlerAttribute()||public ComponentHandlerAttribute(Type handler, int order = 3)|
## ComponentHelper
@@ -1227,10 +1293,15 @@ slug: /api
## CoordSystem
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord),[SingleAxisCoord](#singleaxiscoord)
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridCoord3D](#gridcoord3d),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord),[SingleAxisCoord](#singleaxiscoord)
坐标系系统。
## DataHelper
> class in XCharts.Runtime
## DataZoom
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent),[IUpdateRuntimeData](#iupdateruntimedata)
@@ -1290,6 +1361,7 @@ DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息
|GetDateTime()||public static DateTime GetDateTime(int timestamp)|
|GetTimestamp()||public static int GetTimestamp()|
|GetTimestamp()||public static int GetTimestamp(DateTime time)|
|GetTimestamp()||public static int GetTimestamp(string dateTime)|
## DebugInfo
@@ -1369,6 +1441,61 @@ DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息
|TrimAndReplaceLine()||public static string TrimAndReplaceLine(string content)|
|TrimAndReplaceLine()||public static string TrimAndReplaceLine(StringBuilder sb)|
## GraphData
> class in XCharts.Runtime
数据结构-图。
|API|版本|描述|
|--|--|--|
|AddEdge()||public GraphEdge AddEdge(string nodeId1, string nodeId2, double value)|
|AddNode()||public GraphNode AddNode(string nodeId, string nodeName, int dataIndex, double value)|
|BreadthFirstTraverse()||public void BreadthFirstTraverse(GraphNode startNode, System.Action&lt;GraphNode&gt; onTraverse)|
|Clear()||public void Clear()|
|DeepFirstTraverse()||public void DeepFirstTraverse(GraphNode startNode, System.Action&lt;GraphNode&gt; onTraverse)|
|EachNode()||public void EachNode(System.Action&lt;GraphNode&gt; onEach)|
|ExpandAllNodes()||public void ExpandAllNodes(bool flag, int level = -1)|
|ExpandNode()||public void ExpandNode(string nodeId, bool flag)|
|GetDepthNodes()||public List&lt;List&lt;GraphNode&gt;&gt; GetDepthNodes()|
|GetEdge()||public GraphEdge GetEdge(string nodeId1, string nodeId2)|
|GetExpandedNodesCount()||public static int GetExpandedNodesCount(List&lt;GraphNode&gt; nodes)|
|GetMaxDepth()||public int GetMaxDepth()|
|GetNode()||public GraphNode GetNode(string nodeId)|
|GetNodeDepth()||// public int GetNodeDepth(GraphNode node)|
|GetNodeDepth()||// public void GetNodeDepth(GraphNode node, ref int depth, int recursiveCount = 0)|
|GetNodeDepth()||public int GetNodeDepth(GraphNode node, int recursiveCount = 0)|
|GetNodesTotalValue()||public static double GetNodesTotalValue(List&lt;GraphNode&gt; nodes)|
|GetRootNodes()||public List&lt;GraphNode&gt; GetRootNodes()|
|GraphData()||public GraphData(bool directed)|
|IsAllNodeInZeroPosition()||public bool IsAllNodeInZeroPosition()|
|Refresh()||public void Refresh()|
## GraphEdge
> class in XCharts.Runtime
图的边。
|API|版本|描述|
|--|--|--|
|GraphEdge()||public GraphEdge(GraphNode node1, GraphNode node2, double value)|
|IsPointInEdge()||public bool IsPointInEdge(Vector2 point)|
## GraphNode
> class in XCharts.Runtime
图的节点。
|API|版本|描述|
|--|--|--|
|Expand()||public void Expand(bool flag)|
|GraphNode()||public GraphNode(string id, string name, int dataIndex)|
|IsAllInEdgesCollapsed()||public bool IsAllInEdgesCollapsed()|
|IsAnyInEdgesExpanded()||public bool IsAnyInEdgesExpanded()|
|ToString()||public override string ToString()|
## GridCoord
> class in XCharts.Runtime / 继承自: [CoordSystem](#coordsystem),[IUpdateRuntimeData](#iupdateruntimedata),[ISerieContainer](#iseriecontainer)
@@ -1388,8 +1515,31 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|ContainsX()|v3.7.0|public bool ContainsX(float x)<br/>给定的x是否在网格内。 |
|ContainsY()|v3.7.0|public bool ContainsY(float y)<br/>给定的y是否在网格内。 |
|IsPointerEnter()||public bool IsPointerEnter()<br/>指针是否在网格内。 |
|NotAnyIntersect()|v3.10.0|public bool NotAnyIntersect(Vector3 sp, Vector3 ep)<br/>判断给定的线段是否与Grid边界是否完全不会相交。 |
|UpdateRuntimeData()||public void UpdateRuntimeData(BaseChart chart)|
## GridCoord3D
> class in XCharts.Runtime / 继承自: [CoordSystem](#coordsystem),[IUpdateRuntimeData](#iupdateruntimedata),[ISerieContainer](#iseriecontainer)
> 从 `v3.11.0` 开始支持
Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart can be drawn in grid.
|API|版本|描述|
|--|--|--|
|Clamp()||public void Clamp(ref Vector3 pos)<br/>将位置限制在网格内。 |
|Contains()||public bool Contains(Vector3 pos)<br/>给定的位置是否在网格内。 |
|IsLeft()||public bool IsLeft()<br/>The opening of the coordinate system faces to the left. 坐标系开口朝向左边。 |
|IsPointerEnter()||public bool IsPointerEnter()<br/>指针是否在网格内。 |
|NotAnyIntersect()||public bool NotAnyIntersect(Vector3 sp, Vector3 ep)<br/>判断给定的线段是否与Grid边界是否完全不会相交。 |
|UpdateRuntimeData()||public void UpdateRuntimeData(BaseChart chart)|
## GridCoord3DContext
> class in XCharts.Runtime / 继承自: [MainComponentContext](#maincomponentcontext)
## GridCoordContext
> class in XCharts.Runtime / 继承自: [MainComponentContext](#maincomponentcontext)
@@ -1425,6 +1575,11 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
热力图主要通过颜色去表现数值的大小,必须要配合 visualMap 组件使用。 可以应用在直角坐标系以及地理坐标系上,这两个坐标系上的表现形式相差很大,直角坐标系上必须要使用两个类目轴。
|API|版本|描述|
|--|--|--|
|DefaultCountHeatmapChart()||public void DefaultCountHeatmapChart()<br/>默认计数热力图。 |
## IconStyle
@@ -1535,7 +1690,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
## ISerieContainer
> class in XCharts.Runtime / 子类: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord)
> class in XCharts.Runtime / 子类: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridCoord3D](#gridcoord3d),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord)
## ISerieDataComponent
@@ -1567,14 +1722,25 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|GetToColor()||public Color32 GetToColor()|
|IsNeedCorner()||public bool IsNeedCorner()|
|IsNeedGradient()||public bool IsNeedGradient()|
|NeedShowBorder()||public bool NeedShowBorder()<br/>是否需要显示边框。 |
|Reset()||public void Reset()|
## IUpdateRuntimeData
> class in XCharts.Runtime / 子类: [SingleAxis](#singleaxis),[DataZoom](#datazoom),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridLayout](#gridlayout),[ParallelCoord](#parallelcoord)
> class in XCharts.Runtime / 子类: [SingleAxis](#singleaxis),[DataZoom](#datazoom),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[GridLayout](#gridlayout),[GridCoord3D](#gridcoord3d),[ParallelCoord](#parallelcoord)
## JsonUtil
> class in XCharts.Runtime
|API|版本|描述|
|--|--|--|
|GetJsonArray&lt;T&gt;()||public static T[] GetJsonArray&lt;T&gt;(string json)|
|GetJsonObject&lt;T&gt;()||public static T GetJsonObject&lt;T&gt;(string json)|
|GetWebJson&lt;T&gt;()||public static IEnumerator GetWebJson&lt;T&gt;(string url, Action&lt;T[]&gt; callback)|
|GetWebJson&lt;T&gt;()||public static IEnumerator GetWebJson&lt;T&gt;(string url, Action&lt;T&gt; callback)|
## LabelLine
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
@@ -1735,6 +1901,8 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.10.0` 开始支持
## Line
@@ -1755,6 +1923,29 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
折线图是用折线将各个数据点标志连接起来的图表,用于展现数据的变化趋势。可用于直角坐标系和极坐标系上。 设置 areaStyle 后可以绘制面积图。
|API|版本|描述|
|--|--|--|
|DefaultAreaLineChart()||public void DefaultAreaLineChart()<br/>默认面积折线图。 |
|DefaultDashLineChart()||public void DefaultDashLineChart()<br/>默认虚线折线图。 |
|DefaultLogLineChart()||public void DefaultLogLineChart()<br/>默认对数轴折线图。 |
|DefaultSmoothAreaLineChart()||public void DefaultSmoothAreaLineChart()<br/>默认平滑面积折线图。 |
|DefaultSmoothLineChart()||public void DefaultSmoothLineChart()<br/>默认平滑折线图。 |
|DefaultStackAreaLineChart()||public void DefaultStackAreaLineChart()<br/>默认堆叠面积折线图。 |
|DefaultStackLineChart()||public void DefaultStackLineChart()<br/>默认堆叠折线图。 |
|DefaultStepLineChart()||public void DefaultStepLineChart()<br/>默认阶梯折线图。 |
|DefaultTimeLineChart()||public void DefaultTimeLineChart()<br/>默认时间折线图。 |
## LineHelper
> class in XCharts.Runtime
|API|版本|描述|
|--|--|--|
|GetDataAverageRate()||public static int GetDataAverageRate(Serie serie, float axisLength, int maxCount, bool isYAxis)|
|GetLineWidth()||public static float GetLineWidth(ref bool interacting, Serie serie, float defaultWidth)|
## LineStyle
@@ -1806,6 +1997,17 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|--|--|--|
|ListForSerie()||public ListForSerie(Type type) : base(type)|
## ListPool&lt;T&gt;
> class in XCharts.Runtime
|API|版本|描述|
|--|--|--|
|ClearAll()||public static void ClearAll()|
|Get()||public static List&lt;T&gt; Get()|
|Release()||public static void Release(List&lt;T&gt; toRelease)|
## Location
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent),[IPropertyChanged](#ipropertychanged)
@@ -1835,6 +2037,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|CompareTo()||public int CompareTo(object obj)|
|OnRemove()||public virtual void OnRemove()|
|Reset()||public virtual void Reset() { }|
|ResetStatus()||public virtual void ResetStatus() { }|
|SetAllDirty()||public virtual void SetAllDirty()|
|SetComponentDirty()||public virtual void SetComponentDirty()|
|SetDefaultValue()||public virtual void SetDefaultValue() { }|
@@ -1842,7 +2045,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
## MainComponentContext
> class in XCharts.Runtime / 子类: [AxisContext](#axiscontext),[DataZoomContext](#datazoomcontext),[LegendContext](#legendcontext),[RadarCoordContext](#radarcoordcontext),[VisualMapContext](#visualmapcontext),[GridCoordContext](#gridcoordcontext),[GridLayoutContext](#gridlayoutcontext),[ParallelCoordContext](#parallelcoordcontext),[PolarCoordContext](#polarcoordcontext)
> class in XCharts.Runtime / 子类: [AxisContext](#axiscontext),[DataZoomContext](#datazoomcontext),[LegendContext](#legendcontext),[RadarCoordContext](#radarcoordcontext),[VisualMapContext](#visualmapcontext),[GridCoordContext](#gridcoordcontext),[GridLayoutContext](#gridlayoutcontext),[GridCoord3DContext](#gridcoord3dcontext),[ParallelCoordContext](#parallelcoordcontext),[PolarCoordContext](#polarcoordcontext)
## MainComponentHandler
@@ -2018,6 +2221,7 @@ Marquee style. It can be used for the DataZoom component. 选取框样式。可
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
平行坐标系,通过绘制垂直于坐标轴的平行线来显示数据的一种可视化图表。
## ParallelCoord
@@ -2051,6 +2255,15 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
饼图主要用于显示不同类目占比的情况,通过弧长来反映数据的大小占比。
|API|版本|描述|
|--|--|--|
|DefaultAreaRosePieChart()||public void DefaultAreaRosePieChart()<br/>默认面积玫瑰饼图。 |
|DefaultDonutPieChart()||public void DefaultDonutPieChart()<br/>默认甜甜圈饼图。 |
|DefaultLabelDonutPieChart()||public void DefaultLabelDonutPieChart()<br/>默认带标签甜甜圈饼图。 |
|DefaultLabelPieChart()||public void DefaultLabelPieChart()<br/>默认带标签饼图。 |
|DefaultRadiusRosePieChart()||public void DefaultRadiusRosePieChart()<br/>默认玫瑰饼图。 |
## PolarAxisTheme
@@ -2065,6 +2278,13 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
极坐标系,可以用于散点图和折线图。
|API|版本|描述|
|--|--|--|
|DefaultHeatmapPolarChart()||public void DefaultHeatmapPolarChart()<br/>默认极坐标色块图。 |
|DefaultRadialBarPolarChart()||public void DefaultRadialBarPolarChart()<br/>默认径向柱状极坐标图。 |
|DefaultTangentialBarPolarChart()||public void DefaultTangentialBarPolarChart()<br/>默认切向柱状极坐标图。 |
## PolarCoord
@@ -2116,6 +2336,11 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
雷达图主要用于显示多变量的数据,例如足球运动员的各项属性分析。依赖雷达组件。
|API|版本|描述|
|--|--|--|
|DefaultCircleRadarChart()||public void DefaultCircleRadarChart()<br/>默认圆形雷达图。 |
## RadarCoord
@@ -2186,6 +2411,11 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
环形图主要用于显示每一项的比例以及各项之间的关系。
|API|版本|描述|
|--|--|--|
|DefaultMultipleRingChart()||public void DefaultMultipleRingChart()<br/>默认多圆环图。 |
## RuntimeUtil
@@ -2214,6 +2444,11 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
散点图主要用于展现两个数据维度之间的关系。
|API|版本|描述|
|--|--|--|
|DefaultBubbleChart()||public void DefaultBubbleChart()<br/>默认气泡图。 |
## SelectStyle
@@ -2242,7 +2477,8 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|AddData()||public SerieData AddData(List&lt;double&gt; valueList, string dataName = null, string dataId = null)<br/>将一组数据添加到系列中。 如果数据只有一个默认添加到维度Y中。 |
|AddData()||public SerieData AddData(params double[] values)<br/>添加任意维数据到系列中。 |
|AddExtraComponent&lt;T&gt;()||public T AddExtraComponent&lt;T&gt;() where T : ChildComponent, ISerieComponent|
|AddSerieData()||public void AddSerieData(SerieData serieData)|
|AddLink()||public virtual SerieDataLink AddLink(string sourceId, string targetId, double value = 0)<br/>添加一个关系图的关系数据。 |
|AddSerieData()||public virtual void AddSerieData(SerieData serieData)|
|AddXYData()||public SerieData AddXYData(double xValue, double yValue, string dataName = null, string dataId = null)<br/>添加xy数据到维度X和维度Y |
|AddYData()||public SerieData AddYData(double value, string dataName = null, string dataId = null)<br/>添加一个数据到维度Y此时维度X对应的数据是索引 |
|AnimationEnable()||public void AnimationEnable(bool flag)<br/>启用或取消初始动画 |
@@ -2258,6 +2494,7 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|ClearData()||public override void ClearData()<br/>清空所有数据 |
|ClearDirty()||public override void ClearDirty()|
|ClearHighlight()||public void ClearHighlight()<br/>清除所有数据的高亮标志 |
|ClearLinks()||public void ClearLinks()<br/>清空所有Link数据 |
|ClearSerieNameDirty()||public void ClearSerieNameDirty()|
|ClearVerticesDirty()||public override void ClearVerticesDirty()|
|Clone()||public Serie Clone()|
@@ -2265,7 +2502,7 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|CompareTo()||public int CompareTo(object obj)|
|EnsureComponent()||public ISerieComponent EnsureComponent(Type type)|
|EnsureComponent&lt;T&gt;()||public T EnsureComponent&lt;T&gt;() where T : ChildComponent, ISerieComponent<br/>确保系列有该组件。如果没有,则添加。 |
|GetBarWidth()||public float GetBarWidth(float categoryWidth, int barCount = 0)|
|GetBarWidth()||public float GetBarWidth(float categoryWidth, int barCount = 0, float defaultRate = 0.6f)|
|GetComponent()||public ISerieComponent GetComponent(Type type)|
|GetComponent&lt;T&gt;()||public T GetComponent&lt;T&gt;() where T : ChildComponent, ISerieComponent|
|GetData()||public double GetData(int index, int dimension, DataZoom dataZoom = null)<br/>获得指定index指定维数的数据 |
@@ -2284,6 +2521,9 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|IsIgnoreValue()||public bool IsIgnoreValue(SerieData serieData, double value)|
|IsIgnoreValue()||public bool IsIgnoreValue(SerieData serieData, int dimension = 1)|
|IsLegendName()||public bool IsLegendName(string legendName)|
|IsMinShowLabelValue()||public bool IsMinShowLabelValue(double value)|
|IsMinShowLabelValue()||public bool IsMinShowLabelValue(int index, int dimension = 1)|
|IsMinShowLabelValue()||public bool IsMinShowLabelValue(SerieData serieData, int dimension = 1)|
|IsPerformanceMode()||public bool IsPerformanceMode()<br/>是否为性能模式。性能模式下不绘制Symbol不刷新Label不单独设置数据项配置。 |
|IsSerie&lt;T&gt;()||public bool IsSerie&lt;T&gt;() where T : Serie|
|IsSerieDataLegendName()||public bool IsSerieDataLegendName(string legendName)|
@@ -2435,6 +2675,14 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|SerieDataExtraFieldAttribute()||public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)|
|SerieDataExtraFieldAttribute()||public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)|
## SerieDataLink
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.10.0` 开始支持
数据节点之间的连线。可用于桑基图等,桑基图只支持有向无环图,请保证数据的连线是有向无环图。
## SerieEventData
> class in XCharts.Runtime
@@ -2472,6 +2720,7 @@ serie事件的数据。
|ForceUpdateSerieContext()||public virtual void ForceUpdateSerieContext() { }|
|InitComponent()||public virtual void InitComponent() { }|
|OnBeginDrag()||public virtual void OnBeginDrag(PointerEventData eventData) { }|
|OnDataUpdate()||public virtual void OnDataUpdate() { }|
|OnDrag()||public virtual void OnDrag(PointerEventData eventData) { }|
|OnEndDrag()||public virtual void OnEndDrag(PointerEventData eventData) { }|
|OnLegendButtonClick()||public virtual void OnLegendButtonClick(int index, string legendName, bool show) { }|
@@ -2674,6 +2923,7 @@ serie事件的数据。
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
简化柱状图是柱状图的简化模式,通过简化组件和配置,拥有更好的性能。
## SimplifiedCandlestick
@@ -2689,6 +2939,7 @@ serie事件的数据。
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
简化K线图是K线图的简化模式通过简化组件和配置拥有更好的性能。
## SimplifiedLine
@@ -2704,6 +2955,7 @@ serie事件的数据。
> class in XCharts.Runtime / 继承自: [BaseChart](#basechart)
简化折线图是折线图的简化模式,通过简化组件和配置,拥有更好的性能。
## Since
@@ -2773,11 +3025,6 @@ Serie的状态样式。Serie的状态有正常高亮淡出选中四种
|DrawPath()||public static void DrawPath(VertexHelper vh, SVGPath path)|
|Test()||public static void Test(VertexHelper vh)|
## SVGImage
> class in XCharts.Runtime / 继承自: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
## SVGPath
> class in XUGL
@@ -2925,6 +3172,7 @@ Serie的状态样式。Serie的状态有正常高亮淡出选中四种
|API|版本|描述|
|--|--|--|
|onClickIndex||public System.Action&lt;int&gt; onClickIndex<br/>Tooltip为Click触发时点击的X轴索引的回调。 |
|AddSerieDataIndex()||public void AddSerieDataIndex(int serieIndex, int dataIndex)|
|ClearComponentDirty()||public override void ClearComponentDirty()|
|ClearData()||public override void ClearData()|
@@ -3050,6 +3298,7 @@ UGUI 图形库
|IsClearColor()||public static bool IsClearColor(Color32 color)|
|IsPointInPolygon()||public static bool IsPointInPolygon(Vector3 p, List&lt;Vector2&gt; polyons)|
|IsPointInPolygon()||public static bool IsPointInPolygon(Vector3 p, List&lt;Vector3&gt; polyons)|
|IsPointInPolygon()||public static bool IsPointInPolygon(Vector3 p, params Vector3[] polyons)|
|IsPointInTriangle()||public static bool IsPointInTriangle(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 check)|
|IsValueEqualsColor()||public static bool IsValueEqualsColor(Color color1, Color color2)|
|IsValueEqualsColor()||public static bool IsValueEqualsColor(Color32 color1, Color32 color2)|
@@ -3079,15 +3328,23 @@ UI组件基类。
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
|API|版本|描述|
|--|--|--|
|GetBackgroundColor()||public Color32 GetBackgroundColor(Background background)|
## UIHelper
> class in XCharts.Runtime
UI帮助类。
|API|版本|描述|
|--|--|--|
|GetBackgroundColor()||public static Color32 GetBackgroundColor(UIComponent component)|
## ViewControl
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.11.0` 开始支持
3D视角控制组件。
## VisualMap
@@ -3102,6 +3359,7 @@ UI帮助类。
|ClearComponentDirty()||public override void ClearComponentDirty()|
|ClearVerticesDirty()||public override void ClearVerticesDirty()|
|GetColor()||public Color32 GetColor(double value)|
|GetColor()||public Color32 GetColor(double xValue, double yValue, double zValue, byte alpha = 255)|
|GetIndex()||public int GetIndex(double value)|
|GetValue()||public double GetValue(Vector3 pos, Rect chartRect)|
|IsInRangeMaxRect()||public bool IsInRangeMaxRect(Vector3 local, Rect chartRect, float triangleLen)|
@@ -3149,6 +3407,11 @@ UI帮助类。
|Copy()||public void Copy(VisualMapTheme theme)|
|VisualMapTheme()||public VisualMapTheme(ThemeType theme) : base(theme)|
## Wrapper&lt;T&gt;
> class in XCharts.Runtime
## XAxis
> class in XCharts.Runtime / 继承自: [Axis](#axis)
@@ -3159,6 +3422,18 @@ UI帮助类。
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>直角坐标系 grid 中的 x 轴。 |
## XAxis3D
> class in XCharts.Runtime / 继承自: [Axis](#axis)
> 从 `v3.11.0` 开始支持
直角坐标系 grid 中的 x 轴。
|API|版本|描述|
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>直角坐标系 grid 中的 x 轴。 |
## XChartsMgr
> class in XCharts.Runtime
@@ -3264,3 +3539,27 @@ UI帮助类。
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>直角坐标系 grid 中的 y 轴。 |
## YAxis3D
> class in XCharts.Runtime / 继承自: [Axis](#axis)
> 从 `v3.11.0` 开始支持
直角坐标系 grid 中的 y 轴。
|API|版本|描述|
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>直角坐标系 grid 中的 y 轴。 |
## ZAxis3D
> class in XCharts.Runtime / 继承自: [Axis](#axis)
> 从 `v3.11.0` 开始支持
直角坐标系 grid 中的 y 轴。
|API|版本|描述|
|--|--|--|
|SetDefaultValue()||public override void SetDefaultValue()<br/>直角坐标系 grid 中的 y 轴。 |

View File

@@ -6,6 +6,10 @@ slug: /changelog
# 更新日志
[master](#master)
[v3.11.0](#v3110)
[v3.10.2](#v3102)
[v3.10.1](#v3101)
[v3.10.0](#v3100)
[v3.9.0](#v390)
[v3.8.1](#v381)
[v3.8.0](#v380)
@@ -70,6 +74,94 @@ slug: /changelog
## master
## v3.11.0
版本要点:
* 增加`Line3DChart`3D折线图
* 增加`GraphChart`关系图
* 增加`3D`坐标系支持
* 增加`Tooltip``triggerOn`设置触发条件
* 其他问题修复和优化
日志详情:
* (2024.06.16) 发布`v3.11.0`版本
* (2024.06.15) 增加`Editor``Data`的添加、删除、上下移动操作按钮
* (2024.06.11) 修复`Axis``IndicatorLabel`可能会遮挡住`Tooltip`的问题
* (2024.06.11) 修复`Tooltip``Cross``Axis``IndicatorLabel`可能不显示的问题 (#315)
* (2024.06.10) 调整`Tooltip``Corss`重命名为`Cross`
* (2024.06.09) 增加`Axis``minCategorySpacing`设置类目轴默认的最小类目间距
* (2024.06.09) 修复`Tooltip``Cross``Axis`是类目轴并且开启`DataZoom`的情况下指示位置不准确的问题
* (2024.06.06) 修复`Serie``Clone`时动画异常问题 (#320)
* (2024.06.04) 修复`Serie``state`在代码动态设置时不刷新的问题
* (2024.05.29) 调整`XCharts``Hierarchy`视图下的右键菜单到`UI/XCharts`
* (2024.05.29) 增加`3D`坐标系对类目轴的支持
* (2024.05.19) 优化`Editor`下的编辑性能
* (2024.05.09) 增加`JsonUtil`工具类
* (2024.05.01) 修复`Tooltip`每帧产生GC的问题 (#311) (by @stefanbursuc)
* (2024.04.23) 修复`ConvertXYAxis()`多次调用后图表异常的问题
* (2024.04.22) 修复`DataZoom`控制多个轴时的`GridCoord`获取可能不正确的问题 (#317)
* (2024.04.22) 增加`3D`坐标系
* (2024.04.15) 优化`DateTimeUtil`时间戳转`DateTime`接口时区的问题
* (2024.04.15) 优化`GridCoord`在开启`GridLayout`时也显示`Left` `Right` `Top` `Bottom`参数 (#316)
* (2024.04.14) 修复`Tooltip``Cross`在开启`DataZoom`的情况下`label`位置不正确的问题 (#315)
* (2024.04.12) 修复`Candlesticks`效果不对的问题 (#313)
* (2024.03.20) 增加`Tooltip``triggerOn`设置触发条件
* (2024.03.19) 修复`Pie`在设置`ItemStyle``opacity`时颜色不对的问题 (#309)
## v3.10.2
* (2024.03.11) 发布`v3.10.2`版本
* (2024.03.11) 修复`Legend``formatter`在设置`{d}`通配符时显示可能不匹配的问题 (#304)
* (2024.03.11) 修复`Tooltip`移出坐标系后还显示的问题
* (2024.03.08) 修复`Tooltip``title`从旧版本升级后可能不显示的问题
## v3.10.1
* (2024.02.21) 发布`v3.10.1`版本
* (2024.02.19) 修复`Tooltip`的圆点标记不会自适应颜色的问题
## v3.10.0
版本要点:
* 增加双类目轴支持
* 增加更多细分快捷菜单创建图表,可一键创建几十种图表
* 增加图表边框设置,支持圆角图表
* 修复若干问题
扩展功能:
* 增加`SankeyChart`桑基图
* 增加`UITable`的边框设置
日志详情:
* (2024.02.01) 发布`v3.10.0`版本
* (2024.01.31) 修复`Tooltip`在设置`itemFormatter``-`后整个不显示的问题
* (2024.01.27) 修复`TextLimit`在开启`TextMeshPro`后无效的问题 (#301)
* (2024.01.24) 增加`Bar`支持X轴和Y轴都为`Category`类目轴
* (2024.01.23) 增加`{y}`通配符用于获取Y轴的类目名
* (2024.01.23) 增加`Line`支持X轴和Y轴都为`Category`类目轴
* (2024.01.18) 修复`Animation``type`代码动态修改无效的问题
* (2024.01.13) 增加`Chart`的更多快捷创建图表菜单
* (2024.01.09) 增加`Background``borderStyle`,给图表默认设置圆角
* (2024.01.07) 修复`Tooltop`的第一个`ContentLabelStyle`设置`color`无效的问题
* (2024.01.01) 增加`BorderStyle`边框样式
* (2023.12.26) 增加`Heatmap``maxCache`参数支持
* (2023.12.25) 优化`Line`开启`clip`时绘制的顶点数
* (2023.12.22) 修复`Scatter`散点图部分边界数据不显示的问题
* (2023.12.21) 修复`TriggerTooltip()`接口在指定0或最大index时可能无法触发的问题
* (2023.12.19) 修复`Legend``LabelStyle`设置`formatter`后不生效的问题
* (2023.12.12) 增加`Legend``TextLimit`可限制图例显示文本的长度
* (2023.12.11) 修复`Serie`添加`double.MaxValue`时坐标绘制失败的问题
* (2023.12.10) 增加`Serie``minShowLabel`可隐藏小于指定值的`label`
* (2023.12.09) 增加`LevelStyle``depth`指定所属层次
* (2023.12.09) 增加`LevelStyle``LineStyle`设置线条样式
* (2023.12.09) 增加`Serie``Link`可用于桑基图添加节点边关系
* (2023.12.05) 增加`ResetChartStatus()`可主动重置图表状态
## v3.9.0
版本要点:
@@ -88,6 +180,7 @@ slug: /changelog
日志详情:
* (2023.12.01) 发布`v3.9.0`版本
* (2023.12.01) 修复`Tooltip``titleFormatter`设置为`{b}`后显示不准确的问题
* (2023.11.30) 增加`SerieData`可单独添加`Label`的支持
* (2023.11.28) 修复`Tooltip`在对数轴时指示不准确的问题
@@ -149,7 +242,7 @@ slug: /changelog
* (2023.08.22) 修复`Bar`显示隐藏时绘制表现异常的问题
* (2023.08.22) 优化`Zebra`斑马柱图的绘制表现 (#276)
* (2023.08.16) 增加`Daemon`守护程序解决本地开启TMP后更新版本报错问题
* (2023.08.15) 修复`Data`数据在-1到1之间时坐标轴显示错误的问题 (#273) (by **Ambitroc**)
* (2023.08.15) 修复`Data`数据在-1到1之间时坐标轴显示错误的问题 (#273) (by @Ambitroc)
* (2023.08.14) 修复`XCharts`本地开启`TextMeshPro``NewInputSystem`后更新版本会报错的问题 (#272)
* (2023.08.12) 修复`Chart`在运行时被删除时会异常报错的问题 (#269)
* (2023.08.11) 修复`DataZoom`开启时可能会导致无法添加数据的问题
@@ -190,7 +283,7 @@ slug: /changelog
* (2023.06.08) 发布`v3.7.0`版本
* (2023.06.04) 增加`HelpDoc`帮助文档跳转
* (2023.05.30) 修复`Serie`的名字带`_`线导致`Legend`无法触发的问题 (#259) (by **svr2kos2**)
* (2023.05.30) 修复`Serie`的名字带`_`线导致`Legend`无法触发的问题 (#259) (by @svr2kos2)
* (2023.05.10) 增加`Axis``MinMaxAuto`范围类型
* (2023.05.10) 增加`Line``Clip`的支持
* (2023.05.04) 优化`Axis`在-1到1范围时设置`CeilRate`不生效的问题
@@ -209,9 +302,9 @@ slug: /changelog
版本要点:
* 增加`InputSystem`支持 (by **Bian-Sh**)
* 增加官网[在线示例](https://xcharts-team.github.io/examples/)多版本支持 (by **SHL-COOL**)
* 完善对`VR`的支持 (by **Ambitroc**)
* 增加`InputSystem`支持 (by @Bian-Sh)
* 增加官网[在线示例](https://xcharts-team.github.io/examples/)多版本支持 (by @SHL-COOL)
* 完善对`VR`的支持 (by @Ambitroc)
* 增加`UITable``UIStatistic`等[扩展UI组件](https://xcharts-team.github.io/docs/ui)
* 增加`ItemStyle``MarkColor`
* 增加通配符`{h}`的支持
@@ -227,9 +320,9 @@ slug: /changelog
* (2023.04.01) 发布`v3.6.0`版本
* (2023.03.14) 修复`Tooltip``titleFormater`设置`{b}`可能不生效的问题
* (2023.03.14) 修复`BarChart`在数据为0时不绘制柱条背景的问题 (#250) (by **Ambitroc**)
* (2023.03.14) 修复`BarChart`在数据为0时不绘制柱条背景的问题 (#250) (by @Ambitroc)
* (2023.03.12) 增加`LabelStyle``autoRotate`可设置有角度的竖版文本的自动旋转
* (2023.03.10) 增加`VR`等其他非鼠标输入方式的Point位置获取 (#248) (by **Ambitroc**)
* (2023.03.10) 增加`VR`等其他非鼠标输入方式的Point位置获取 (#248) (by @Ambitroc)
* (2023.03.09) 增加`Chart``onSerieClick``onSerieDown``onSerieEnter``onSerieExit`回调
* (2023.03.09) 修复`Pie`的点击选中偏移不生效的问题
* (2023.03.04) 增加`Legend``Positions`可自定义图例的位置
@@ -243,7 +336,7 @@ slug: /changelog
* (2023.02.02) 修复`DataZoom`开启时`X轴``Label`可能会显示在图表外的问题
* (2023.02.02) 优化`SerieData``ignore`设置时的忽略数据判断
* (2023.02.01) 修复`XChartsMgr.ContainsChart()`接口异常
* (2023.01.31) 增加`InputSystem`的支持 (#242) (by **Bian-Sh**)
* (2023.01.31) 增加`InputSystem`的支持 (#242) (by @Bian-Sh)
* (2023.01.11) 修复`Inspector`上移除`Component`后图表没有及时刷新的问题 (#241)
* (2023.01.06) 修复`Pie`在最后的几个数据都为0时`Label`显示不正常的问题 (#240)
* (2023.01.03) 删除`Serie``MarkColor`,增加`ItemStyle``MarkColor`

View File

@@ -56,6 +56,7 @@ import APITable from '@site/src/components/APITable';
- [CoordSystem](#coordsystem)
- [DataZoom](#datazoom)
- [GridCoord](#gridcoord)
- [GridCoord3D](#gridcoord3d)
- [GridLayout](#gridlayout)
- [Legend](#legend)
- [MarkArea](#markarea)
@@ -72,7 +73,10 @@ import APITable from '@site/src/components/APITable';
- [Tooltip](#tooltip)
- [VisualMap](#visualmap)
- [XAxis](#xaxis)
- [XAxis3D](#xaxis3d)
- [YAxis](#yaxis)
- [YAxis3D](#yaxis3d)
- [ZAxis3D](#zaxis3d)
## ChildComponent 子组件
@@ -94,6 +98,7 @@ import APITable from '@site/src/components/APITable';
- [BaseAxisTheme](#baseaxistheme)
- [BaseLine](#baseline)
- [BlurStyle](#blurstyle)
- [BorderStyle](#borderstyle)
- [CommentItem](#commentitem)
- [CommentMarkStyle](#commentmarkstyle)
- [ComponentTheme](#componenttheme)
@@ -121,6 +126,7 @@ import APITable from '@site/src/components/APITable';
- [RadiusAxisTheme](#radiusaxistheme)
- [SelectStyle](#selectstyle)
- [SerieData](#seriedata)
- [SerieDataLink](#seriedatalink)
- [SerieSymbol](#seriesymbol)
- [SerieTheme](#serietheme)
- [StageColor](#stagecolor)
@@ -135,6 +141,7 @@ import APITable from '@site/src/components/APITable';
- [TitleTheme](#titletheme)
- [TooltipTheme](#tooltiptheme)
- [UIComponentTheme](#uicomponenttheme)
- [ViewControl](#viewcontrol)
- [VisualMapRange](#visualmaprange)
- [VisualMapTheme](#visualmaptheme)
@@ -192,6 +199,7 @@ import APITable from '@site/src/components/APITable';
- [LangCandlestick](#langcandlestick)
- [LangTime](#langtime)
- [MainComponent](#maincomponent)
- [Wrapper&lt;T&gt;](#wrappert)
- [XCResourcesImporter](#xcresourcesimporter)
- [XCSettings](#xcsettings)
@@ -377,7 +385,7 @@ import APITable from '@site/src/components/APITable';
## Axis
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [AngleAxis](#angleaxis), [ParallelAxis](#parallelaxis), [RadiusAxis](#radiusaxis), [SingleAxis](#singleaxis), [XAxis](#xaxis), [YAxis](#yaxis)
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [AngleAxis](#angleaxis), [ParallelAxis](#parallelaxis), [RadiusAxis](#radiusaxis), [SingleAxis](#singleaxis), [XAxis](#xaxis), [XAxis3D](#xaxis3d), [YAxis](#yaxis), [YAxis3D](#yaxis3d), [ZAxis3D](#zaxis3d)
直角坐标系的坐标轴组件。
@@ -393,7 +401,7 @@ import APITable from '@site/src/components/APITable';
|gridIndex|||坐标轴所在的 grid 的索引,默认位于第一个 grid。
|polarIndex|||坐标轴所在的 ploar 的索引,默认位于第一个 polar。
|parallelIndex|||坐标轴所在的 parallel 的索引,默认位于第一个 parallel。
|position|||坐标轴在Grid中的位置。<br/>`Axis.AxisPosition`:<br/>- `Left`: 坐标轴在Grid中的位置<br/>- `Right`: 坐标轴在Grid中的位置<br/>- `Bottom`: 坐标轴在Grid中的位置<br/>- `Top`: 坐标轴在Grid中的位置<br/>|
|position|||坐标轴在Grid中的位置。<br/>`Axis.AxisPosition`:<br/>- `Left`: 坐标轴在Grid中的位置<br/>- `Right`: 坐标轴在Grid中的位置<br/>- `Bottom`: 坐标轴在Grid中的位置<br/>- `Top`: 坐标轴在Grid中的位置<br/>- `Center`: 坐标轴在Grid中的位置<br/>|
|offset|||坐标轴相对默认位置的偏移。在相同position有多个坐标轴时有用。
|min|||设定的坐标轴刻度最小值当minMaxType为Custom时有效。
|max|||设定的坐标轴刻度最大值当minMaxType为Custom时有效。
@@ -407,6 +415,7 @@ import APITable from '@site/src/components/APITable';
|inverse|false||是否反向坐标轴。在类目轴中无效。
|clockwise|true||刻度增长是否按顺时针,默认顺时针。
|insertDataToHead|||添加新数据时是在列表的头部还是尾部加入。
|minCategorySpacing|0|v3.11.0|类目之间的最小间距。
|icons|||类目数据对应的图标。
|data|||类目数据在类目轴type: 'category')中有效。
|axisLine|||坐标轴轴线。 [AxisLine](#axisline)|
@@ -589,6 +598,7 @@ import APITable from '@site/src/components/APITable';
|autoColor|||自动设置颜色。
|showStartLine|true|v3.3.0|是否显示第一条分割线。
|showEndLine|true|v3.3.0|是否显示最后一条分割线。
|showZLine|true|v3.11.0|是否显示Z轴部分分割线。一般用于3D坐标系。
```mdx-code-block
</APITable>
@@ -638,7 +648,10 @@ import APITable from '@site/src/components/APITable';
|image|||背景图。
|imageType|||背景图填充类型。
|imageColor|||背景图颜色。
|imageWidth|0|v3.10.0|背景图宽度。
|imageHeight|0|v3.10.0|背景图高度。
|autoColor|true||当background组件开启时是否自动使用主题背景色作为backgrounnd组件的颜色。当设置为false时用imageColor作为颜色。
|borderStyle||v3.10.0|背景边框样式。 [BorderStyle](#borderstyle)|
```mdx-code-block
</APITable>
@@ -711,6 +724,30 @@ import APITable from '@site/src/components/APITable';
淡出状态样式。
## BorderStyle
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.10.0` 开始支持
边框样式。
```mdx-code-block
<APITable name="BorderStyle">
```
|参数|默认|版本|描述|
|--|--|--|--|
|show|false||是否显示边框。
|borderWidth|||边框宽度。
|borderColor|||边框颜色。
|roundedCorner|true||是否显示圆角。
|cornerRadius|||圆角半径。用数组分别指定4个圆角半径顺时针左上右上右下左下。当为(1,1,1,1)时为全圆角。
```mdx-code-block
</APITable>
```
## CalendarCoord
> class in XCharts.Runtime / 继承自: [CoordSystem](#coordsystem), [IUpdateRuntimeData](#iupdateruntimedata), [ISerieContainer](#iseriecontainer)
@@ -725,7 +762,7 @@ import APITable from '@site/src/components/APITable';
## ChildComponent
> class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle)
> class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle)
## Comment
@@ -812,7 +849,7 @@ import APITable from '@site/src/components/APITable';
## CoordSystem
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord), [SingleAxisCoord](#singleaxiscoord)
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) / 子类: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridCoord3D](#gridcoord3d), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord), [SingleAxisCoord](#singleaxiscoord)
坐标系系统。
@@ -951,10 +988,10 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|--|--|--|--|
|show|true||是否显示直角坐标系网格。
|layoutIndex|-1|v3.8.0|网格所属的网格布局组件的索引。默认为-1表示不属于任何网格布局组件。当设置了该值时left、right、top、bottom属性将失效。
|left|0.1f||grid 组件离容器左侧的距离。
|left|0.11f||grid 组件离容器左侧的距离。
|right|0.08f||grid 组件离容器右侧的距离。
|top|0.22f||grid 组件离容器上侧的距离。
|bottom|0.12f||grid 组件离容器下侧的距离。
|bottom|0.14f||grid 组件离容器下侧的距离。
|backgroundColor|||网格背景色,默认透明。
|showBorder|false||是否显示网格边框。
|borderWidth|0f||网格边框宽。
@@ -964,6 +1001,36 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
</APITable>
```
## GridCoord3D
> class in XCharts.Runtime / 继承自: [CoordSystem](#coordsystem), [IUpdateRuntimeData](#iupdateruntimedata), [ISerieContainer](#iseriecontainer)
> 从 `v3.11.0` 开始支持
Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart can be drawn in grid.
```mdx-code-block
<APITable name="GridCoord3D">
```
|参数|默认|版本|描述|
|--|--|--|--|
|show|true||是否显示直角坐标系网格。
|left|0.15f||grid 组件离容器左侧的距离。
|right|0.2f||grid 组件离容器右侧的距离。
|top|0.3f||grid 组件离容器上侧的距离。
|bottom|0.15f||grid 组件离容器下侧的距离。
|showBorder|false||是否显示网格边框。
|boxWidth|0.55f||坐标系的宽度。
|boxHeight|0.4f||坐标系的高度。
|boxDepth|0.2f||坐标系的深度。
|xYExchanged|false||
|viewControl|||3D视角控制组件。 [ViewControl](#viewcontrol)|
```mdx-code-block
</APITable>
```
## GridLayout
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent), [IUpdateRuntimeData](#iupdateruntimedata)
@@ -1114,7 +1181,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
## ISerieContainer
> class in XCharts.Runtime / 子类: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord)
> class in XCharts.Runtime / 子类: [RadarCoord](#radarcoord), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridCoord3D](#gridcoord3d), [ParallelCoord](#parallelcoord), [PolarCoord](#polarcoord)
## ISerieDataComponent
@@ -1165,7 +1232,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
## IUpdateRuntimeData
> class in XCharts.Runtime / 子类: [SingleAxis](#singleaxis), [DataZoom](#datazoom), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridLayout](#gridlayout), [ParallelCoord](#parallelcoord)
> class in XCharts.Runtime / 子类: [SingleAxis](#singleaxis), [DataZoom](#datazoom), [CalendarCoord](#calendarcoord), [GridCoord](#gridcoord), [GridLayout](#gridlayout), [GridCoord3D](#gridcoord3d), [ParallelCoord](#parallelcoord)
## LabelLine
@@ -1214,7 +1281,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|rotate|||文本的旋转。
|autoRotate|false|v3.6.0|是否自动旋转。
|distance|||距离轴线的距离。
|formatter|||标签内容字符串模版格式器。支持用 \n 换行。部分组件的格式器会不生效。<br/> 模板通配符有以下这些,部分只适用于固定的组件:<br/> `{.}`:圆点标记。<br/> `{a}`:系列名。<br/> `{b}`:类目或数据名。<br/> `{c}`:数据值。<br/> `{d}`:百分比。<br/> `{e}`:数据名。<br/> `{f}`:数据和。<br/> `{g}`:数据总个数。<br/> `{h}`:十六进制颜色值。<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}”
|formatter|||标签内容字符串模版格式器。支持用 \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}”
|numericFormatter|||标准数字和日期格式字符串。用于将Double数值或DateTime日期格式化显示为字符串。numericFormatter用来作为Double.ToString()或DateTime.ToString()的参数。<br/> 数字格式使用Axx的形式A是格式说明符的单字符支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明从0-99。如F1, E2<br/> 日期格式常见的格式yyyy年MM月dd日HH时mm分ss秒fff毫秒。如yyyy-MM-dd HH:mm:ss<br/> 数值格式化参考https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings <br/> 日期格式化参考https://learn.microsoft.com/zh-cn/dotnet/standard/base-types/standard-date-and-time-format-strings
|width|0||标签的宽度。一般不用指定,不指定时则自动是文字的宽度。
|height|0||标签的高度。一般不用指定,不指定时则自动是文字的高度。
@@ -1265,6 +1332,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|itemOpacity|1||图例标记的图形的颜色透明度。
|formatter|||不再使用使用LabelStyle.formatter代替。
|labelStyle|||文本样式。 [LabelStyle](#labelstyle)|
|textLimit||v3.10.0|文本限制。 [TextLimit](#textlimit)|
|data|||图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 name如果是饼图也可以是饼图单个数据的 name。 如果 data 没有被指定会自动从当前系列中获取。指定data时里面的数据项和serie匹配时才会生效。
|icons|||自定义的图例标记图形。
|colors|||图例标记的颜色列表。
@@ -1302,8 +1370,10 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
|参数|默认|版本|描述|
|--|--|--|--|
|depth|0|v3.10.0|层级深度。
|label|||文本标签样式。 [LabelStyle](#labelstyle)|
|upperLabel|||上方的文本标签样式。 [LabelStyle](#labelstyle)|
|lineStyle||v3.10.0|线条样式。 [LineStyle](#linestyle)|
|itemStyle|||数据项样式。 [ItemStyle](#itemstyle)|
```mdx-code-block
@@ -1314,6 +1384,8 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.10.0` 开始支持
```mdx-code-block
<APITable name="LevelStyle">
```
@@ -1756,6 +1828,8 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|center|||中心点。
|radius|||半径。radius[0]表示内径radius[1]表示外径。
|minRadius|0f|v3.8.0|最小半径。可用于限制玫瑰图的最小半径。
|minShowLabel|false|v3.10.0|是否开启值小于指定值`minShowLabelValue`时不显示标签。
|minShowLabelValue|0|v3.10.0|当开启`minShowLabel`时,值小于该值时不显示标签。
|showDataDimension|||数据项里的数据维数。
|showDataName|||在Editor的inpsector上是否显示name参数
|clip|false||是否裁剪超出坐标系部分的图形。
@@ -1781,6 +1855,7 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
|animation|||起始动画。 [AnimationStyle](#animationstyle)|
|itemStyle|||图形样式。 [ItemStyle](#itemstyle)|
|data|||系列中的数据内容数组。SerieData可以设置1到n维数据。
|links|||数据节点的边。
```mdx-code-block
</APITable>
@@ -1812,6 +1887,28 @@ Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适
</APITable>
```
## SerieDataLink
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.10.0` 开始支持
数据节点之间的连线。可用于桑基图等,桑基图只支持有向无环图,请保证数据的连线是有向无环图。
```mdx-code-block
<APITable name="SerieDataLink">
```
|参数|默认|版本|描述|
|--|--|--|--|
|source|||边的源节点名称。
|target|||边的目标节点名称。
|value|||边的值。决定边的宽度。
```mdx-code-block
</APITable>
```
## SerieSymbol
> class in XCharts.Runtime / 继承自: [SymbolStyle](#symbolstyle), [ISerieDataComponent](#iseriedatacomponent)
@@ -2170,11 +2267,12 @@ Serie的状态样式。Serie的状态有正常高亮淡出选中四种
|参数|默认|版本|描述|
|--|--|--|--|
|show|true||是否显示提示框组件。
|type|||提示框指示器类型。<br/>`Tooltip.Type`:<br/>- `Line`: 直线指示器<br/>- `Shadow`: 阴影指示器<br/>- `None`: 无指示器<br/>- `Corss`: 十字准星指示器。坐标轴显示Label和交叉线。<br/>- `Auto`: 根据serie的类型自动选择显示指示器。<br/>|
|type|||提示框指示器类型。<br/>`Tooltip.Type`:<br/>- `Line`: 直线指示器<br/>- `Shadow`: 阴影指示器<br/>- `None`: 无指示器<br/>- `Cross`: 十字准星指示器。坐标轴显示Label和交叉线。<br/>- `Auto`: 根据serie的类型自动选择显示指示器。<br/>|
|trigger|||触发类型。<br/>`Tooltip.Trigger`:<br/>- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。<br/>- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。<br/>- `None`: 什么都不触发。<br/>- `Auto`: 根据serie的类型自动选择触发类型。<br/>|
|triggerOn||v3.11.0|触发条件。<br/>`Tooltip.TriggerOn`:<br/>- `MouseMove`: 鼠标移动时触发。<br/>- `Click`: 鼠标点击时触发。<br/>|
|position||v3.3.0|显示位置类型。<br/>`Tooltip.Position`:<br/>- `Auto`: 自适应。移动平台靠顶部显示,非移动平台跟随鼠标位置。<br/>- `Custom`: 自定义。完全自定义显示位置(x,y)。<br/>- `FixedX`: 只固定坐标X。Y跟随鼠标位置。<br/>- `FixedY`: <br/>|
|itemFormatter|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用|来表示多个列的分隔。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。<br/> {i}或-表示忽略当前项。 {.}为当前所指示的serie或数据项的对应颜色的圆点。<br/> {a}为当前所指示的serie或数据项的系列名name。<br/> {b}为当前所指示的serie或数据项的数据项serieData的name或者类目值如折线图的X轴。<br/> {c}为当前所指示的serie或数据项的y维dimesion为1的数值。<br/> {d}为当前所指示的serie或数据项的y维dimesion为1百分比值注意不带%号。<br/> {e}为当前所指示的serie或数据项的数据项serieData的name。<br/> {f}为当前所指示的serie的默认维度的数据总和。<br/> {g}为当前所指示的serie的数据总个数。<br/> {h}为当前所指示的serie的十六进制颜色值。<br/> {c0}表示当前数据项维度为0的数据。<br/> {c1}表示当前数据项维度为1的数据。<br/> {d3}表示维度3的数据的百分比。它的分母是默认维度一般是1维度数据。<br/> |表示多个列的分隔。<br/> 示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}"
|titleFormatter|||提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。<br/> {.}为当前所指示或index为0的serie的对应颜色的圆点。<br/> {a}为当前所指示或index为0的serie的系列名name。<br/> {b}为当前所指示或index为0的serie的数据项serieData的name或者类目值如折线图的X轴。<br/> {c}为当前所指示或index为0的serie的y维dimesion为1的数值。<br/> {d}为当前所指示或index为0的serie的y维dimesion为1百分比值注意不带%号。<br/> {e}为当前所指示或index为0的serie的数据项serieData的name。<br/> {h}为当前所指示或index为0的serie的数据项serieData的十六进制颜色值。<br/> {f}为数据总和。<br/> {g}为数据总个数。<br/> {.1}表示指定index为1的serie对应颜色的圆点。<br/> {a1}、{b1}、{c1}中的1表示指定index为1的serie。<br/> {c1:2}表示索引为1的serie的当前指示数据项的第3个数据一个数据项有多个数据index为2表示第3个数据。<br/> {c1:2-2}表示索引为1的serie的第3个数据项的第3个数据也就是要指定第几个数据项时必须要指定第几个数据。<br/> {d1:2:f2}表示单独指定了数值的格式化字符串为f2不指定时用numericFormatter。<br/> {d:0.##} 表示单独指定了数值的格式化字符串为 0.## 用于百分比保留2位有效数同时又能避免使用 f2 而出现的类似于"100.00%"的情况 )。<br/> 示例:"{a}:{c}"、"{a1}:{c1:f1}"、"{a1}:{c1:0:f1}"、"{a1}:{c1:1-1:f1}"
|itemFormatter|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用|来表示多个列的分隔。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。<br/> {i}或-表示忽略当前项。 {.}为当前所指示的serie或数据项的对应颜色的圆点。<br/> {a}为当前所指示的serie或数据项的系列名name。<br/> {b}为当前所指示的serie或数据项的数据项serieData的name或者类目值如折线图的X轴。<br/> {c}为当前所指示的serie或数据项的y维dimesion为1的数值。<br/> {d}为当前所指示的serie或数据项的y维dimesion为1百分比值注意不带%号。<br/> {e}为当前所指示的serie或数据项的数据项serieData的name。<br/> {f}为当前所指示的serie的默认维度的数据总和。<br/> {g}为当前所指示的serie的数据总个数。<br/> {h}为当前所指示的serie的十六进制颜色值。<br/> {y}为当前所指示的serie的y轴的类目值。<br/> {c0}表示当前数据项维度为0的数据。<br/> {c1}表示当前数据项维度为1的数据。<br/> {d3}表示维度3的数据的百分比。它的分母是默认维度一般是1维度数据。<br/> |表示多个列的分隔。<br/> 示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}", "{.}|{b}|{y}"
|titleFormatter|||提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。<br/> {.}为当前所指示或index为0的serie的对应颜色的圆点。<br/> {a}为当前所指示或index为0的serie的系列名name。<br/> {b}为当前所指示或index为0的serie的数据项serieData的name或者类目值如折线图的X轴。<br/> {c}为当前所指示或index为0的serie的y维dimesion为1的数值。<br/> {d}为当前所指示或index为0的serie的y维dimesion为1百分比值注意不带%号。<br/> {e}为当前所指示或index为0的serie的数据项serieData的name。<br/> {h}为当前所指示或index为0的serie的数据项serieData的十六进制颜色值。<br/> {f}为数据总和。<br/> {g}为数据总个数。<br/> {y}为value所对应的y轴的类目值。<br/> {.1}表示指定index为1的serie对应颜色的圆点。<br/> {a1}、{b1}、{c1}中的1表示指定index为1的serie。<br/> {c1:2}表示索引为1的serie的当前指示数据项的第3个数据一个数据项有多个数据index为2表示第3个数据。<br/> {c1:2-2}表示索引为1的serie的第3个数据项的第3个数据也就是要指定第几个数据项时必须要指定第几个数据。<br/> {d1:2:f2}表示单独指定了数值的格式化字符串为f2不指定时用numericFormatter。<br/> {d:0.##} 表示单独指定了数值的格式化字符串为 0.## 用于百分比保留2位有效数同时又能避免使用 f2 而出现的类似于"100.00%"的情况 )。<br/> 示例:"{a}:{c}"、"{a1}:{c1:f1}"、"{a1}:{c1:0:f1}"、"{a1}:{c1:1-1:f1}"
|marker|||serie的符号标志。
|fixedWidth|0||固定宽度。比 minWidth 优先。
|fixedHeight|0||固定高度。比 minHeight 优先。
@@ -2244,6 +2342,27 @@ Serie的状态样式。Serie的状态有正常高亮淡出选中四种
</APITable>
```
## ViewControl
> class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent)
> 从 `v3.11.0` 开始支持
3D视角控制组件。
```mdx-code-block
<APITable name="ViewControl">
```
|参数|默认|版本|描述|
|--|--|--|--|
|alpha|90f||视角在x-z平面的角度。
|beta|55f||视角在y-z平面的角度。
```mdx-code-block
</APITable>
```
## VisualMap
> class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent)
@@ -2325,12 +2444,24 @@ Serie的状态样式。Serie的状态有正常高亮淡出选中四种
</APITable>
```
## Wrapper&lt;T&gt;
> class in XCharts.Runtime
## XAxis
> class in XCharts.Runtime / 继承自: [Axis](#axis)
直角坐标系 grid 中的 x 轴。
## XAxis3D
> class in XCharts.Runtime / 继承自: [Axis](#axis)
> 从 `v3.11.0` 开始支持
直角坐标系 grid 中的 x 轴。
## XCResourcesImporter
> class in XCharts.Runtime
@@ -2391,3 +2522,19 @@ Serie的状态样式。Serie的状态有正常高亮淡出选中四种
直角坐标系 grid 中的 y 轴。
## YAxis3D
> class in XCharts.Runtime / 继承自: [Axis](#axis)
> 从 `v3.11.0` 开始支持
直角坐标系 grid 中的 y 轴。
## ZAxis3D
> class in XCharts.Runtime / 继承自: [Axis](#axis)
> 从 `v3.11.0` 开始支持
直角坐标系 grid 中的 y 轴。

View File

@@ -5,161 +5,164 @@ slug: /faq
# 常见问题
[QA 1如何调整坐标轴与背景的边距](#如何调整坐标轴与背景的边距)
[QA 2如何让初始动画重新播放](#如何让初始动画重新播放)
[QA 3如何自定义折线图饼图的颜色](#如何自定义折线图饼图的颜色)
[QA 4如何给坐标轴上的文本加上单位](#如何给坐标轴上的文本加上单位)
[QA 5如何让柱形图的柱子堆叠显示](#如何让柱形图的柱子堆叠显示)
[QA 6如何让柱形图的柱子同柱但不重叠](#如何让柱形图的柱子同柱但不重叠)
[QA 7如何调整柱形图的柱子宽度和间距](#如何调整柱形图的柱子宽度和间距)
[QA 8如何调整柱形图单个柱子的颜色](#如何调整柱形图单个柱子的颜色)
[QA 9如何调整图表的对齐方式](#如何调整图表的对齐方式)
[QA 10可以显示超过1000以上的大数据吗](#可以显示超过1000以上的大数据吗)
[QA 11折线图可以画虚线、点线、点划线吗](#折线图可以画虚线点线点划线吗)
[QA 12如何限定Y轴的值范围](#如何限定Y轴的值范围)
[QA 13如何自定义数值轴刻度大小](#如何自定义数值轴刻度大小)
[QA 14如何在数据项顶上显示文本](#如何在数据项顶上显示文本)
[QA 15如何给数据项自定义图标](#如何给数据项自定义图标)
[QA 16锯齿太严重如何让图表更顺滑](#锯齿太严重如何让图表更顺滑)
[QA 17为什么鼠标移上图表 Tooltip 不显示?](#为什么鼠标移上图表Tooltip不显示)
[QA 18如何取消 Tooltip 的竖线?](#如何取消Tooltip的竖线)
[QA 19如何自定义 Tooltip 的显示内容?](#如何自定义Tooltip的显示内容)
[QA 20如何让Y轴显示多位小数?](#如何让Y轴显示多位小数)
[QA 21如何用代码动态更新数据](#如何用代码动态更新数据)
[QA 22如何显示图例为什么有时候图例无法显示](#如何显示图例为什么有时候图例无法显示)
[QA 23如何做成预设](#如何做成预设)
[QA 24如何在图表上画点画线等自定义内容](#如何在图表上画点画线等自定义内容)
[QA 25如何实现心电图类似的数据移动效果](#如何实现心电图类似的数据移动效果)
[QA 26如何使用背景组件有什么条件限制](#如何使用背景组件有什么条件限制)
[QA 27Mesh can not have more than 65000 vertices?](#Mesh_cannot_have_more_than_65000_vertices)
[QA 28为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了)
[QA 29如何修改Serie的Symbol的颜色?](#如何修改Serie的Symbol的颜色)
[QA 30导入或更新XCharts时TMP报错如何处理?](#导入或更新XCharts时TMP报错怎么办)
[QA 31支持空数据吗如何实现折线图断开的效果?](#支持空数据吗如何实现折线图断开的效果)
[FAQ 1如何调整坐标轴与背景的边距](#如何调整坐标轴与背景的边距)
[FAQ 2如何让初始动画重新播放](#如何让初始动画重新播放)
[FAQ 3如何自定义折线图饼图的颜色](#如何自定义折线图饼图的颜色)
[FAQ 4如何给坐标轴上的文本加上单位](#如何给坐标轴上的文本加上单位)
[FAQ 5如何让柱形图的柱子堆叠显示](#如何让柱形图的柱子堆叠显示)
[FAQ 6如何让柱形图的柱子同柱但不重叠](#如何让柱形图的柱子同柱但不重叠)
[FAQ 7如何调整柱形图的柱子宽度和间距](#如何调整柱形图的柱子宽度和间距)
[FAQ 8如何调整柱形图单个柱子的颜色](#如何调整柱形图单个柱子的颜色)
[FAQ 9如何调整图表的对齐方式](#如何调整图表的对齐方式)
[FAQ 10可以显示超过1000以上的大数据吗](#可以显示超过1000以上的大数据吗)
[FAQ 11折线图可以画虚线、点线、点划线吗](#折线图可以画虚线点线点划线吗)
[FAQ 12如何限定Y轴的值范围](#如何限定y轴的值范围)
[FAQ 13如何自定义数值轴刻度大小](#如何自定义数值轴刻度大小)
[FAQ 14如何在数据项顶上显示文本](#如何在数据项顶上显示文本)
[FAQ 15如何给数据项自定义图标](#如何给数据项自定义图标)
[FAQ 16锯齿太严重如何让图表更顺滑](#锯齿太严重如何让图表更顺滑)
[FAQ 17为什么鼠标移上图表Tooltip不显示](#为什么鼠标移上图表tooltip不显示)
[FAQ 18如何取消Tooltip的竖线](#如何取消tooltip的竖线)
[FAQ 19如何自定义Tooltip的显示内容](#如何自定义tooltip的显示内容)
[FAQ 20如何让y轴显示多位小数?](#如何让y轴显示多位小数)
[FAQ 21如何用代码动态更新数据](#如何用代码动态更新数据)
[FAQ 22如何显示图例为什么有时候图例无法显示](#如何显示图例为什么有时候图例无法显示)
[FAQ 23如何做成预设](#如何做成预设)
[FAQ 24如何在图表上画点画线等自定义内容](#如何在图表上画点画线等自定义内容)
[FAQ 25如何实现心电图类似的数据移动效果](#如何实现心电图类似的数据移动效果)
[FAQ 26如何使用背景组件有什么条件限制](#如何使用背景组件有什么条件限制)
[FAQ 27Mesh can not have more than 65000 vertices](#mesh_cannot_have_more_than_65000_vertices)
[FAQ 28为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了)
[FAQ 29如何修改serie的symbol的颜色?](#如何修改serie的symbol的颜色)
[FAQ 30导入或更新XCharts时TMP报错如何处理](#导入或更新xcharts时tmp报错怎么办)
[FAQ 31支持空数据吗如何实现折线图断开的效果?](#支持空数据吗如何实现折线图断开的效果)
[FAQ 322.x版本升级3.x版本时常见的问题有哪些](#xcharts2升级xcharts3时常见的问题有哪些)
[FAQ 33折线图如何两边不留空白而从0坐标开始显示](#折线图如何两边不留空白而从0坐标开始显示)
[FAQ 34如何设置部分Serie不显示Tooltip](#如何设置部分serie不显示tooltip)
## 如何调整坐标轴与背景的边距
答:调整`Grid`组件,可调整上下左右边距。
调整`Grid`组件,可调整上下左右边距。
## 如何让初始动画重新播放
答:调用`chart.AnimationReset()`接口。
调用`chart.AnimationReset()`接口。
## 如何自定义折线图饼图的颜色
答:通过`Theme``colorPalette`调整,或者部分`Serie`下的`LineStyle``ItemStyle`
通过`Theme``colorPalette`调整,或者部分`Serie`下的`LineStyle``ItemStyle`
## 如何给坐标轴上的文本加上单位
答:通过`formatter``numericFormatter`参数,在`Legend``Axis``AxisLabel``Tooltop``Serie``Label`都提供该参数的配置。
通过`formatter``numericFormatter`参数,在`Legend``Axis``AxisLabel``Tooltop``Serie``Label`都提供该参数的配置。
## 如何让柱形图的柱子堆叠显示
答:设置`Serie`下的`stack``stack`相同的`serie`会堆叠显示在一个柱子上。
设置`Serie`下的`stack``stack`相同的`serie`会堆叠显示在一个柱子上。
## 如何让柱形图的柱子同柱但不重叠
答:设置`Serie`下的`barGap``-1``stack`为空。
设置`Serie`下的`barGap``-1``stack`为空。
## 如何调整柱形图的柱子宽度和间距
答:调整`Serie`下的`barWidth``barGap`,多个`serie`时最后一个`serie``barWidth``barGap`有效。
调整`Serie`下的`barWidth``barGap`,多个`serie`时最后一个`serie``barWidth``barGap`有效。
## 如何调整柱形图单个柱子的颜色
答:可通过调整单个`Data`下的`ItemStyle`调整,也可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。
可通过调整单个`Data`下的`ItemStyle`调整,也可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。
## 如何调整图表的对齐方式
答:调整RectTransform的锚点和UGUI的其他组件的用法一致。
调整RectTransform的锚点和UGUI的其他组件的用法一致。
## 可以显示超过1000以上的大数据吗
答:可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie``symbol``label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。`1.5.0`以上版本可以设置`large``largeThreshold`参数来开启性能模式。
可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie``symbol``label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。`1.5.0`以上版本可以设置`large``largeThreshold`参数来开启性能模式。
## 折线图可以画虚线点线点划线吗
答:可以。通过`Serie`下的`lineType`选择线条样式。当要显示的数据过多(成千以上)数据间过密时建议使用`Normal`或者`Step`样式。
可以。通过`Serie`下的`lineType`选择线条样式。当要显示的数据过多(成千以上)数据间过密时建议使用`Normal`或者`Step`样式。
## 如何限定Y轴的值范围
## 如何限定y轴的值范围
答:设置`Axis`下的`minMaxType``Custom`,自定义`min``max`
设置`Axis`下的`minMaxType``Custom`,自定义`min``max`
## 如何自定义数值轴刻度大小
答:默认时通过`Axis`下的`splitNumer`进行自动划分。也可以设置`interval`自定义刻度大小。
默认时通过`Axis`下的`splitNumer`进行自动划分。也可以设置`interval`自定义刻度大小。
## 如何在数据项顶上显示文本
答:通过设置`Serie`下的`Label`。3.0版本需要先添加`LabelStyle`组件。
通过设置`Serie`下的`Label`。3.0版本需要先添加`LabelStyle`组件。
## 如何给数据项自定义图标
答:通过设置`Serie``data`下的数据项可单独设置`icon`相关参数。
通过设置`Serie``data`下的数据项可单独设置`icon`相关参数。
## 锯齿太严重如何让图表更顺滑
答:开启抗锯齿设置(在`Unity`里设置。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。
开启抗锯齿设置(在`Unity`里设置。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。
## 为什么鼠标移上图表Tooltip不显示
## 为什么鼠标移上图表tooltip不显示
答:确认`Tooltip`是否开启;确认父节点是否关闭了鼠标事件。
确认`Tooltip`是否开启;确认父节点是否关闭了鼠标事件。
## 如何取消Tooltip的竖线
## 如何取消tooltip的竖线
答:设置`Tooltip``type``None`。或者调整`lineStyle`的参数。
设置`Tooltip``type``None`。或者调整`lineStyle`的参数。
## 如何自定义Tooltip的显示内容
## 如何自定义tooltip的显示内容
答:自定义总的内容可以通过`Tooltip``formatter`。如果只是想调整所有的`serie`的显示格式可以用`itemFormatter``titleFormatter`结合。如果想每个`serie`的显示格式不一样,可以定制`serie``itemStyle`里的`tooltipFormatter`。具体的用法请查阅[XCharts配置项手册](https://xcharts-team.github.io/docs/configuration#Tooltip-itemFormatter)。
自定义总的内容可以通过`Tooltip``formatter`。如果只是想调整所有的`serie`的显示格式可以用`itemFormatter``titleFormatter`结合。如果想每个`serie`的显示格式不一样,可以定制`serie``itemStyle`里的`tooltipFormatter`。具体的用法请查阅[XCharts配置项手册](https://xcharts-team.github.io/docs/configuration#Tooltip-itemFormatter)。
## 如何让Y轴显示多位小数
## 如何让y轴显示多位小数
答:设置`Axis`下的`AxisLabel`中的`formatter``{value:f1}``{value:f2}``1.5.0`及以上版本通过`numericFormatter`设置。
设置`Axis`下的`AxisLabel`中的`formatter``{value:f1}``{value:f2}``1.5.0`及以上版本通过`numericFormatter`设置。
## 如何用代码动态更新数据
答:请查阅`Example`下的代码,`Example13_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能相关API请查看文档[XChartsAPI接口](api.md) 。
请查阅`Example`下的代码,`Example13_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能相关API请查看文档[XChartsAPI接口](api.md) 。
## 如何显示图例为什么有时候图例无法显示
答:首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例的`name`即可。如果`data`中的值都不是系列的`name`,那图例就不会显示。
首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例的`name`即可。如果`data`中的值都不是系列的`name`,那图例就不会显示。
## 如何做成预设
答:做成prefab前执行一下`Rebuild Chart Object`重新刷新节点,避免有冗余的节点存在。
做成prefab前执行一下`Rebuild Chart Object`重新刷新节点,避免有冗余的节点存在。
## 如何在图表上画点画线等自定义内容
答:`XCharts`有自定义绘制回调`onCustomDraw`,具体可参考`Example12_CustomDrawing.cs`
`XCharts`有自定义绘制回调`onCustomDraw`,具体可参考`Example12_CustomDrawing.cs`
## 如何实现心电图类似的数据移动效果
答:参考`Example`目录下的`Example_Dynamic.cs`。主要通过设置`maxCache`参数实现。`axis``serie`都设置相同的`maxCache``maxCache`可固定数据个数,当数据超过设定时会先删除第一个在添加新数据,实现数据移动效果。
参考`Example`目录下的`Example_Dynamic.cs`。主要通过设置`maxCache`参数实现。`axis``serie`都设置相同的`maxCache``maxCache`可固定数据个数,当数据超过设定时会先删除第一个在添加新数据,实现数据移动效果。
## 如何使用背景组件有什么条件限制
答:设置`background`组件的`show``true`
设置`background`组件的`show``true`
## 区域折线图在用半透明颜色时有时候会一条叠加的线
答:这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。
这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。
## Mesh_cannot_have_more_than_65000_vertices
## mesh_cannot_have_more_than_65000_vertices
答:这是`UGUI`对单个`Graphic`的顶点数限制。`XCharts`是将图形绘制在单个`Graphic`上,所以也会有这个限制。解决的办法可以参考:[QA 10可以显示超过1000以上的大数据吗](#可以显示超过1000以上的大数据吗)
这是`UGUI`对单个`Graphic`的顶点数限制。`XCharts`是将图形绘制在单个`Graphic`上,所以也会有这个限制。解决的办法可以参考:[FAQ 10可以显示超过1000以上的大数据吗](#可以显示超过1000以上的大数据吗)
## 为什么serie里设置的参数运行后又被重置了
答:检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。
检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。
## 如何修改Serie的Symbol的颜色
## 如何修改serie的symbol的颜色
答:`Symbol` 的颜色是使用的 `ItemStyle``color`
`Symbol` 的颜色是使用的 `ItemStyle``color`
## 导入或更新XCharts时TMP报错怎么办
## 导入或更新xcharts时tmp报错怎么办
答:XCharts默认时不开启TMP所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式解决
XCharts默认时不开启TMP所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式解决
1. 找到`XCharts.Runtime.asmdef``XCharts.Editor.asmdef`,手动加上 `TextMeshPro`的引用
2. 移除`PlayerSetting``Scripting Define Symbols``dUI_TextMeshPro`
@@ -168,4 +171,17 @@ slug: /faq
## 支持空数据吗如何实现折线图断开的效果
答:`Serie``data``double`类型,所以无法表示空数据。可通过开启`Serie``ignore`和指定`ignoreValue`来达到空数据的效果。也可以每个`SerieData`设置`ignore`参数。忽略数据后断开还是连接可设置`ignoreLineBreak`参数。
`Serie``data``double`类型,所以无法表示空数据。可通过开启`Serie``ignore`和指定`ignoreValue`来达到空数据的效果。也可以每个`SerieData`设置`ignore`参数。忽略数据后断开还是连接可设置`ignoreLineBreak`参数。
## xcharts2升级xcharts3时常见的问题有哪些
1. 'XCharts.Runtime.XChartsMgr' is missing the class attribute 'ExtensionOfNativeClass'!
3.x版本时不需要挂载XChartsMgr直接删掉场景上的`_xcharts_`节点即可。
## 折线图如何两边不留空白而从0坐标开始显示
设置X轴的`boundaryGap`参数。
## 如何设置部分serie不显示tooltip
`serie``itemStyle``itemFormatter`设置为`-`可以忽略`tooltip`

View File

@@ -79,11 +79,14 @@ slug: /support
| 102 | [漏斗图](https://xcharts-team.github.io/docs/funnel) |FunnelChart | 98¥ |
| 103 | [3D金字塔](https://xcharts-team.github.io/docs/pyramid) |PyramidChart | 98¥ |
| 104 | [树形矩图](https://xcharts-team.github.io/docs/treemap) |TreemapChart | 98¥ |
| 105 | [桑基图](https://xcharts-team.github.io/docs/sankey) |SankeyChart | 98¥ |
| 201 | [3D柱图](https://xcharts-team.github.io/docs/bar3d) |Bar3DChart | 198¥ |
| 202 | [3D饼图](https://xcharts-team.github.io/docs/pie3d) |Pie3DChart | 198¥ |
| 203 | [甘特图](https://xcharts-team.github.io/docs/gantt) |GanttChart | 198¥ |
| 204 | [仪表盘](https://xcharts-team.github.io/docs/gauge) |GaugeChart | 198¥ |
| 205 | [水位图](https://xcharts-team.github.io/docs/liquid) |LiquidChart | 198¥ |
| 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/)

View File

@@ -44,7 +44,7 @@ XCharts可通过以下任意一种方式导入到项目
## 添加一个简单图表
在`Hierarchy`视图下右键或菜单栏`GameObject`下拉选择`XCharts->LineChart`,即可快速创建一个默认的折线图出来:
在`Hierarchy`视图下右键`UI->XCharts->LineChart`或菜单栏`GameObject`下拉选择`XCharts->LineChart`,即可快速创建一个默认的折线图出来:
![linechart1](img/tutorial01_linechart1.png)

View File

@@ -0,0 +1,28 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(Background), true)]
public class BackgroundDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Background"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_ImageColor");
PropertyField(prop, "m_ImageWidth");
PropertyField(prop, "m_ImageHeight");
PropertyField(prop, "m_AutoColor");
PropertyField(prop, "m_BorderStyle");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fe10ee35a038646b6aedfffb30f84024
guid: 88c83fad35bc544cab4106096d171189
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,25 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(BorderStyle), true)]
public class BorderStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Border"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_BorderWidth");
PropertyField(prop, "m_BorderColor");
PropertyField(prop, "m_RoundedCorner");
PropertyListField(prop, "m_CornerRadius", true);
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 47a460215ec5e4ec0bc7f8122a44302a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -27,11 +27,16 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
++EditorGUI.indentLevel;
PropertyField(prop, "m_Label");
PropertyField(prop, "m_UpperLabel");
PropertyField(prop, "m_ItemStyle");
--EditorGUI.indentLevel;
if (MakeComponentFoldout(prop, "m_Depth", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Depth");
PropertyField(prop, "m_Label");
PropertyField(prop, "m_UpperLabel");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_ItemStyle");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -46,6 +46,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_AutoColor");
PropertyField(prop, "m_ShowStartLine");
PropertyField(prop, "m_ShowEndLine");
PropertyField(prop, "m_ShowZLine");
}
}

View File

@@ -0,0 +1,23 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(ViewControl), true)]
public class ViewControlDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "ViewControl"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Alpha");
PropertyField(prop, "m_Beta");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: faeb8611591ee4c038e88fdb5a67b5ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -64,6 +64,7 @@ namespace XCharts.Editor
if (type == Axis.AxisType.Category)
{
PropertyField("m_MaxCache");
PropertyField("m_MinCategorySpacing");
PropertyField("m_BoundaryGap");
}
else
@@ -92,7 +93,7 @@ namespace XCharts.Editor
{
PropertyListField("m_Data", true, new HeaderMenuInfo("Import ECharts Axis Data", () =>
{
PraseExternalDataEditor.UpdateData(chart, null, component as Axis);
PraseExternalDataEditor.UpdateData(chart, null, component as Axis, false);
PraseExternalDataEditor.ShowWindow();
}));
}
@@ -106,6 +107,15 @@ namespace XCharts.Editor
[ComponentEditor(typeof(YAxis))]
public class YAxisEditor : AxisEditor { }
[ComponentEditor(typeof(XAxis3D))]
public class XAxis3DEditor : AxisEditor { }
[ComponentEditor(typeof(YAxis3D))]
public class YAxis3DEditor : AxisEditor { }
[ComponentEditor(typeof(ZAxis3D))]
public class ZAxis3DEditor : AxisEditor { }
[ComponentEditor(typeof(SingleAxis))]
public class SingleAxisEditor : AxisEditor
{

View File

@@ -14,6 +14,7 @@ namespace XCharts.Editor
PropertyField("m_ImageType");
PropertyField("m_ImageColor");
PropertyField("m_AutoColor");
PropertyField("m_BorderStyle");
--EditorGUI.indentLevel;
}
}

View File

@@ -0,0 +1,112 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Assertions;
using XCharts.Runtime;
namespace XCharts.Editor
{
public class BaseGraphEditor : UnityEditor.Editor
{
class Styles
{
public static readonly GUIContent btnAddComponent = new GUIContent("Add Main Component", "");
public static readonly GUIContent btnRebuildChartObject = new GUIContent("Rebuild Object", "");
public static readonly GUIContent btnSaveAsImage = new GUIContent("Save As Image", "");
public static readonly GUIContent btnCheckWarning = new GUIContent("Check Warning", "");
public static readonly GUIContent btnHideWarning = new GUIContent("Hide Warning", "");
}
public BaseGraph m_BaseGraph;
public static T AddUIComponent<T>(string chartName) where T : BaseGraph
{
return XChartsEditor.AddGraph<T>(chartName);
}
protected Dictionary<string, SerializedProperty> m_Properties = new Dictionary<string, SerializedProperty>();
protected virtual void OnEnable()
{
m_Properties.Clear();
m_BaseGraph = (BaseGraph)target;
}
public override void OnInspectorGUI()
{
serializedObject.Update();
PropertyField("m_Script");
OnStartInspectorGUI();
OnDebugInspectorGUI();
serializedObject.ApplyModifiedProperties();
}
protected virtual void OnStartInspectorGUI() { }
protected virtual void OnDebugInspectorGUI()
{
EditorGUILayout.Space();
OnDebugStartInspectorGUI();
OnDebugEndInspectorGUI();
}
protected virtual void OnDebugStartInspectorGUI() { }
protected virtual void OnDebugEndInspectorGUI() { }
protected void PropertyField(string name)
{
if (!m_Properties.ContainsKey(name))
{
var prop = serializedObject.FindProperty(name);
if (prop == null)
{
Debug.LogError("Property " + name + " not found!");
return;
}
m_Properties.Add(name, prop);
}
EditorGUILayout.PropertyField(m_Properties[name]);
}
protected void PropertyField(SerializedProperty property)
{
Assert.IsNotNull(property);
var title = ChartEditorHelper.GetContent(property.displayName);
PropertyField(property, title);
}
protected void PropertyField(SerializedProperty property, GUIContent title)
{
EditorGUILayout.PropertyField(property, title);
}
protected void PropertyListField(string relativePropName, bool showOrder = true, params HeaderMenuInfo[] menus)
{
var m_DrawRect = GUILayoutUtility.GetRect(1f, 17f);
var height = 0f;
var prop = FindProperty(relativePropName);
prop.isExpanded = ChartEditorHelper.MakeListWithFoldout(ref m_DrawRect, ref height,
prop, prop.isExpanded, showOrder, true, menus);
if (prop.isExpanded)
{
GUILayoutUtility.GetRect(1f, height - 17);
}
}
protected void PropertyTwoFiled(string relativePropName)
{
var m_DrawRect = GUILayoutUtility.GetRect(1f, 17f);
var prop = FindProperty(relativePropName);
ChartEditorHelper.MakeTwoField(ref m_DrawRect, m_DrawRect.width, prop, prop.displayName);
}
protected SerializedProperty FindProperty(string path)
{
if (!m_Properties.ContainsKey(path))
{
m_Properties.Add(path, serializedObject.FindProperty(path));
}
return m_Properties[path];
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 88786092000154d359c1aa954ce664f0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
using UnityEditor;
using XCharts.Runtime;
namespace XCharts.Editor
{
[ComponentEditor(typeof(GridCoord3D))]
public class GridCoord3DEditor : MainComponentEditor<GridCoord3D>
{
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
PropertyField("m_Left");
PropertyField("m_Bottom");
PropertyField("m_BoxWidth");
PropertyField("m_BoxHeight");
PropertyField("m_BoxDepth");
PropertyField("m_XYExchanged");
PropertyField("m_ShowBorder");
PropertyField("m_ViewControl");
--EditorGUI.indentLevel;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c9a4a8a30b1124c4e996e234d5717a07
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -11,13 +11,10 @@ namespace XCharts.Editor
++EditorGUI.indentLevel;
var layoutIndex = baseProperty.FindPropertyRelative("m_LayoutIndex").intValue;
PropertyField("m_LayoutIndex");
if (layoutIndex < 0)
{
PropertyField("m_Left");
PropertyField("m_Right");
PropertyField("m_Top");
PropertyField("m_Bottom");
}
PropertyField("m_Left");
PropertyField("m_Right");
PropertyField("m_Top");
PropertyField("m_Bottom");
PropertyField("m_BackgroundColor");
PropertyField("m_ShowBorder");
PropertyField("m_BorderWidth");

View File

@@ -19,6 +19,7 @@ namespace XCharts.Editor
PropertyField("m_Orient");
PropertyField("m_Location");
PropertyField("m_LabelStyle");
PropertyField("m_TextLimit");
PropertyField("m_Background");
PropertyField("m_Padding");
PropertyListField("m_Icons");

View File

@@ -133,7 +133,26 @@ namespace XCharts.Editor
public void AddChartComponent(Type type)
{
chart.AddChartComponent(type);
var component = chart.AddChartComponent(type);
if (component != null)
{
if (component is YAxis)
{
var yAxis = component as YAxis;
if (yAxis.index == 1)
{
yAxis.position = Axis.AxisPosition.Right;
}
}
else if (component is XAxis)
{
var xAxis = component as XAxis;
if (xAxis.index == 1)
{
xAxis.position = Axis.AxisPosition.Top;
}
}
}
m_ComponentsProperty = m_BaseEditor.RefreshComponent();
RefreshEditors();
EditorUtility.SetDirty(chart);

View File

@@ -11,6 +11,7 @@ namespace XCharts.Editor
++EditorGUI.indentLevel;
PropertyField("m_Type");
PropertyField("m_Trigger");
PropertyField("m_TriggerOn");
PropertyField("m_Position");
PropertyField("m_FixedX");
PropertyField("m_FixedY");

View File

@@ -48,6 +48,8 @@ namespace XCharts.Editor
PropertyField("m_Large");
PropertyField("m_LargeThreshold");
PropertyField("m_PlaceHolder");
PropertyField("m_MinShowLabel");
PropertyField("m_MinShowLabelValue");
});
PropertyField("m_ItemStyle");
PropertyField("m_Animation");

View File

@@ -19,6 +19,8 @@ namespace XCharts.Editor
PropertyField("m_HeatmapType");
PropertyField("m_Ignore");
PropertyField("m_IgnoreValue");
PropertyField("m_MaxCache");
PropertyField("m_Symbol");
PropertyField("m_ItemStyle");

View File

@@ -23,6 +23,8 @@ namespace XCharts.Editor
PropertyField("m_IgnoreValue");
PropertyField("m_ClickOffset");
PropertyField("m_RadiusGradient");
PropertyField("m_MinShowLabel");
PropertyField("m_MinShowLabelValue");
});
PropertyField("m_ItemStyle");
PropertyField("m_Animation");

View File

@@ -9,8 +9,8 @@ namespace XCharts.Editor
{
public class SerieBaseEditor
{
internal BaseChart chart { get; private set; }
internal Serie serie { get; private set; }
public BaseChart chart { get; private set; }
public Serie serie { get; private set; }
//Editor m_Inspector;
internal SerializedProperty baseProperty;

View File

@@ -0,0 +1,24 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(SerieDataLink), true)]
public class SerieDataLinkDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Link"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Source");
PropertyField(prop, "m_Target");
PropertyField(prop, "m_Value");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 877ff0f4c473d47f29e7e7e3a3eaf53b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -12,6 +12,8 @@ namespace XCharts.Editor
private bool m_DataFoldout = false;
private bool m_DataComponentFoldout = true;
private Dictionary<int, bool> m_DataElementFoldout = new Dictionary<int, bool>();
private bool m_LinksFoldout = false;
private Dictionary<int, bool> m_LinksElementFoldout = new Dictionary<int, bool>();
public override void OnInspectorGUI()
{
@@ -31,12 +33,16 @@ namespace XCharts.Editor
OnCustomInspectorGUI();
OnExtraInspectorGUI();
PropertyFieldData();
OnEndCustomInspectorGUI();
--EditorGUI.indentLevel;
}
public virtual void OnCustomInspectorGUI()
{ }
public virtual void OnEndCustomInspectorGUI()
{ }
private void OnExtraInspectorGUI()
{
foreach (var kv in Serie.extraComponentMap)
@@ -47,14 +53,18 @@ namespace XCharts.Editor
}
}
private HeaderMenuInfo headMenuInfo = new HeaderMenuInfo("Import ECharts Data", null);
private void HeadMenuInfoCallback()
{
PraseExternalDataEditor.UpdateData(chart, serie, null, false);
PraseExternalDataEditor.ShowWindow();
}
private void PropertyFieldData()
{
m_DataFoldout = ChartEditorHelper.DrawHeader("Data", m_DataFoldout, false, null, null,
new HeaderMenuInfo("Import ECharts Data", () =>
{
PraseExternalDataEditor.UpdateData(chart, serie, null);
PraseExternalDataEditor.ShowWindow();
}));
headMenuInfo.action = HeadMenuInfoCallback;
m_DataFoldout = ChartEditorHelper.DrawHeader("Data", m_DataFoldout, false, null, null, headMenuInfo);
if (!m_DataFoldout) return;
EditorGUI.indentLevel++;
var m_Datas = FindProperty("m_Data");
@@ -97,6 +107,52 @@ namespace XCharts.Editor
EditorGUI.indentLevel--;
}
private HeaderMenuInfo linkHeadMenuInfo = new HeaderMenuInfo("Import ECharts Link", null);
private void LinkHeadMenuInfoCallback()
{
PraseExternalDataEditor.UpdateData(chart, serie, null, false);
PraseExternalDataEditor.ShowWindow();
}
protected void PropertyFieldLinks()
{
linkHeadMenuInfo.action = LinkHeadMenuInfoCallback;
m_LinksFoldout = ChartEditorHelper.DrawHeader("Links", m_LinksFoldout, false, null, null, linkHeadMenuInfo);
if (!m_LinksFoldout) return;
EditorGUI.indentLevel++;
var m_Links = FindProperty("m_Links");
var listSize = m_Links.arraySize;
listSize = EditorGUILayout.IntField("Size", listSize);
if (listSize < 0) listSize = 0;
if (listSize != m_Links.arraySize)
{
while (listSize > m_Links.arraySize) m_Links.arraySize++;
while (listSize < m_Links.arraySize) m_Links.arraySize--;
}
if (listSize > 30) // && !XCSettings.editorShowAllListData)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
{
DrawSerieDataLink(m_Links, i);
}
if (num >= 10)
{
ChartEditorHelper.DrawHeader("... ", false, false, null, null);
DrawSerieDataLink(m_Links, listSize - 1);
}
}
else
{
for (int i = 0; i < m_Links.arraySize; i++)
{
DrawSerieDataLink(m_Links, i);
}
}
EditorGUI.indentLevel--;
}
protected void PropertyFiledMore(System.Action action)
{
m_MoreFoldout = ChartEditorHelper.DrawHeader(MORE, m_MoreFoldout, false, null, null);
@@ -106,6 +162,84 @@ namespace XCharts.Editor
}
}
private void DrawSerieDataHeader(Rect drawRect, HeaderCallbackContext context)
{
var serieData = context.serieData;
var fieldCount = context.fieldCount;
var showName = context.showName;
var index = context.index;
var dimension = context.dimension;
//drawRect.width -= 2f;
var maxX = drawRect.xMax;
var currentWidth = drawRect.width;
var lastX = drawRect.x;
var lastWid = drawRect.width;
var lastFieldWid = EditorGUIUtility.fieldWidth;
var lastLabelWid = EditorGUIUtility.labelWidth;
var sereName = serieData.FindPropertyRelative("m_Name");
var data = serieData.FindPropertyRelative("m_Data");
#if UNITY_2019_3_OR_NEWER
var gap = 2;
var namegap = 3;
var buttomLength = 30;
#else
var gap = 0;
var namegap = 0;
var buttomLength = 30;
#endif
if (showName)
{
buttomLength += 12;
}
if (fieldCount <= 1)
{
while (2 > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
SerializedProperty element = data.GetArrayElementAtIndex(1);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
drawRect.x = startX;
drawRect.xMax = maxX - buttomLength;
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
else
{
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
var dataWidTotal = currentWidth - (startX + 20.5f + 1) - buttomLength;
var dataWid = dataWidTotal / fieldCount;
var xWid = dataWid - 0;
for (int i = 0; i < dimension; i++)
{
var dataCount = i < 1 ? 2 : i + 1;
while (dataCount > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + 25;
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
if (showName)
{
drawRect.x = startX + (fieldCount - 1) * xWid;
drawRect.width = dataWid + 40 + dimension * namegap - 2.5f;
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
}
drawRect.x = lastX;
drawRect.width = lastWid;
ChartEditorHelper.UpDownAddDeleteButton(drawRect, context.listProp, index);
EditorGUIUtility.fieldWidth = lastFieldWid;
EditorGUIUtility.labelWidth = lastLabelWid;
}
}
private void DrawSerieData(int dimension, SerializedProperty m_Datas, int index, bool showName)
{
bool flag;
@@ -117,70 +251,16 @@ namespace XCharts.Editor
var fieldCount = dimension + (showName ? 1 : 0);
var serieData = m_Datas.GetArrayElementAtIndex(index);
var dataIndex = serieData.FindPropertyRelative("m_Index").intValue;
m_DataElementFoldout[index] = ChartEditorHelper.DrawHeader("SerieData " + dataIndex, flag, false, null,
delegate(Rect drawRect)
{
//drawRect.width -= 2f;
var maxX = drawRect.xMax;
var currentWidth = drawRect.width;
var lastX = drawRect.x;
var lastWid = drawRect.width;
var lastFieldWid = EditorGUIUtility.fieldWidth;
var lastLabelWid = EditorGUIUtility.labelWidth;
//var serieData = m_Datas.GetArrayElementAtIndex(index);
var sereName = serieData.FindPropertyRelative("m_Name");
var data = serieData.FindPropertyRelative("m_Data");
#if UNITY_2019_3_OR_NEWER
var gap = 2;
var namegap = 3;
#else
var gap = 0;
var namegap = 0;
#endif
if (fieldCount <= 1)
{
while (2 > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
SerializedProperty element = data.GetArrayElementAtIndex(1);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
drawRect.x = startX;
drawRect.xMax = maxX;
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
else
{
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
var dataWid = dataWidTotal / fieldCount;
var xWid = dataWid - 0;
for (int i = 0; i < dimension; i++)
{
var dataCount = i < 1 ? 2 : i + 1;
while (dataCount > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + 25;
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
if (showName)
{
drawRect.x = startX + (fieldCount - 1) * xWid;
drawRect.width = dataWid + 40 + dimension * namegap - 2.5f;
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
}
EditorGUIUtility.fieldWidth = lastFieldWid;
EditorGUIUtility.labelWidth = lastLabelWid;
}
});
var callbackContext = new HeaderCallbackContext()
{
serieData = serieData,
fieldCount = fieldCount,
showName = showName,
index = index,
dimension = dimension,
listProp = m_Datas
};
m_DataElementFoldout[index] = ChartEditorHelper.DrawSerieDataHeader("SerieData " + dataIndex, flag, false, null, callbackContext, DrawSerieDataHeader);
if (m_DataElementFoldout[index])
{
if (!(serie is ISimplifiedSerie))
@@ -242,5 +322,41 @@ namespace XCharts.Editor
}
EditorGUI.indentLevel--;
}
private void DrawSerieDataLink(SerializedProperty m_Datas, int index)
{
bool flag;
if (!m_LinksElementFoldout.TryGetValue(index, out flag))
{
flag = false;
m_LinksElementFoldout[index] = false;
}
var dataLink = m_Datas.GetArrayElementAtIndex(index);
m_LinksElementFoldout[index] = ChartEditorHelper.DrawHeader("Link " + index, flag, false, null,
delegate (Rect drawRect)
{
var sourceIndex = dataLink.FindPropertyRelative("m_Source");
var targetIndex = dataLink.FindPropertyRelative("m_Target");
var value = dataLink.FindPropertyRelative("m_Value");
var hig = ChartEditorHelper.MakeThreeField(ref drawRect, drawRect.width, sourceIndex, targetIndex, value, "");
var btnRect = drawRect;
btnRect.y -= hig;
ChartEditorHelper.UpDownAddDeleteButton(btnRect, m_Datas, index);
});
if (m_LinksElementFoldout[index])
{
DrawSerieDataLinkDetail(m_Datas, index);
}
}
private void DrawSerieDataLinkDetail(SerializedProperty m_Links, int index)
{
EditorGUI.indentLevel++;
var dataLink = m_Links.GetArrayElementAtIndex(index);
PropertyField(dataLink.FindPropertyRelative("m_Source"));
PropertyField(dataLink.FindPropertyRelative("m_Target"));
PropertyField(dataLink.FindPropertyRelative("m_Value"));
EditorGUI.indentLevel--;
}
}
}

View File

@@ -6,6 +6,16 @@ using XCharts.Runtime;
namespace XCharts.Editor
{
public class HeaderCallbackContext
{
public int fieldCount = 0;
public SerializedProperty serieData;
public bool showName;
public int index;
public int dimension;
public SerializedProperty listProp;
}
public class HeaderMenuInfo
{
public string name;
@@ -43,6 +53,8 @@ namespace XCharts.Editor
public const float GAP_WIDTH = 0;
public const float DIFF_WIDTH = 1;
#endif
public const float ICON_WIDHT = 10;
public const float ICON_GAP = 0;
static Dictionary<string, GUIContent> s_GUIContentCache;
static ChartEditorHelper()
@@ -106,6 +118,25 @@ namespace XCharts.Editor
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
public static float MakeThreeField(ref Rect drawRect, float rectWidth, SerializedProperty prop1,
SerializedProperty prop2, SerializedProperty prop3, string name, bool btnSpacing = true)
{
EditorGUI.LabelField(drawRect, name);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + GAP_WIDTH;
var diff = 13f + EditorGUI.indentLevel * 14;
var offset = diff - INDENT_WIDTH;
var tempWidth = (rectWidth - startX + diff - (btnSpacing ? (ICON_WIDHT + ICON_GAP) * 4 : 0)) / 3 + 8.5f;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height - 1);
var centerYRect = new Rect(centerXRect.x + tempWidth - offset, drawRect.y, tempWidth - 1, drawRect.height - 1);
var centerZRect = new Rect(centerYRect.x + tempWidth - offset, drawRect.y, tempWidth - 1, drawRect.height - 1);
EditorGUI.PropertyField(centerXRect, prop1, GUIContent.none);
EditorGUI.PropertyField(centerYRect, prop2, GUIContent.none);
EditorGUI.PropertyField(centerZRect, prop3, GUIContent.none);
var hig = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += hig;
return hig;
}
public static void MakeVector2(ref Rect drawRect, float rectWidth, SerializedProperty prop, string name)
{
EditorGUI.LabelField(drawRect, name);
@@ -318,15 +349,12 @@ namespace XCharts.Editor
{
EditorGUI.indentLevel++;
var listSize = listProp.arraySize;
var iconWidth = 10;
var iconGap = 0f;
if (showSize)
{
var headerHeight = DrawSplitterAndBackground(drawRect);
if (showOrder)
{
var elementRect = new Rect(drawRect.x, drawRect.y, drawRect.width - iconWidth + 2, drawRect.height);
var elementRect = new Rect(drawRect.x, drawRect.y, drawRect.width - ICON_WIDHT + 2, drawRect.height);
var oldColor = GUI.contentColor;
GUI.contentColor = Color.black;
GUI.contentColor = oldColor;
@@ -379,40 +407,14 @@ namespace XCharts.Editor
DrawSplitterAndBackground(drawRect);
if (showOrder)
{
var temp = INDENT_WIDTH + GAP_WIDTH + iconGap;
var isSerie = "Serie".Equals(element.type);
var elementRect = isSerie ?
new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH - 2 * iconGap, drawRect.height) :
new Rect(drawRect.x, drawRect.y, drawRect.width - 4 * iconWidth, drawRect.height);
new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH - 2 * ICON_GAP, drawRect.height) :
new Rect(drawRect.x, drawRect.y, drawRect.width - 4 * ICON_WIDHT, drawRect.height);
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
var iconRect = new Rect(drawRect.width - 4 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
var oldColor = GUI.contentColor;
GUI.contentColor = Color.black;
if (GUI.Button(iconRect, EditorCustomStyles.iconUp, EditorCustomStyles.invisibleButton))
{
if (i > 0) listProp.MoveArrayElement(i, i - 1);
}
iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
if (GUI.Button(iconRect, EditorCustomStyles.iconDown, EditorCustomStyles.invisibleButton))
{
if (i < listProp.arraySize - 1) listProp.MoveArrayElement(i, i + 1);
}
iconRect = new Rect(drawRect.width - 2 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
if (GUI.Button(iconRect, EditorCustomStyles.iconAdd, EditorCustomStyles.invisibleButton))
{
if (i < listProp.arraySize && i >= 0) listProp.InsertArrayElementAtIndex(i);
}
iconRect = new Rect(drawRect.width - iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
if (GUI.Button(iconRect, EditorCustomStyles.iconRemove, EditorCustomStyles.invisibleButton))
{
if (i < listProp.arraySize && i >= 0) listProp.DeleteArrayElementAtIndex(i);
}
else
{
drawRect.y += EditorGUI.GetPropertyHeight(element);
height += EditorGUI.GetPropertyHeight(element);
}
GUI.contentColor = oldColor;
UpDownAddDeleteButton(drawRect, listProp, i);
drawRect.y += EditorGUI.GetPropertyHeight(element);
height += EditorGUI.GetPropertyHeight(element);
}
else
{
@@ -425,6 +427,34 @@ namespace XCharts.Editor
EditorGUI.indentLevel--;
}
public static void UpDownAddDeleteButton(Rect drawRect, SerializedProperty listProp, int i)
{
var temp = INDENT_WIDTH + GAP_WIDTH + ICON_GAP;
var iconRect = new Rect(drawRect.width - 4 * ICON_WIDHT + temp, drawRect.y, ICON_WIDHT, drawRect.height);
var oldColor = GUI.contentColor;
GUI.contentColor = Color.black;
if (GUI.Button(iconRect, EditorCustomStyles.iconUp, EditorCustomStyles.invisibleButton))
{
if (i > 0) listProp.MoveArrayElement(i, i - 1);
}
iconRect = new Rect(drawRect.width - 3 * ICON_WIDHT + temp, drawRect.y, ICON_WIDHT, drawRect.height);
if (GUI.Button(iconRect, EditorCustomStyles.iconDown, EditorCustomStyles.invisibleButton))
{
if (i < listProp.arraySize - 1) listProp.MoveArrayElement(i, i + 1);
}
iconRect = new Rect(drawRect.width - 2 * ICON_WIDHT + temp, drawRect.y, ICON_WIDHT, drawRect.height);
if (GUI.Button(iconRect, EditorCustomStyles.iconAdd, EditorCustomStyles.invisibleButton))
{
if (i < listProp.arraySize && i >= 0) listProp.InsertArrayElementAtIndex(i);
}
iconRect = new Rect(drawRect.width - ICON_WIDHT + temp, drawRect.y, ICON_WIDHT, drawRect.height);
if (GUI.Button(iconRect, EditorCustomStyles.iconRemove, EditorCustomStyles.invisibleButton))
{
if (i < listProp.arraySize && i >= 0) listProp.DeleteArrayElementAtIndex(i);
}
GUI.contentColor = oldColor;
}
public static bool PropertyField(ref Rect drawRect, Dictionary<string, float> heights, string key,
SerializedProperty prop)
{
@@ -569,6 +599,31 @@ namespace XCharts.Editor
return state;
}
public static bool DrawSerieDataHeader(string title, bool state, bool drawBackground, SerializedProperty activeField,
HeaderCallbackContext context, Action<Rect, HeaderCallbackContext> drawCallback, params HeaderMenuInfo[] menus)
{
var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT);
var labelRect = DrawHeaderInternal(rect, title, ref state, drawBackground, activeField);
DrawMenu(rect, menus);
if (drawCallback != null)
{
drawCallback(rect, context);
}
var e = Event.current;
if (e.type == EventType.MouseDown)
{
if (labelRect.Contains(e.mousePosition))
{
if (e.button == 0)
{
state = !state;
e.Use();
}
}
}
return state;
}
internal static bool DrawHeader(string title, bool state, bool drawBackground, SerializedProperty activeField,
Action<Rect> drawCallback, List<HeaderMenuInfo> menus)
{

View File

@@ -8,9 +8,12 @@ namespace XCharts.Editor
{
public class PraseExternalDataEditor : UnityEditor.EditorWindow
{
[SerializeField] private int m_DataDimension = 1;
[SerializeField] private double m_DefaultYValue = 0;
private static BaseChart s_Chart;
private static Serie s_Serie;
private static Axis s_Axis;
private static bool s_LinksData;
private static PraseExternalDataEditor window;
private static string inputJsonText = "";
@@ -23,11 +26,12 @@ namespace XCharts.Editor
window.Show();
}
public static void UpdateData(BaseChart chart, Serie serie, Axis axis)
public static void UpdateData(BaseChart chart, Serie serie, Axis axis, bool linksData)
{
s_Chart = chart;
s_Serie = serie;
s_Axis = axis;
s_LinksData = linksData;
inputJsonText = UnityEngine.GUIUtility.systemCopyBuffer;
}
@@ -44,8 +48,13 @@ namespace XCharts.Editor
return;
}
EditorGUILayout.LabelField("Input external data (echarts data):");
m_DataDimension = EditorGUILayout.IntField("Data Dimension", m_DataDimension);
if (m_DataDimension < 1)
m_DataDimension = 1;
else if (m_DataDimension == 2)
m_DefaultYValue = EditorGUILayout.DoubleField("Default Y Value", m_DefaultYValue);
inputJsonText = EditorGUILayout.TextArea(inputJsonText, GUILayout.Height(400));
if (GUILayout.Button("Add"))
if (GUILayout.Button("Try Add"))
{
if (s_Serie != null)
{
@@ -74,7 +83,7 @@ namespace XCharts.Editor
}
}
private static bool ParseArrayData(Axis axis, string arrayData)
private bool ParseArrayData(Axis axis, string arrayData)
{
arrayData = arrayData.Trim();
if (!arrayData.StartsWith("data: Array")) return false;
@@ -93,11 +102,12 @@ namespace XCharts.Editor
return true;
}
private static bool ParseArrayData(Serie serie, string arrayData)
private bool ParseArrayData(Serie serie, string arrayData)
{
arrayData = arrayData.Trim();
if (!arrayData.StartsWith("data: Array")) return false;
serie.ClearData();
if (s_LinksData) serie.ClearLinks();
else serie.ClearData();
var list = arrayData.Split('\n');
for (int i = 1; i < list.Length; i++)
{
@@ -117,7 +127,7 @@ namespace XCharts.Editor
return true;
}
private static bool ParseJsonData(Axis axis, string jsonData)
private bool ParseJsonData(Axis axis, string jsonData)
{
if (!CheckJsonData(ref jsonData)) return false;
axis.data.Clear();
@@ -137,10 +147,11 @@ namespace XCharts.Editor
/// 从json中导入数据
/// </summary>
/// <param name="jsonData"></param>
private static bool ParseJsonData(Serie serie, string jsonData)
private bool ParseJsonData(Serie serie, string jsonData)
{
if (!CheckJsonData(ref jsonData)) return false;
serie.ClearData();
if (s_LinksData) serie.ClearLinks();
else serie.ClearData();
if (jsonData.IndexOf("],") > -1 || jsonData.IndexOf("] ,") > -1)
{
string[] datas = jsonData.Split(new string[] { "],", "] ," }, StringSplitOptions.RemoveEmptyEntries);
@@ -152,7 +163,10 @@ namespace XCharts.Editor
if (data.Length == 2 && !double.TryParse(data[0], out value))
{
double.TryParse(data[1], out value);
serieData.data = new List<double>() { i, value };
if (m_DataDimension == 2)
serieData.data = new List<double>() { i, m_DefaultYValue, value };
else
serieData.data = new List<double>() { i, value };
serieData.name = data[0].Replace("\"", "").Trim();
}
else
@@ -183,7 +197,10 @@ namespace XCharts.Editor
if (a.StartsWith("value:"))
{
double value = double.Parse(a.Substring(6, a.Length - 6));
serieData.data = new List<double>() { i, value };
if (m_DataDimension == 2)
serieData.data = new List<double>() { i, m_DefaultYValue, value };
else
serieData.data = new List<double>() { i, value };
}
else if (a.StartsWith("name:"))
{
@@ -209,7 +226,10 @@ namespace XCharts.Editor
if (flag)
{
var serieData = new SerieData();
serieData.data = new List<double>() { i, value };
if (m_DataDimension == 2)
serieData.data = new List<double>() { i, m_DefaultYValue, value };
else
serieData.data = new List<double>() { i, value };
serie.AddSerieData(serieData);
}
}

View File

@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using XCharts.Runtime;
using ADB = UnityEditor.AssetDatabase;
namespace XCharts.Editor
{
public partial class XChartsEditor
{
[MenuItem("XCharts/BarChart/Baisc Column", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Baisc Column", priority = 45)]
public static void AddBarChart()
{
AddChart<BarChart>("BarChart");
}
[MenuItem("XCharts/BarChart/Zebra Column", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Zebra Column", priority = 45)]
public static void AddBarChart_ZebraColumn()
{
var chart = AddChart<BarChart>("BarChart", "Zebra Column");
chart.DefaultZebraColumnChart();
}
[MenuItem("XCharts/BarChart/Capsule Column", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Capsule Column", priority = 45)]
public static void AddBarChart_CapsuleColumn()
{
var chart = AddChart<BarChart>("BarChart", "Capsule Column");
chart.DefaultCapsuleColumnChart();
}
[MenuItem("XCharts/BarChart/Grouped Column", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Grouped Column", priority = 45)]
public static void AddBarChart_GroupedColumn()
{
var chart = AddChart<BarChart>("BarChart", "Grouped Column");
chart.DefaultGroupedColumnChart();
}
[MenuItem("XCharts/BarChart/Stacked Column", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Stacked Column", priority = 45)]
public static void AddBarChart_StackedColumn()
{
var chart = AddChart<BarChart>("BarChart", "Stacked Column");
chart.DefaultStackedColumnChart();
}
[MenuItem("XCharts/BarChart/Percent Column", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Percent Column", priority = 45)]
public static void AddBarChart_PercentColumn()
{
var chart = AddChart<BarChart>("BarChart", "Percent Column");
chart.DefaultPercentColumnChart();
}
[MenuItem("XCharts/BarChart/Baisc Bar", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Baisc Bar", priority = 45)]
public static void AddBarChart_BasicBar()
{
var chart = AddChart<BarChart>("BarChart");
chart.DefaultBarChart();
}
[MenuItem("XCharts/BarChart/Zebra Bar", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Zebra Bar", priority = 45)]
public static void AddBarChart_ZebraBar()
{
var chart = AddChart<BarChart>("BarChart", "Zebra Bar");
chart.DefaultZebraBarChart();
}
[MenuItem("XCharts/BarChart/Capsule Bar", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Capsule Bar", priority = 45)]
public static void AddBarChart_CapsuleBar()
{
var chart = AddChart<BarChart>("BarChart", "Capsule Bar");
chart.DefaultCapsuleBarChart();
}
[MenuItem("XCharts/BarChart/Grouped Bar", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Grouped Bar", priority = 45)]
public static void AddBarChart_GroupedBar()
{
var chart = AddChart<BarChart>("BarChart", "Grouped Bar");
chart.DefaultGroupedBarChart();
}
[MenuItem("XCharts/BarChart/Stacked Bar", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Stacked Bar", priority = 45)]
public static void AddBarChart_StackedBar()
{
var chart = AddChart<BarChart>("BarChart", "Stacked Bar");
chart.DefaultStackedBarChart();
}
[MenuItem("XCharts/BarChart/Percent Bar", priority = 45)]
[MenuItem("GameObject/UI/XCharts/BarChart/Percent Bar", priority = 45)]
public static void AddBarChart_PercentBar()
{
var chart = AddChart<BarChart>("BarChart", "Percent Bar");
chart.DefaultPercentBarChart();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 56ff28653cd1148dc857e65c4440cf74
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using XCharts.Runtime;
using ADB = UnityEditor.AssetDatabase;
namespace XCharts.Editor
{
public partial class XChartsEditor
{
[MenuItem("XCharts/LineChart/Basic Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Basic Line", priority = 44)]
public static void AddLineChart()
{
AddChart<LineChart>("LineChart");
}
[MenuItem("XCharts/LineChart/Area Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Area Line", priority = 44)]
public static void AddLineChart_Area()
{
var chart = AddChart<LineChart>("LineChart_Area", "Area Line");
chart.DefaultAreaLineChart();
}
[MenuItem("XCharts/LineChart/Smooth Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Smooth Line", priority = 44)]
public static void AddLineChart_Smooth()
{
var chart = AddChart<LineChart>("LineChart_Smooth", "Smooth Line");
chart.DefaultSmoothLineChart();
}
[MenuItem("XCharts/LineChart/Smooth Area", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Smooth Area Line", priority = 44)]
public static void AddLineChart_SmoothArea()
{
var chart = AddChart<LineChart>("LineChart_SmoothArea", "Smooth Area Line");
chart.DefaultSmoothAreaLineChart();
}
[MenuItem("XCharts/LineChart/Stack Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Stack Line", priority = 44)]
public static void AddLineChart_Stack()
{
var chart = AddChart<LineChart>("LineChart_Stack", "Stack Line");
chart.DefaultStackLineChart();
}
[MenuItem("XCharts/LineChart/Stack Area Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Stack Area Line", priority = 44)]
public static void AddLineChart_StackArea()
{
var chart = AddChart<LineChart>("LineChart_StackArea", "Stack Area Line");
chart.DefaultStackAreaLineChart();
}
[MenuItem("XCharts/LineChart/Step Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Step Line", priority = 44)]
public static void AddLineChart_Step()
{
var chart = AddChart<LineChart>("LineChart_Step", "Step Line");
chart.DefaultStepLineChart();
}
[MenuItem("XCharts/LineChart/Dashed Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Dashed Line", priority = 44)]
public static void AddLineChart_Dash()
{
var chart = AddChart<LineChart>("LineChart_Dashed", "Dashed Line");
chart.DefaultDashLineChart();
}
[MenuItem("XCharts/LineChart/Time Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Time Line", priority = 44)]
public static void AddLineChart_Time()
{
var chart = AddChart<LineChart>("LineChart_Time", "Time Line");
chart.DefaultTimeLineChart();
}
[MenuItem("XCharts/LineChart/Log Line", priority = 44)]
[MenuItem("GameObject/UI/XCharts/LineChart/Log Line", priority = 44)]
public static void AddLineChart_Log()
{
var chart = AddChart<LineChart>("LineChart_Log", "Log Line");
chart.DefaultLogLineChart();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5036b2e279753473a906aaaf8b369d44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using XCharts.Runtime;
using ADB = UnityEditor.AssetDatabase;
namespace XCharts.Editor
{
public partial class XChartsEditor
{
[MenuItem("XCharts/PieChart/Pie", priority = 46)]
[MenuItem("GameObject/UI/XCharts/PieChart/Pie", priority = 46)]
public static void AddPieChart()
{
AddChart<PieChart>("PieChart");
}
[MenuItem("XCharts/PieChart/Pie With Label", priority = 46)]
[MenuItem("GameObject/UI/XCharts/PieChart/Pie With Label", priority = 46)]
public static void AddPieChart_WithLabel()
{
var chart = AddChart<PieChart>("PieChart");
chart.DefaultLabelPieChart();
}
[MenuItem("XCharts/PieChart/Donut", priority = 46)]
[MenuItem("GameObject/UI/XCharts/PieChart/Donut", priority = 46)]
public static void AddPieChart_Donut()
{
var chart = AddChart<PieChart>("PieChart");
chart.DefaultDonutPieChart();
}
[MenuItem("XCharts/PieChart/Donut With Label", priority = 46)]
[MenuItem("GameObject/UI/XCharts/PieChart/Donut With Label", priority = 46)]
public static void AddPieChart_DonutWithLabel()
{
var chart = AddChart<PieChart>("PieChart");
chart.DefaultLabelDonutPieChart();
}
[MenuItem("XCharts/PieChart/Radius Rose", priority = 46)]
[MenuItem("GameObject/UI/XCharts/PieChart/Radius Rose", priority = 46)]
public static void AddPieChart_RadiusRose()
{
var chart = AddChart<PieChart>("PieChart");
chart.DefaultRadiusRosePieChart();
}
[MenuItem("XCharts/PieChart/Area Rose", priority = 46)]
[MenuItem("GameObject/UI/XCharts/PieChart/Area Rose", priority = 46)]
public static void AddPieChart_AreaRose()
{
var chart = AddChart<PieChart>("PieChart");
chart.DefaultAreaRosePieChart();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 75bcae53ea72749418444c00f6281a3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using XCharts.Runtime;
using ADB = UnityEditor.AssetDatabase;
namespace XCharts.Editor
{
public partial class XChartsEditor
{
[MenuItem("XCharts/PolarChart/Line", priority = 54)]
[MenuItem("GameObject/UI/XCharts/PolarChart/Line", priority = 54)]
public static void PolarChart()
{
AddChart<PolarChart>("PolarChart");
}
[MenuItem("XCharts/PolarChart/Radial Bar", priority = 54)]
[MenuItem("GameObject/UI/XCharts/PolarChart/Radial Bar", priority = 54)]
public static void PolarChart_RadialBar()
{
var chart = AddChart<PolarChart>("PolarChart");
chart.DefaultRadialBarPolarChart();
}
[MenuItem("XCharts/PolarChart/Tangential Bar", priority = 54)]
[MenuItem("GameObject/UI/XCharts/PolarChart/Tangential Bar", priority = 54)]
public static void PolarChart_TangentialBar()
{
var chart = AddChart<PolarChart>("PolarChart");
chart.DefaultTangentialBarPolarChart();
}
[MenuItem("XCharts/PolarChart/Heatmap", priority = 54)]
[MenuItem("GameObject/UI/XCharts/PolarChart/Heatmap", priority = 54)]
public static void PolarChart_Heatmap()
{
var chart = AddChart<PolarChart>("PolarChart");
chart.DefaultHeatmapPolarChart();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4cf6923e1dcc04bb4a077d53bf7b6a0d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -12,7 +12,7 @@ using ADB = UnityEditor.AssetDatabase;
namespace XCharts.Editor
{
public class XChartsEditor : UnityEditor.Editor
public partial class XChartsEditor : UnityEditor.Editor
{
private static Transform GetParent()
{
@@ -61,13 +61,19 @@ namespace XCharts.Editor
return name;
}
public static T AddChart<T>(string chartName) where T : BaseChart
public static T AddChart<T>(string chartName, string titleName = null) where T : BaseChart
{
XCThemeMgr.CheckReloadTheme();
return AddGraph<T>(chartName);
var chart = AddGraph<T>(chartName);
if (!string.IsNullOrEmpty(titleName))
{
var title = chart.GetChartComponent<Title>();
title.text = titleName;
}
return chart;
}
public static T AddGraph<T>(string graphName) where T : BaseGraph
public static T AddGraph<T>(string graphName) where T : Graphic
{
var parent = GetParent();
if (parent == null) return null;
@@ -90,99 +96,102 @@ namespace XCharts.Editor
}
[MenuItem("XCharts/EmptyChart", priority = 43)]
[MenuItem("GameObject/XCharts/EmptyChart", priority = 43)]
[MenuItem("GameObject/UI/XCharts/EmptyChart", priority = 43)]
public static void AddBaseChart()
{
var chart = AddChart<BaseChart>("EmptyChart");
chart.GetChartComponent<Title>().text = "EmptyChart";
AddChart<BaseChart>("EmptyChart");
}
[MenuItem("XCharts/LineChart", priority = 44)]
[MenuItem("GameObject/XCharts/LineChart", priority = 44)]
public static void AddLineChart()
{
AddChart<LineChart>("LineChart");
}
[MenuItem("XCharts/BarChart", priority = 45)]
[MenuItem("GameObject/XCharts/BarChart", priority = 45)]
public static void AddBarChart()
{
AddChart<BarChart>("BarChart");
}
[MenuItem("XCharts/PieChart", priority = 46)]
[MenuItem("GameObject/XCharts/PieChart", priority = 46)]
public static void AddPieChart()
{
AddChart<PieChart>("PieChart");
}
[MenuItem("XCharts/RadarChart", priority = 47)]
[MenuItem("GameObject/XCharts/RadarChart", priority = 47)]
[MenuItem("XCharts/RadarChart/Polygon Radar", priority = 47)]
[MenuItem("GameObject/UI/XCharts/RadarChart/Polygon Radar", priority = 47)]
public static void AddRadarChart()
{
AddChart<RadarChart>("RadarChart");
}
[MenuItem("XCharts/ScatterChart", priority = 48)]
[MenuItem("GameObject/XCharts/ScatterChart", priority = 48)]
[MenuItem("XCharts/RadarChart/Cirle Radar", priority = 47)]
[MenuItem("GameObject/UI/XCharts/RadarChart/Cirle Radar", priority = 47)]
public static void AddRadarChart_CirleRadar()
{
var chart = AddChart<RadarChart>("RadarChart");
chart.DefaultCircleRadarChart();
}
[MenuItem("XCharts/ScatterChart/Scatter", priority = 48)]
[MenuItem("GameObject/UI/XCharts/ScatterChart/Scatter", priority = 48)]
public static void AddScatterChart()
{
AddChart<ScatterChart>("ScatterChart");
}
[MenuItem("XCharts/HeatmapChart", priority = 49)]
[MenuItem("GameObject/XCharts/HeatmapChart", priority = 49)]
[MenuItem("XCharts/ScatterChart/Bubble", priority = 48)]
[MenuItem("GameObject/UI/XCharts/ScatterChart/Bubble", priority = 48)]
public static void AddScatterChart_Bubble()
{
var chart = AddChart<ScatterChart>("ScatterChart");
chart.DefaultBubbleChart();
}
[MenuItem("XCharts/HeatmapChart/Heatmap", priority = 49)]
[MenuItem("GameObject/UI/XCharts/HeatmapChart/Heatmap", priority = 49)]
public static void AddHeatmapChart()
{
AddChart<HeatmapChart>("HeatmapChart");
}
[MenuItem("XCharts/RingChart", priority = 51)]
[MenuItem("GameObject/XCharts/RingChart", priority = 51)]
[MenuItem("XCharts/HeatmapChart/Count Heatmap", priority = 49)]
[MenuItem("GameObject/UI/XCharts/HeatmapChart/Count Heatmap", priority = 49)]
public static void AddHeatmapChart_Count()
{
var chart = AddChart<HeatmapChart>("HeatmapChart");
chart.DefaultCountHeatmapChart();
}
[MenuItem("XCharts/RingChart/Ring", priority = 51)]
[MenuItem("GameObject/UI/XCharts/RingChart/Ring", priority = 51)]
public static void AddRingChart()
{
AddChart<RingChart>("RingChart");
}
[MenuItem("XCharts/CandlestickChart", priority = 54)]
[MenuItem("GameObject/XCharts/CandlestickChart", priority = 54)]
[MenuItem("XCharts/RingChart/Multiple Ring", priority = 51)]
[MenuItem("GameObject/UI/XCharts/RingChart/Multiple Ring", priority = 51)]
public static void AddRingChart_MultiRing()
{
var chart = AddChart<RingChart>("RingChart");
chart.DefaultMultipleRingChart();
}
[MenuItem("XCharts/CandlestickChart/Candlestick", priority = 54)]
[MenuItem("GameObject/UI/XCharts/CandlestickChart/Candlestick", priority = 54)]
public static void CandlestickChart()
{
AddChart<CandlestickChart>("CandlestickChart");
}
[MenuItem("XCharts/PolarChart", priority = 54)]
[MenuItem("GameObject/XCharts/PolarChart", priority = 54)]
public static void PolarChart()
{
AddChart<PolarChart>("PolarChart");
}
[MenuItem("XCharts/ParallelChart", priority = 55)]
[MenuItem("GameObject/XCharts/ParallelChart", priority = 55)]
[MenuItem("XCharts/ParallelChart/Parallel", priority = 55)]
[MenuItem("GameObject/UI/XCharts/ParallelChart/Parallel", priority = 55)]
public static void ParallelChart()
{
AddChart<ParallelChart>("ParallelChart");
}
[MenuItem("XCharts/SimplifiedLineChart", priority = 56)]
[MenuItem("GameObject/XCharts/SimplifiedLineChart", priority = 56)]
[MenuItem("XCharts/SimplifiedChart/Line", priority = 56)]
[MenuItem("GameObject/UI/XCharts/SimplifiedChart/Line", priority = 56)]
public static void SimplifiedLineChart()
{
AddChart<SimplifiedLineChart>("SimplifiedLineChart");
}
[MenuItem("XCharts/SimplifiedBarChart", priority = 57)]
[MenuItem("GameObject/XCharts/SimplifiedBarChart", priority = 57)]
[MenuItem("XCharts/SimplifiedChart/Bar", priority = 57)]
[MenuItem("GameObject/UI/XCharts/SimplifiedChart/Bar", priority = 57)]
public static void SimplifiedBarChart()
{
AddChart<SimplifiedBarChart>("SimplifiedBarChart");
}
[MenuItem("XCharts/SimplifiedCandlestickChart", priority = 58)]
[MenuItem("GameObject/XCharts/SimplifiedCandlestickChart", priority = 58)]
[MenuItem("XCharts/SimplifiedChart/Candlestick", priority = 58)]
[MenuItem("GameObject/UI/XCharts/SimplifiedChart/Candlestick", priority = 58)]
public static void SimplifiedCandlestickChart()
{
AddChart<SimplifiedCandlestickChart>("SimplifiedCandlestickChart");

View File

@@ -17,24 +17,52 @@ namespace XCharts.Example
public bool loopUpdate = false;
public float loopUpadteTime = 1f;
public int maxCache = 0;
public bool insertDataToHead = false;
BaseChart chart;
float lastAddTime;
float lastUpdateTime;
int dataCount;
int lastMaxCache = 0;
bool lastInsertDataToHead = false;
void Awake()
{
chart = gameObject.GetComponent<BaseChart>();
chart.onInit = () =>
{
dataCount = chart.GetSerie(0).dataCount;
SetMaxCache(maxCache);
SetInsertDataToHead(insertDataToHead);
lastMaxCache = maxCache;
lastInsertDataToHead = insertDataToHead;
};
}
void Start()
void SetMaxCache(int maxCache)
{
if (maxCache > 0)
chart.SetMaxCache(maxCache);
}
void SetInsertDataToHead(bool insertDataToHead)
{
foreach (var serie in chart.series)
serie.insertDataToHead = insertDataToHead;
var coms = chart.GetChartComponents<XAxis>();
if (coms != null)
{
chart.SetMaxCache(maxCache);
foreach (var com in coms)
{
var axis = com as XAxis;
if (axis.type == Axis.AxisType.Category)
{
axis.insertDataToHead = insertDataToHead;
Debug.LogError("axis:" + axis + "," + insertDataToHead);
}
}
}
dataCount = chart.GetSerie(0).dataCount;
}
void Update()
@@ -51,6 +79,16 @@ namespace XCharts.Example
{
chart.ClearData();
}
if (lastMaxCache != maxCache)
{
lastMaxCache = maxCache;
SetMaxCache(maxCache);
}
if (lastInsertDataToHead != insertDataToHead)
{
lastInsertDataToHead = insertDataToHead;
SetInsertDataToHead(insertDataToHead);
}
lastAddTime += Time.deltaTime;
if (loopAdd && lastAddTime >= loopAddTime)
{
@@ -74,24 +112,18 @@ namespace XCharts.Example
var yAxis = chart.GetChartComponent<YAxis>();
if (xAxis != null && yAxis != null)
{
chart.AddXAxisData((xAxis.data.Count + 1).ToString());
chart.AddXAxisData((xAxis.GetAddedDataCount() + 1).ToString());
for (int i = 0; i < yAxis.data.Count; i++)
{
chart.AddData(0, xAxis.data.Count - 1, i, Random.Range(10, 90));
chart.AddData(0, xAxis.GetAddedDataCount() - 1, i, Random.Range(10, 90));
}
}
return;
}
else
{
AddXAxisData();
var xAxis = chart.GetChartComponent<XAxis>();
if (xAxis != null)
{
if (xAxis.type == Axis.AxisType.Category)
{
chart.AddXAxisData("x" + (xAxis.data.Count + 1));
}
}
foreach (var serie in chart.series)
{
AddSerieRandomData(serie, xAxis);
@@ -99,6 +131,19 @@ namespace XCharts.Example
}
}
void AddXAxisData()
{
var xAxes = chart.GetChartComponents<XAxis>();
foreach (var com in xAxes)
{
var xAxis = com as XAxis;
if (xAxis.type == Axis.AxisType.Category)
{
chart.AddXAxisData("x" + (xAxis.GetAddedDataCount() + 1), xAxis.index);
}
}
}
void UpdateData()
{
foreach (var serie in chart.series)
@@ -147,7 +192,7 @@ namespace XCharts.Example
var yAxis = chart.GetChartComponent<YAxis>(serie.yAxisIndex);
for (int i = 0; i < yAxis.data.Count; i++)
{
chart.AddData(serie.index, xAxis.data.Count - 1, i, Random.Range(0, 150));
chart.AddData(serie.index, xAxis.GetAddedDataCount() - 1, i, Random.Range(0, 150));
}
}
else

View File

@@ -15,6 +15,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<BarChart>();
chart.Init();
}
var serie = chart.GetSerie(0);
serie.animation.enable = true;

View File

@@ -42,7 +42,6 @@ namespace XCharts.Example
{
var chartObject = CreateChartObject(chartName);
var chart = chartObject.AddComponent<PieChart>();
chart.Init();
chart.SetSize(580, 300);
chart.EnsureChartComponent<Title>().show = true;
@@ -64,7 +63,6 @@ namespace XCharts.Example
{
var chartObject = CreateChartObject(chartName);
var chart = chartObject.AddComponent<PieChart>();
chart.Init();
chart.SetSize(580, 300);
chart.EnsureChartComponent<Title>().show = true;

View File

@@ -40,7 +40,10 @@ namespace XCharts.Example
IEnumerator AddSimpleLine()
{
chart = gameObject.GetComponent<LineChart>();
if (chart == null) chart = gameObject.AddComponent<LineChart>();
if (chart == null){
chart = gameObject.AddComponent<LineChart>();
chart.Init();
}
chart.GetChartComponent<Title>().text = "LineChart - 折线图";
chart.GetChartComponent<Title>().subText = "普通折线图";

View File

@@ -16,6 +16,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<LineChart>();
chart.Init();
}
chart.EnsureChartComponent<Title>().show = true;
chart.EnsureChartComponent<Title>().text = "Sin Curve";

View File

@@ -25,12 +25,11 @@ namespace XCharts.Example
void AddData()
{
var chart = gameObject.GetComponent<SimplifiedLineChart>();
var chart = gameObject.GetComponent<LineChart>();
if (chart == null)
{
chart = gameObject.AddComponent<SimplifiedLineChart>();
chart = gameObject.AddComponent<LineChart>();
chart.Init();
chart.SetSize(580, 300);
}
chart.EnsureChartComponent<Title>().show = true;
chart.EnsureChartComponent<Title>().text = "Line Simple";
@@ -49,9 +48,9 @@ namespace XCharts.Example
xAxis.boundaryGap = true;
chart.RemoveData();
chart.AddSerie<SimplifiedLine>();
chart.AddSerie<SimplifiedLine>();
for (int i = 0; i < 200; i++)
chart.AddSerie<Line>();
chart.AddSerie<Line>();
for (int i = 0; i < 20; i++)
{
chart.AddXAxisData("x" + i);
chart.AddData(0, Random.Range(10, 20));

View File

@@ -38,7 +38,11 @@ namespace XCharts.Example
IEnumerator AddSimpleBar()
{
chart = gameObject.GetComponent<BarChart>();
if (chart == null) chart = gameObject.AddComponent<BarChart>();
if (chart == null)
{
chart = gameObject.AddComponent<BarChart>();
chart.Init();
}
chart.EnsureChartComponent<Title>().text = "BarChart - 柱状图";
chart.EnsureChartComponent<Title>().subText = "普通柱状图";

View File

@@ -38,7 +38,11 @@ namespace XCharts.Example
IEnumerator PieAdd()
{
chart = gameObject.GetComponent<PieChart>();
if (chart == null) chart = gameObject.AddComponent<PieChart>();
if (chart == null)
{
chart = gameObject.AddComponent<PieChart>();
chart.Init();
}
yield return null;
chart.GetChartComponent<Title>().text = "PieChart - 饼图";
chart.GetChartComponent<Title>().subText = "基础饼图";

View File

@@ -17,6 +17,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<PieChart>();
chart.Init();
}
var serieIndex = 0;
var serie = chart.GetSerie(serieIndex);

View File

@@ -40,7 +40,11 @@ namespace XCharts.Example
IEnumerator RadarAdd()
{
chart = gameObject.GetComponent<RadarChart>();
if (chart == null) chart = gameObject.AddComponent<RadarChart>();
if (chart == null)
{
chart = gameObject.AddComponent<RadarChart>();
chart.Init();
}
chart.RemoveChartComponents<RadarCoord>();
chart.RemoveData();

View File

@@ -19,6 +19,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<RadarChart>();
chart.Init();
}
}

View File

@@ -16,6 +16,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<HeatmapChart>();
chart.Init();
}
chart.GetChartComponent<Title>().text = "HeatmapChart";
chart.GetChartComponent<Tooltip>().type = Tooltip.Type.None;

View File

@@ -18,6 +18,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<BaseChart>();
chart.Init();
}
chart.EnsureChartComponent<PolarCoord>();
}
@@ -33,7 +34,7 @@ namespace XCharts.Example
void AddData()
{
chart.RemoveData();
chart.GetChartComponent<Tooltip>().type = Tooltip.Type.Corss;
chart.GetChartComponent<Tooltip>().type = Tooltip.Type.Cross;
var angleAxis = chart.GetChartComponent<AngleAxis>();
angleAxis.type = Axis.AxisType.Value;
angleAxis.minMaxType = Axis.AxisMinMaxType.Custom;

View File

@@ -19,6 +19,7 @@ namespace XCharts.Example
if (chart == null)
{
chart = gameObject.AddComponent<CandlestickChart>();
chart.Init();
}
AddData();
}

View File

@@ -45,38 +45,35 @@
![XCharts](Documentation~/zh/img/xcharts.png)
A powerful and easy-to-use data visualization library for Unity. It supports more than ten built-in charts, including line, bar, pie, radar, scatter, heatmap, ring, candlestick, polar, parallel coordinates, as well as extended charts such as 3d pie, 3d bar, 3d pyramid, funnel, gauge, liquid, pictorialbar, gantt, and treemap.
## Overview
[XCharts3.0 Homepage](https://xcharts-team.github.io)
A powerful and easy-to-use data visualization library for Unity. It supports more than ten built-in charts, including line, bar, pie, radar, scatter, heatmap, ring, candlestick, polar, parallel coordinates, as well as extended charts such as 3d pie, 3d bar, 3d pyramid, funnel, gauge, liquid, pictorialbar, gantt, treemap, sankey, line3d and graph chart.
[XCharts3.0 Tutorial](Documentation~/en/tutorial01.md)
[XCharts3.0 API](Documentation~/en/api.md)
[XCharts3.0 FAQ](Documentation~/en/faq.md)
[XCharts3.0 Configurate](Documentation~/en/configuration.md)
[XCharts3.0 Changelog](Documentation~/en/changelog.md)
[XCharts3.0 Support](Documentation~/en/support.md)
## Key Features
## Features
- __Pure Code Rendering__: Charts are rendered with pure code, eliminating the need for extra texture or shader resources.
- __Visual Configuration__: Configure parameters visually with real-time preview and support for dynamic configuration and data adjustments at runtime.
- __High Customizability__: Themes and configuration parameters can be adjusted as needed, with support for custom drawing and callbacks.
- __Built-in and Extended Charts__: Supports a variety of chart types, including 3D charts and special chart types like gauges and treemaps.
- __Multiple Chart Combinations__: Combine multiple charts of the same or different types within a single instance.
- __Various Coordinate Systems__: Supports different coordinate systems such as Cartesian, polar, and single axes.
- __Rich Components__: Includes titles, legends, tooltips, and more.
- __Custom Drawing__: Utilize a powerful API for custom drawing of points, lines, and other graphics.
- __Large Data Rendering__: Capable of rendering tens of thousands of data points with support for sampling rendering.
- __Custom Themes__: Customize themes and use the included light and dark default themes.
- __Animations and Interactions__: Supports various animations and interactions for a dynamic user experience.
- __Third-Party Extensions__: Integrates with TextMeshPro and the New Input System.
- __Version and Compatibility__: Compatible with all Unity versions above 5.6 and runs on all platforms.
* __Pure code rendering__: The chart is completely rendered with pure code, without the need for additional texture or shader resources.
* __Visual configuration__: Visual configuration of parameters with real-time preview of the effect, and support for dynamic modification of configuration and data during runtime.
* __High customizability__: Supports arbitrary adjustments from theme and configuration parameters; supports custom drawing, callback functions, and custom implementations of charts.
* __Multiple built-in charts__: Supports various built-in charts such as line charts, bar charts, pie charts, radar charts, scatter plots, heat maps, polar charts, K-line charts, parallel coordinates, etc.
* __Multiple extended charts__: Supports extended charts such as 3D column charts, 3D pie charts, funnel charts, pyramids, dashboards, water level charts, iconic bar charts, Gantt charts, and tree maps.
* __Multiple extended features__: Supports extended UI components such as tables and statistical values.
* __Multiple chart combinations__: Supports arbitrary combinations of built-in charts, with multiple same or different types of charts displayed simultaneously in the same chart.
* __Various coordinate systems__: Supports coordinate systems such as Cartesian coordinates, polar coordinates, and single axes.
* __Rich components__: Supports common components such as titles, legends, tooltips, markings, marking areas, data area zooming, and visual mapping.
* __Rich line charts__: Supports various line charts such as straight line charts, curved line charts, dashed line charts, area charts, step line charts, etc.
* __Rich bar charts__: Supports various bar charts such as stacked bar charts, stacked percentage bar charts, zebra bar charts, and capsule bar charts.
* __Rich pie charts__: Supports various pie charts such as ring charts, rose charts, ring rose charts, etc.
* __Rich lines__: Supports various lines such as solid lines, curves, step lines, dashed lines, dot lines, dotted lines, and double dot-dashed lines.
* __Custom drawing__: Supports custom chart content drawing with powerful drawing APIs for drawing points, lines, and other graphics.
* __Large data rendering__: Supports rendering of tens of thousands of data points; supports sampling rendering; special simplified charts support better performance.
* __Custom themes__: Supports theme customization and import/export; includes both light and dark default themes.
* __Animations and interactions__: Supports various animations such as fade-in animation, fade-out animation, change animation, addition animation, and * interactive animation; supports interactive operations such as data filtering, view zooming, and detailed display on multiple platforms.
* __Third-party extensions__: Supports integration with TexMeshPro and New Input System.
* __Version and compatibility__: Supports all Unity versions above 5.6 and runs on all platforms.
## Documentation
- [XCharts3.0 Homepage](https://xcharts-team.github.io)
- [XCharts3.0 Tutorial](Documentation~/en/tutorial01.md)
- [XCharts3.0 API](Documentation~/en/api.md)
- [XCharts3.0 FAQ](Documentation~/en/faq.md)
- [XCharts3.0 Configurate](Documentation~/en/configuration.md)
- [XCharts3.0 Changelog](Documentation~/en/changelog.md)
- [XCharts3.0 Support](Documentation~/en/support.md)
## Screenshots
@@ -84,55 +81,43 @@ A powerful and easy-to-use data visualization library for Unity. It supports mo
![extendchart](Documentation~/en/img/readme_extendchart.png)
## Attention
## Important Notes
* `XCharts3.0` is not fully compatible with `XCharts2.0` version, upgrading `3.0` may require some code adjustments, and some chart configurations need to be readjusting. It is recommended that old projects can continue to use `XCharts2.0`, and new projects are recommended to use `XCharts3.0`.
* `XCharts2.0` enters the maintenance phase, and only serious `bugs` will be fixed later, in principle, no more new features will be added.
* `XCharts` theoretically supports `Unity 5.6` and above, but due to limited version testing, it is inevitable to slip up, and version compatibility issues can be raised.
* This repository only contains `XCharts` source code, does not contain `Demo` sample section. Need to look at ` Demo ` please go to the sample source code [XCharts - Demo](https://github.com/XCharts-Team/XCharts-Demo) repo. You can also view the running effect of `WebGL` in your browser [Online Demo](https://xcharts-team.github.io/examples/).
- `XCharts3.0` is not fully compatible with `XCharts2.0`. Upgrading to 3.0 may require code adjustments and reconfiguration of some charts.
- `XCharts2.0` is in the maintenance phase with only critical bug fixes applied.
- While XCharts supports Unity 5.6 and above, compatibility issues may arise due to limited testing.
- This repository contains only the `XCharts` source code. For demos, visit the [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo) repo or the [Online Demo](https://xcharts-team.github.io/examples/).
## Use
## Getting Started
* Import `XCharts` unitypackage or source code into the project.
* Right-click `Hierarchy` view and choose `XCharts->LineChart` to create a default LineChart.
* You can adjust the parameters of each component in `Inspector` and see the real-time effects in `Game` view.
* For more details, see [[XCharts Tutorial: 5-minute tutorial]](Documentation~/en/tutorial01.md)
* For the first time, it is recommended to read the tutorial carefully.
1. Import the `XCharts` unitypackage or source code into your Unity project.
2. Create a chart by right-clicking in the `Hierarchy` view and selecting `UI->XCharts->LineChart`.
3. Adjust component parameters in the `Inspector` to see real-time effects in the `Game` view.
4. For more details, refer to the [5-minute tutorial](Documentation~/en/tutorial01.md).
## Branch
## Branch Information
* `master` : indicates the development branch. The latest changes and new features are first committed to the `master` branch, and after some time from the `master` branch `merge` to the `3.0` branch, and the `release` version.
* `3.0` : Stable branch of XCharts 3.0. It is generally updated once a month, with the latest changes from the `master` branch `merge`, and the `release` version is released.
* `2.0` : A stable branch of XCharts 2.0. With Demo, currently no longer maintenance, only to modify serious bugs.
* `2.0-upm` : Stable UMP branch of XCharts 2.0. Only the Package part is included without Demo. It is dedicated to the UMP and is not maintained.
* `1.0` : Stable branch of XCharts 1.0. With Demo, no maintenance.
* `1.0-upm` : stable UMP branch of XCharts 1.0. No Demo, no maintenance.
- __master__ indicates the development branch. The latest changes and new features are first committed to the `master` branch, and after some time from the `master` branch `merge` to the `3.0` branch, and the `release` version.
- __3.0__ Stable branch of XCharts 3.0. It is generally updated once a month, with the latest changes from the `master` branch `merge`, and the `release` version is released.
- __2.0__ A stable branch of XCharts 2.0. With Demo, currently no longer maintenance, only to modify serious bugs.
- __2.0-upm__ Stable UMP branch of XCharts 2.0. Only the Package part is included without Demo. It is dedicated to the UMP and is not maintained.
- __1.0__ Stable branch of XCharts 1.0. With Demo, no maintenance.
- __1.0-upm__ stable UMP branch of XCharts 1.0. No Demo, no maintenance.
## FAQ
* Is `XCharts` free to use?
A: `XCharts` uses the `MIT` licence and is free to use. You can also subscribe to `VIP` to enjoy more value-added services.
* Does `XCharts` support code to dynamically add and modify data? Does it support getting data from `Excel` or a database?
A: Support code to dynamically add and modify data, but data needs to be parsed or retrieved by itself, and then added to `XCharts` by calling the public interface of `XCharts`.
* Does this plugin work on other platforms (e.g. Winform or WPF) besides Unity?
A: It is currently only supported on Unity. Theoretically any version of Unity that supports `UGUI` can run `XCharts`.
* What about the jags? What magnitude of data is supported?
A: XCharts is based on UGUI implementation, so the problems encountered in UGUI will also exist in XCharts. For example, the sawtooth problem, such as the number of vertices in `Mesh` exceeds `65535`. Solutions to these two problems can be found in [Q&A 16](Documentation~/en/faq.md) and [Q&A 27](Documentation~/en/faq.md).
Due to the `Mesh` of the `65535` vertex limit, the current `XCharts` single `Line` supports about `20,000` of data, of course, open sampling can support more data to draw, but at the same time it will consume more CPU.
- __Is XCharts free to use?__ Yes, XCharts is free under the MIT license and includes value-added VIP services.
- __Does XCharts support dynamic data addition and modification?__ Yes, but data must be parsed or retrieved by the user.
- __Does this plugin work on platforms other than Unity?__ No, it is designed for Unity only.
## Changelog
* [Changelog](Documentation~/en/changelog.md)
- [Changelog](Documentation~/en/changelog.md)
## Licenses
* [MIT License](https://github.com/XCharts-Team/XCharts/blob/master/LICENSE.md)
* Free commercial, secondary development
* The extended charts and advanced features sections require a separate purchase license
- XCharts is released under the [MIT License](https://github.com/XCharts-Team/XCharts/blob/master/LICENSE.md).
## Other
## Contact
email: `monitor1394@gmail.com`
- For more information or support, contact us at `monitor1394@gmail.com`.

132
README.md
View File

@@ -45,26 +45,26 @@
![XCharts](Documentation~/zh/img/xcharts.png)
一款基于`UGUI`的功能强大简单易用的数据可视化图表插件。支持`折线图``柱状图``饼图``雷达图``散点图``热力图``环形图``K线图``极坐标``平行坐标`等十种内置图表,以及`3D饼图``3D柱图``3D金字塔``漏斗图``仪表盘``水位图``象形柱图``甘特图``矩形树图`扩展图表。
一款基于`UGUI`的功能强大简单易用的`Unity`数据可视化图表插件。支持`折线图``柱状图``饼图``雷达图``散点图``热力图``环形图``K线图``极坐标``平行坐标`等十种内置图表,以及`3D饼图``3D柱图``3D金字塔``漏斗图``仪表盘``水位图``象形柱图``甘特图``矩形树图``桑基图``3D折线图``关系图`等十几种扩展图表。
[XCharts 官方主页](https://xcharts-team.github.io)
[XCharts 在线示例](https://xcharts-team.github.io/examples)
[XCharts 教程5分钟上手 XCharts](Documentation~/zh/tutorial01.md)
[XCharts API文档](Documentation~/zh/api.md)
[XCharts 问答](Documentation~/zh/faq.md)
[XCharts 常见问题](Documentation~/zh/faq.md)
[XCharts 配置项手册](Documentation~/zh/configuration.md)
[XCharts 更新日志](Documentation~/zh/changelog.md)
[XCharts 订阅服务](Documentation~/zh/support.md)
## 特性
- __纯代码绘制__图表完全纯代码绘制无需额外的贴图和Shader资源。
- __可视化配置__参数可视化配置效果实时预览支持运行时代码动态修改配置和数据。
- __纯代码绘制__图表纯代码绘制无需额外的贴图和Shader资源。
- __可视化配置__参数可视化配置效果实时预览支持运行时代码动态修改配置和数据。
- __高自由定制__支持从主题和配置参数上任意调整支持代码自定义绘制自定义回调以及自定义实现图表。
- __多内置图表__支持线图、柱状图、饼图、雷达图、散点图、热力图、环形图、K线图、极坐标、平行坐标等多种内置图表。
- __多扩展图表__支持3D柱图、3D饼图、漏斗图、金字塔、仪表盘、水位图、象形柱图、甘特图、矩形树图等多种扩展图表。
- __多扩展组件__支持表格、统计数值等扩展UI组件。
- __多扩展图表__支持3D柱图、3D饼图、漏斗图、金字塔、仪表盘、水位图、象形柱图、甘特图、矩形树图、桑基图、3D折线图、关系图等多种扩展图表。
- __多扩展组件__支持表格、统计数值等多种扩展UI组件。
- __多图表组合__支持内置图表的任意组合同一图中可同时显示多个相同或不同类型的图表。
- __多种坐标系__支持直角坐标系、极坐标系、单轴等多种坐标系。
- __丰富的组件__支持标题、图例、提示框、标线、标域、数据区域缩放、视觉映射等常用组件。
@@ -85,92 +85,86 @@
![扩展图表](Documentation~/zh/img/readme_extendchart.png)
## 注意
- `XCharts3.0` 不完全兼容 `XCharts2.0` 版本,升级`3.0`时,部分代码和配置可能需要重新调整。建议旧项目可以继续使用`XCharts2.0`,新项目推荐使用`XCharts3.0`
- `XCharts2.0` 进入维护阶段,后续只修复严重`bug`,原则上不再加新功能。
- `XCharts` 理论上支持`Unity 5.6`及以上版本,但由于版本测试有限难免疏漏,发现版本兼容问题可提`Issue`
- 本仓库只包含`XCharts`源码,不包含`Demo`示例部分。需要查看`Demo`示例源码请到[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)仓库。也可以在浏览器查看`WebGL`下的运行效果 [在线Demo](https://xcharts-team.github.io/examples/) 。
## 仓库
- [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官方示例,不包含扩展图表部分。订阅VIP的用户购买扩展图表后,可加入对应图表的示例。
- [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柱图。订阅VIP后可单独购买。
- [XCharts-FunnelChart](https://github.com/XCharts-Team/XCharts-FunnelChart)XCharts扩展图表漏斗图。订阅VIP后可单独购买。
- [XCharts-GanttChart](https://github.com/XCharts-Team/XCharts-GanttChart)XCharts扩展图表甘特图。订阅VIP后可单独购买。
- [XCharts-GaugeChart](https://github.com/XCharts-Team/XCharts-GaugeChart)XCharts扩展图表仪表盘。订阅VIP后可单独购买。
- [XCharts-LiquidChart](https://github.com/XCharts-Team/XCharts-LiquidChart)XCharts扩展图表水位图。订阅VIP后可单独购买。
- [XCharts-PictorialBarChart](https://github.com/XCharts-Team/XCharts-PictorialBarChart)XCharts扩展图表象形住图。订阅VIP后可单独购买。
- [XCharts-Pie3DChart](https://github.com/XCharts-Team/XCharts-Pie3DChart)XCharts扩展图表3D饼图。订阅VIP后可单独购买。
- [XCharts-PyramidChart](https://github.com/XCharts-Team/XCharts-PyramidChart)XCharts扩展图表3D金字塔。订阅VIP后可单独购买。
- [XCharts-TreemapChart](https://github.com/XCharts-Team/XCharts-TreemapChart)XCharts扩展图表矩形树图。订阅VIP后可单独购买。
- [XCharts-Bar3DChart-Demo](https://github.com/XCharts-Team/XCharts-Bar3DChart-Demo)3D柱图的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-FunnelChart-Demo](https://github.com/XCharts-Team/XCharts-FunnelChart-Demo)漏斗图的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-GanttChart-Demo](https://github.com/XCharts-Team/XCharts-GanttChart-Demo)甘特图的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-GaugeChart-Demo](https://github.com/XCharts-Team/XCharts-GaugeChart-Demo)仪表盘的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-LiquidChart-Demo](https://github.com/XCharts-Team/XCharts-LiquidChart-Demo)水位图的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-PictorialBarChart-Demo](https://github.com/XCharts-Team/XCharts-PictorialBarChart-Demo)象形住图的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-Pie3DChart-Demo](https://github.com/XCharts-Team/XCharts-Pie3DChart-Demo)3D饼图的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-PyramidChart-Demo](https://github.com/XCharts-Team/XCharts-PyramidChart-Demo)3D金字塔的示例。订阅VIP可访问可导入XCharts-Demo使用。
- [XCharts-TreemapChart-Demo](https://github.com/XCharts-Team/XCharts-TreemapChart-Demo)矩形树图的示例。订阅VIP可访问可导入XCharts-Demo使用。
## 使用
- 导入`XCharts``unitypackage`或者源码到项目。建议也导入`XCharts`守护程序[XCharts-Daemon](https://github.com/XCharts-Team/XCharts-Daemon)。
-`Hierarchy`视图下右键选择`XCharts->LineChart`,即可创建一个默认的折线图。
-`Inspector`视图下的`Add Serie``Add Main Component`按钮可以添加`Serie``组件`
-`Inspector`视图可以调整各个组件的参数,`Game`视图可看到实时效果。
- 更多细节,请看[【XCharts教程5分钟上手教程】](Documentation~/zh/tutorial01.md)
- 首次使用,建议先认真看一遍教程。
- __[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`开发分支。最新的修改和功能都先提交到`master`分支,一段时间后再从`master`分支`merge``3.0`分支,并发布`release`版本。
- `3.0`XCharts 3.0的稳定分支。一般一个月一更新,从`master`分支`merge`最新改动过来,并发布`release`版本。
- `2.0`XCharts 2.0的稳定分支。带Demo目前基本不再维护仅修改严重bug。
- `2.0-upm`XCharts 2.0的稳定UMP分支。不带Demo只包含Package部分专门给UMP用不再维护。
- `1.0`XCharts 1.0的稳定分支。带Demo不再维护。
- `1.0-upm`XCharts 1.0的稳定UMP分支。不带Demo不再维护。
- __[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)。
-`Hierarchy`视图下右键选择`XCharts->LineChart`,即可创建一个默认的折线图。
-`Inspector`视图下的`Add Serie``Add Main Component`按钮可以添加`Serie``组件`
-`Inspector`视图下可以调整各个组件的参数,`Game`视图可看到实时效果。
- 更多细节,请看[【XCharts教程5分钟上手教程】](Documentation~/zh/tutorial01.md)。
- 首次使用,建议先认真看一遍教程。
## 注意
- __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/) 。
## FAQ
- `XCharts`可以免费使用吗?
答:`XCharts`使用`MIT`协议,可以免费使用。也可以订阅`VIP`享受更多增值服务。
- __XCharts可以免费使用吗__
`XCharts`使用`MIT`协议,可以免费使用。也可以订阅`VIP`享受更多增值服务。
- `XCharts`支持代码动态添加和修改数据吗?支持从`Excel`或数据库中获取数据吗?
答:`XCharts`提供了各种数据操作的接口,支持代码动态修改配置,添加和修改数据,但数据来源需要自己解析和获取,再调用`XCharts`的接口添加到图表。
- __XCharts支持代码动态添加和修改数据吗支持从`Excel`或数据库中获取数据吗?__
`XCharts`提供了各种数据操作的接口,支持代码动态修改配置,添加和修改数据,但数据来源需要自己解析和获取,再调用`XCharts`的接口添加到图表。
- `XCharts`除了用在`Unity`平台,还能用在`Winform``WPF`等平台吗?
答:`XCharts`只支持在`Unity`平台使用。理论上任何支持`UGUI``Unity`版本都能运行`XCharts`
- __XCharts除了用在Unity平台还能用在WinformWPF等平台吗__
`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。
- __锯齿怎么解决?支持多大量级的数据?__
`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
- [MIT License](https://github.com/XCharts-Team/XCharts/blob/master/LICENSE.md)
- 可免费商用,可二次开发
- 扩展图表和高级功能部分需单独购买授权
## 日志
- [更新日志](Documentation~/zh/changelog.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)

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Bar chart shows different data through the height of a bar, which is used in rectangular coordinate with at least 1 category axis.
/// || 柱状图(或称条形图)是一种通过柱形的高度(横向的情况下则是宽度)来表现数据大小的一种常用图表类型。
/// </summary>
[AddComponentMenu("XCharts/BarChart", 14)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -22,5 +26,153 @@ namespace XCharts.Runtime
AddXAxisData("x" + (i + 1));
}
}
/// <summary>
/// default zebra column chart.
/// || 斑马柱状图。
/// </summary>
public void DefaultZebraColumnChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.barType = BarType.Zebra;
}
/// <summary>
/// default capsule column chart.
/// || 胶囊柱状图。
/// </summary>
public void DefaultCapsuleColumnChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.barType = BarType.Capsule;
}
/// <summary>
/// default grouped column chart.
/// || 默认分组柱状图。
/// </summary>
public void DefaultGroupedColumnChart()
{
CheckChartInit();
Bar.AddDefaultSerie(this, GenerateDefaultSerieName());
}
/// <summary>
/// default stacked column chart.
/// || 默认堆叠分组柱状图。
/// </summary>
public void DefaultStackedColumnChart()
{
CheckChartInit();
var serie1 = GetSerie(0);
serie1.stack = "stack1";
var serie2 = Bar.AddDefaultSerie(this, GenerateDefaultSerieName());
serie2.stack = "stack1";
}
/// <summary>
/// default percent column chart.
/// || 默认百分比柱状图。
/// </summary>
public void DefaultPercentColumnChart()
{
CheckChartInit();
var serie1 = GetSerie(0);
serie1.stack = "stack1";
serie1.barPercentStack = true;
var serie2 = Bar.AddDefaultSerie(this, GenerateDefaultSerieName());
serie2.stack = "stack1";
serie2.barPercentStack = true;
}
/// <summary>
/// default bar chart.
/// || 默认条形图。
/// </summary>
public void DefaultBarChart()
{
CheckChartInit();
CovertColumnToBar(this);
}
/// <summary>
/// default zebra bar chart.
/// || 默认斑马条形图。
/// </summary>
public void DefaultZebraBarChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.barType = BarType.Zebra;
CovertColumnToBar(this);
}
/// <summary>
/// default capsule bar chart.
/// || 默认胶囊条形图。
/// </summary>
public void DefaultCapsuleBarChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.barType = BarType.Capsule;
CovertColumnToBar(this);
}
/// <summary>
/// default grouped bar chart.
/// || 默认分组条形图。
/// </summary>
public void DefaultGroupedBarChart()
{
CheckChartInit();
Bar.AddDefaultSerie(this, GenerateDefaultSerieName());
CovertColumnToBar(this);
}
/// <summary>
/// default stacked bar chart.
/// || 默认堆叠条形图。
/// </summary>
public void DefaultStackedBarChart()
{
CheckChartInit();
var serie1 = GetSerie(0);
serie1.stack = "stack1";
var serie2 = Bar.AddDefaultSerie(this, GenerateDefaultSerieName());
serie2.stack = "stack1";
CovertColumnToBar(this);
}
/// <summary>
/// default percent bar chart.
/// || 默认百分比条形图。
/// </summary>
public void DefaultPercentBarChart()
{
CheckChartInit();
var serie1 = GetSerie(0);
serie1.stack = "stack1";
serie1.barPercentStack = true;
var serie2 = Bar.AddDefaultSerie(this, GenerateDefaultSerieName());
serie2.stack = "stack1";
serie2.barPercentStack = true;
CovertColumnToBar(this);
}
private static void CovertColumnToBar(BarChart chart)
{
chart.ConvertXYAxis(0);
var xAxis = chart.GetChartComponent<XAxis>();
xAxis.axisLine.show = false;
xAxis.axisTick.show = false;
var yAxis = chart.GetChartComponent<YAxis>();
yAxis.axisTick.alignWithLabel = true;
}
}
}

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// A candlestick chart is a style of financial chart used to describe price movements of a security, derivative, or currency.
/// || 蜡烛图也叫K线图用于描述证券、衍生品或货币的价格走势的一种金融图表样式。
/// </summary>
[AddComponentMenu("XCharts/CandlestickChart", 23)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]

View File

@@ -3,6 +3,12 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Heat map mainly use colors to represent values, which must be used along with visualMap component.
/// It can be used in either rectangular coordinate or geographic coordinate. But the behaviour on them are quite different. Rectangular coordinate must have two categories to use it.
/// ||热力图主要通过颜色去表现数值的大小,必须要配合 visualMap 组件使用。
/// 可以应用在直角坐标系以及地理坐标系上,这两个坐标系上的表现形式相差很大,直角坐标系上必须要使用两个类目轴。
/// </summary>
[AddComponentMenu("XCharts/HeatmapChart", 18)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -13,23 +19,26 @@ namespace XCharts.Runtime
protected override void DefaultChart()
{
var grid = EnsureChartComponent<GridCoord>();
grid.UpdateRuntimeData(this);
grid.left = 0.12f;
var heatmapGridWid = 18f;
int xSplitNumber = (int)(grid.context.width / heatmapGridWid);
int ySplitNumber = (int)(grid.context.height / heatmapGridWid);
var xAxis = EnsureChartComponent<XAxis>();
xAxis.type = Axis.AxisType.Category;
xAxis.splitLine.show = false;
xAxis.boundaryGap = true;
xAxis.splitNumber = 10;
xAxis.splitNumber = xSplitNumber / 2;
var yAxis = EnsureChartComponent<YAxis>();
yAxis.type = Axis.AxisType.Category;
yAxis.splitLine.show = false;
yAxis.boundaryGap = true;
yAxis.splitNumber = 10;
yAxis.splitNumber = ySplitNumber;
RemoveData();
var heatmapGridWid = 10f;
int xSplitNumber = (int) (grid.context.width / heatmapGridWid);
int ySplitNumber = (int) (grid.context.height / heatmapGridWid);
Heatmap.AddDefaultSerie(this, GenerateDefaultSerieName());
var visualMap = EnsureChartComponent<VisualMap>();
@@ -72,5 +81,32 @@ namespace XCharts.Runtime
}
}
}
/// <summary>
/// default count heatmap chart.
/// || 默认计数热力图。
/// </summary>
public void DefaultCountHeatmapChart()
{
CheckChartInit();
var serie = GetSerie<Heatmap>(0);
serie.heatmapType = HeatmapType.Count;
var xAxis = GetChartComponent<XAxis>();
xAxis.type = Axis.AxisType.Value;
xAxis.splitNumber = 4;
var yAxis = GetChartComponent<YAxis>();
yAxis.type = Axis.AxisType.Value;
yAxis.splitNumber = 2;
serie.ClearData();
for (int i = 0; i < 100; i++)
{
var x = UnityEngine.Random.Range(0, 100);
var y = UnityEngine.Random.Range(0, 100);
AddData(0, x, y);
}
}
}
}

View File

@@ -2,6 +2,12 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Line chart relates all the data points symbol by broken lines, which is used to show the trend of data changing.
/// It could be used in both rectangular coordinate andpolar coordinate.
/// ||折线图是用折线将各个数据点标志连接起来的图表,用于展现数据的变化趋势。可用于直角坐标系和极坐标系上。
/// 设置 areaStyle 后可以绘制面积图。
/// </summary>
[AddComponentMenu("XCharts/LineChart", 13)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -22,5 +28,119 @@ namespace XCharts.Runtime
AddXAxisData("x" + (i + 1));
}
}
/// <summary>
/// default area line chart.
/// || 默认面积折线图。
/// </summary>
public void DefaultAreaLineChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.EnsureComponent<AreaStyle>();
}
/// <summary>
/// default smooth line chart.
/// || 默认平滑折线图。
/// </summary>
public void DefaultSmoothLineChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.lineType = LineType.Smooth;
}
/// <summary>
/// default smooth area line chart.
/// || 默认平滑面积折线图。
/// </summary>
public void DefaultSmoothAreaLineChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.EnsureComponent<AreaStyle>();
serie.lineType = LineType.Smooth;
}
/// <summary>
/// default stack line chart.
/// || 默认堆叠折线图。
/// </summary>
public void DefaultStackLineChart()
{
CheckChartInit();
var serie1 = GetSerie(0);
if (serie1 == null) return;
serie1.stack = "stack1";
var serie2 = Line.AddDefaultSerie(this, GenerateDefaultSerieName());
serie2.stack = "stack1";
}
/// <summary>
/// default stack area line chart.
/// || 默认堆叠面积折线图。
/// </summary>
public void DefaultStackAreaLineChart()
{
CheckChartInit();
var serie1 = GetSerie(0);
if (serie1 == null) return;
serie1.EnsureComponent<AreaStyle>();
serie1.stack = "stack1";
var serie2 = Line.AddDefaultSerie(this, GenerateDefaultSerieName());
serie2.EnsureComponent<AreaStyle>();
serie2.stack = "stack1";
}
/// <summary>
/// default step line chart.
/// || 默认阶梯折线图。
/// </summary>
public void DefaultStepLineChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.lineType = LineType.StepMiddle;
}
/// <summary>
/// default dash line chart.
/// || 默认虚线折线图。
/// </summary>
public void DefaultDashLineChart()
{
CheckChartInit();
var serie = GetSerie(0);
if (serie == null) return;
serie.lineType = LineType.Normal;
serie.lineStyle.type = LineStyle.Type.Dashed;
}
/// <summary>
/// default time line chart.
/// || 默认时间折线图。
/// </summary>
public void DefaultTimeLineChart()
{
CheckChartInit();
var xAxis = GetChartComponent<XAxis>();
xAxis.type = Axis.AxisType.Time;
}
/// <summary>
/// default logarithmic line chart.
/// || 默认对数轴折线图。
/// </summary>
public void DefaultLogLineChart()
{
CheckChartInit();
var yAxis = GetChartComponent<YAxis>();
yAxis.type = Axis.AxisType.Log;
}
}
}

View File

@@ -3,6 +3,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Parallel Coordinates is a common way of visualizing high-dimensional geometry and analyzing multivariate data.
/// || 平行坐标系,通过绘制垂直于坐标轴的平行线来显示数据的一种可视化图表。
/// </summary>
[AddComponentMenu("XCharts/ParallelChart", 25)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// The pie chart is mainly used for showing proportion of different categories. Each arc length represents the proportion of data quantity.
/// || 饼图主要用于显示不同类目占比的情况,通过弧长来反映数据的大小占比。
/// </summary>
[AddComponentMenu("XCharts/PieChart", 15)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -17,5 +21,69 @@ namespace XCharts.Runtime
RemoveData();
Pie.AddDefaultSerie(this, GenerateDefaultSerieName());
}
/// <summary>
/// default label pie chart.
/// || 默认带标签饼图。
/// </summary>
public void DefaultLabelPieChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.EnsureComponent<LabelStyle>();
serie.EnsureComponent<LabelLine>();
}
/// <summary>
/// default donut pie chart.
/// || 默认甜甜圈饼图。
/// </summary>
public void DefaultDonutPieChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.radius[0] = 0.20f;
serie.radius[1] = 0.28f;
}
/// <summary>
/// default label donut pie chart.
/// || 默认带标签甜甜圈饼图。
/// </summary>
public void DefaultLabelDonutPieChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.radius[0] = 0.20f;
serie.radius[1] = 0.28f;
serie.EnsureComponent<LabelStyle>();
serie.EnsureComponent<LabelLine>();
}
/// <summary>
/// default rose pie chart.
/// || 默认玫瑰饼图。
/// </summary>
public void DefaultRadiusRosePieChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.pieRoseType = RoseType.Radius;
serie.EnsureComponent<LabelStyle>();
serie.EnsureComponent<LabelLine>();
}
/// <summary>
/// default area rose pie chart.
/// || 默认面积玫瑰饼图。
/// </summary>
public void DefaultAreaRosePieChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.pieRoseType = RoseType.Area;
serie.EnsureComponent<LabelStyle>();
serie.EnsureComponent<LabelLine>();
}
}
}

View File

@@ -1,7 +1,12 @@
using UnityEngine;
using System.Collections.Generic;
namespace XCharts.Runtime
{
/// <summary>
/// Polar coordinates are usually used in a circular layout.
/// || 极坐标系,可以用于散点图和折线图。
/// </summary>
[AddComponentMenu("XCharts/PolarChart", 23)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -13,16 +18,18 @@ namespace XCharts.Runtime
{
EnsureChartComponent<PolarCoord>();
EnsureChartComponent<AngleAxis>();
EnsureChartComponent<RadiusAxis>();
var radiusAxis = EnsureChartComponent<RadiusAxis>();
radiusAxis.axisLabel.show = false;
var tooltip = EnsureChartComponent<Tooltip>();
tooltip.type = Tooltip.Type.Corss;
tooltip.type = Tooltip.Type.Cross;
tooltip.trigger = Tooltip.Trigger.Axis;
RemoveData();
var serie = Line.AddDefaultSerie(this, GenerateDefaultSerieName());
serie.SetCoord<PolarCoord>();
serie.ClearData();
serie.symbol.show = false;
for (int i = 0; i <= 360; i++)
{
var t = i / 180f * Mathf.PI;
@@ -30,5 +37,132 @@ namespace XCharts.Runtime
AddData(0, Mathf.Abs(r), i);
}
}
/// <summary>
/// default radial bar polar chart.
/// || 默认径向柱状极坐标图。
/// </summary>
public void DefaultRadialBarPolarChart()
{
CheckChartInit();
RemoveData();
var polarCoord = GetChartComponent<PolarCoord>();
polarCoord.radius[0] = 20;
var categorys = new string[] { "a", "b", "c", "d" };
var radiusAxis = GetChartComponent<RadiusAxis>();
radiusAxis.splitNumber = 4;
var angleAxis = GetChartComponent<AngleAxis>();
angleAxis.type = Axis.AxisType.Category;
angleAxis.startAngle = 75;
angleAxis.boundaryGap = true;
angleAxis.splitLine.show = false;
foreach (var category in categorys)
angleAxis.AddData(category);
var serie = AddSerie<Bar>(GenerateDefaultSerieName());
serie.SetCoord<PolarCoord>();
serie.ClearData();
serie.symbol.show = false;
for (int i = 0; i < categorys.Length; i++)
{
var x = UnityEngine.Random.Range(0f, 4f);
var y = i;
AddData(0, x, y, categorys[i]);
}
}
/// <summary>
/// default tangential bar polar chart.
/// || 默认切向柱状极坐标图。
/// </summary>
public void DefaultTangentialBarPolarChart()
{
CheckChartInit();
RemoveData();
var polarCoord = GetChartComponent<PolarCoord>();
polarCoord.radius[0] = 20;
var categorys = new string[] { "a", "b", "c", "d" };
var radiusAxis = GetChartComponent<RadiusAxis>();
radiusAxis.type = Axis.AxisType.Category;
radiusAxis.splitNumber = 4;
radiusAxis.boundaryGap = true;
var angleAxis = GetChartComponent<AngleAxis>();
angleAxis.type = Axis.AxisType.Value;
radiusAxis.splitNumber = 12;
angleAxis.startAngle = 75;
angleAxis.max = 4;
foreach (var category in categorys)
radiusAxis.AddData(category);
var serie = AddSerie<Bar>(GenerateDefaultSerieName());
serie.SetCoord<PolarCoord>();
serie.ClearData();
serie.symbol.show = false;
for (int i = 0; i < categorys.Length; i++)
{
var x = UnityEngine.Random.Range(0f, 4f);
var y = i;
AddData(0, y, x, categorys[i]);
}
}
/// <summary>
/// default heatmap polar chart.
/// || 默认极坐标色块图。
/// </summary>
public void DefaultHeatmapPolarChart()
{
CheckChartInit();
RemoveData();
var visualMap = EnsureChartComponent<VisualMap>();
var colors = new List<string> { "#BAE7FF", "#1890FF", "#1028ff" };
visualMap.AddColors(colors);
visualMap.autoMinMax = true;
var polarCoord = GetChartComponent<PolarCoord>();
polarCoord.radius[0] = 20;
var categorys = new string[] { "a", "b", "c", "d" };
var radiusAxis = GetChartComponent<RadiusAxis>();
radiusAxis.type = Axis.AxisType.Category;
radiusAxis.splitNumber = 4;
radiusAxis.boundaryGap = true;
var angleAxis = GetChartComponent<AngleAxis>();
angleAxis.type = Axis.AxisType.Category;
angleAxis.boundaryGap = true;
angleAxis.splitNumber = 24;
angleAxis.startAngle = 75;
angleAxis.max = 4;
foreach (var category in categorys)
radiusAxis.AddData(category);
for (int i = 0; i < 24; i++)
{
angleAxis.AddData(i + "h");
}
var serie = AddSerie<Heatmap>(GenerateDefaultSerieName());
serie.SetCoord<PolarCoord>();
serie.ClearData();
serie.symbol.show = false;
for (int x = 0; x < 4; x++)
{
for (int y = 0; y < 24; y++)
{
AddData(0, x, y, UnityEngine.Random.Range(0f, 4f));
}
}
}
}
}

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Radar chart is mainly used to show multi-variable data, such as the analysis of a football player's varied attributes. It relies radar component.
/// || 雷达图主要用于显示多变量的数据,例如足球运动员的各项属性分析。依赖雷达组件。
/// </summary>
[AddComponentMenu("XCharts/RadarChart", 16)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -16,5 +20,16 @@ namespace XCharts.Runtime
AddChartComponent<RadarCoord>();
Radar.AddDefaultSerie(this, GenerateDefaultSerieName());
}
/// <summary>
/// default circle radar chart.
/// || 默认圆形雷达图。
/// </summary>
public void DefaultCircleRadarChart()
{
CheckChartInit();
var radarCoord = GetChartComponent<RadarCoord>();
radarCoord.shape = RadarCoord.Shape.Circle;
}
}
}

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Ring chart is mainly used to show the proportion of each item and the relationship between the items.
/// || 环形图主要用于显示每一项的比例以及各项之间的关系。
/// </summary>
[AddComponentMenu("XCharts/RingChart", 20)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -15,5 +19,18 @@ namespace XCharts.Runtime
RemoveData();
Ring.AddDefaultSerie(this, GenerateDefaultSerieName());
}
/// <summary>
/// default multiple ring chart.
/// || 默认多圆环图。
/// </summary>
public void DefaultMultipleRingChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.label.show = false;
AddData(0, UnityEngine.Random.Range(30, 90), 100, "data2");
AddData(0, UnityEngine.Random.Range(30, 90), 100, "data3");
}
}
}

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Scatter chart is mainly used to show the relationship between two data dimensions.
/// || 散点图主要用于展现两个数据维度之间的关系。
/// </summary>
[AddComponentMenu("XCharts/ScatterChart", 17)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
@@ -24,5 +28,21 @@ namespace XCharts.Runtime
RemoveData();
Scatter.AddDefaultSerie(this, GenerateDefaultSerieName());
}
/// <summary>
/// default bubble chart.
/// || 默认气泡图。
/// </summary>
public void DefaultBubbleChart()
{
CheckChartInit();
var serie = GetSerie(0);
serie.itemStyle.borderWidth = 2f;
serie.itemStyle.borderColor = theme.GetColor(0);
serie.itemStyle.opacity = 0.35f;
serie.symbol.sizeType = SymbolSizeType.FromData;
serie.symbol.dataScale = 0.3f;
serie.symbol.maxSize = 30f;
}
}
}

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// A simplified bar chart is a simplified mode of a bar chart that provides better performance by simplifying components and configurations.
/// || 简化柱状图是柱状图的简化模式,通过简化组件和配置,拥有更好的性能。
/// </summary>
[AddComponentMenu("XCharts/SimplifiedBarChart", 27)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// A simplified candlestick chart is a simplified mode of a bar chart that provides better performance by simplifying components and configurations.
/// || 简化K线图是K线图的简化模式通过简化组件和配置拥有更好的性能。
/// </summary>
[AddComponentMenu("XCharts/SimplifiedCandlestickChart", 28)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]

View File

@@ -2,6 +2,10 @@ using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// A simplified line chart is a simplified mode of a bar chart that provides better performance by simplifying components and configurations.
/// || 简化折线图是折线图的简化模式,通过简化组件和配置,拥有更好的性能。
/// </summary>
[AddComponentMenu("XCharts/SimplifiedLineChart", 26)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]

View File

@@ -86,7 +86,18 @@ namespace XCharts.Runtime
/// The type of animation.
/// ||动画类型。
/// </summary>
public AnimationType type { get { return m_Type; } set { m_Type = value; } }
public AnimationType type
{
get { return m_Type; }
set
{
m_Type = value;
if (m_Type != AnimationType.Default)
{
context.type = m_Type;
}
}
}
/// <summary>
/// Whether to set graphic number threshold to animation. Animation will be disabled when graphic number is larger than threshold.
/// ||是否开启动画的阈值,当单个系列显示的图形数量大于这个阈值时会关闭动画。

View File

@@ -37,7 +37,7 @@ namespace XCharts.Runtime
animationType = attribute.type;
enableSerieDataAnimation = attribute.enableSerieDataAddedAnimation;
}
UpdateAnimationType(serie.animation, animationType,enableSerieDataAnimation);
UpdateAnimationType(serie.animation, animationType, enableSerieDataAnimation);
}
public static void UpdateAnimationType(AnimationStyle animation, AnimationType defaultType, bool enableSerieDataAnimation)
@@ -48,12 +48,12 @@ namespace XCharts.Runtime
animation.context.enableSerieDataAddedAnimation = enableSerieDataAnimation;
}
public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip)
public static bool GetAnimationPosition(AnimationStyle animation, bool isY, Vector3 lp, Vector3 cp, float progress, ref Vector3 ip, ref float rate)
{
if (animation.context.type == AnimationType.AlongPath)
{
var dist = Vector3.Distance(lp, cp);
var rate = (dist - animation.context.currentPathDistance + animation.GetCurrDetail()) / dist;
rate = (dist - animation.context.currentPathDistance + animation.GetCurrDetail()) / dist;
ip = Vector3.Lerp(lp, cp, rate);
return true;
}
@@ -62,7 +62,15 @@ namespace XCharts.Runtime
var startPos = isY ? new Vector3(-10000, progress) : new Vector3(progress, -10000);
var endPos = isY ? new Vector3(10000, progress) : new Vector3(progress, 10000);
return UGLHelper.GetIntersection(lp, cp, startPos, endPos, ref ip);
if (UGLHelper.GetIntersection(lp, cp, startPos, endPos, ref ip))
{
rate = Vector3.Distance(lp, ip) / Vector3.Distance(lp, cp);
return true;
}
else
{
return false;
}
}
}
}

View File

@@ -75,7 +75,8 @@ namespace XCharts.Runtime
Left,
Right,
Bottom,
Top
Top,
Center
}
[SerializeField] protected bool m_Show = true;
@@ -98,6 +99,7 @@ namespace XCharts.Runtime
[SerializeField] protected bool m_Inverse = false;
[SerializeField] private bool m_Clockwise = true;
[SerializeField] private bool m_InsertDataToHead;
[SerializeField][Since("v3.11.0")] private float m_MinCategorySpacing = 0;
[SerializeField] protected List<Sprite> m_Icons = new List<Sprite>();
[SerializeField] protected List<string> m_Data = new List<string>();
[SerializeField] protected AxisLine m_AxisLine = AxisLine.defaultAxisLine;
@@ -405,6 +407,15 @@ namespace XCharts.Runtime
get { return m_InsertDataToHead; }
set { if (PropertyUtil.SetStruct(ref m_InsertDataToHead, value)) SetAllDirty(); }
}
/// <summary>
/// The minimum spacing between categories.
/// ||类目之间的最小间距。
/// </summary>
public float minCategorySpacing
{
get { return m_MinCategorySpacing; }
set { if (PropertyUtil.SetStruct(ref m_MinCategorySpacing, value)) SetAllDirty(); }
}
public override bool vertsDirty
{
@@ -458,6 +469,17 @@ namespace XCharts.Runtime
base.SetComponentDirty();
}
/// <summary>
/// 重置状态。
/// </summary>
public override void ResetStatus()
{
context.minValue = 0;
context.maxValue = 0;
context.destMinValue = 0;
context.destMaxValue = 0;
}
public Axis Clone()
{
var axis = new Axis();
@@ -609,12 +631,14 @@ namespace XCharts.Runtime
{
if (maxCache > 0)
{
if (context.addedDataCount < m_Data.Count)
context.addedDataCount = m_Data.Count;
while (m_Data.Count >= maxCache)
{
RemoveData(m_InsertDataToHead ? m_Data.Count - 1 : 0);
}
}
context.addedDataCount++;
if (m_InsertDataToHead)
m_Data.Insert(0, category);
else
@@ -623,6 +647,16 @@ namespace XCharts.Runtime
SetAllDirty();
}
/// <summary>
/// get the history data count.
/// ||获得添加过的历史数据总数
/// </summary>
/// <returns></returns>
public int GetAddedDataCount()
{
return context.addedDataCount < m_Data.Count ? m_Data.Count : context.addedDataCount;
}
public void RemoveData(int dataIndex)
{
context.isNeedUpdateFilterData = true;
@@ -717,10 +751,14 @@ namespace XCharts.Runtime
/// <param name="value"></param>
/// <param name="axisLength"></param>
/// <returns></returns>
public float GetDistance(double value, float axisLength)
public float GetDistance(double value, float axisLength = 0)
{
if (context.minMaxRange == 0)
return 0;
if (axisLength == 0)
{
axisLength = context.length;
}
if (IsCategory() && boundaryGap)
{
@@ -907,5 +945,43 @@ namespace XCharts.Runtime
(float)(Math.Abs(context.minValue) * (axisLength / (Math.Abs(context.minValue) + Math.Abs(context.maxValue))))
);
}
public Vector3 GetCategoryPosition(int categoryIndex, int dataCount = 0)
{
if (dataCount <= 0)
{
dataCount = data.Count;
}
if (IsCategory() && dataCount > 0)
{
Vector3 pos;
if (boundaryGap)
{
var each = context.length / dataCount;
pos = context.start + context.dire * (each * (categoryIndex + 0.5f));
}
else
{
var each = context.length / (dataCount - 1);
pos = context.start + context.dire * (each * categoryIndex);
}
if (axisLabel.distance != 0)
{
if (this is YAxis)
{
pos.x = GetLabelObjectPosition(0).x;
}
else
{
pos.y = GetLabelObjectPosition(0).y;
}
}
return pos;
}
else
{
return Vector3.zero;
}
}
}
}

View File

@@ -0,0 +1,160 @@
using UnityEngine;
using UnityEngine.UI;
using XUGL;
namespace XCharts.Runtime
{
public static class Axis3DHelper
{
public static Vector3 Get3DGridPosition(GridCoord3D grid, XAxis3D xAxis, YAxis3D yAxis, ZAxis3D zAxis, double xValue, double yValue, double zValue)
{
var x = xAxis.GetDistance(xValue);
var y = yAxis.GetDistance(yValue);
var z = zAxis.GetDistance(zValue);
var dest = grid.context.pointA;
dest += xAxis.context.dire * x;
dest += yAxis.context.dire * y;
dest += zAxis.context.dire * z;
return dest;
}
public static Vector3 Get3DGridPosition(GridCoord3D grid, XAxis3D xAxis, YAxis3D yAxis, double xValue, double yValue)
{
var x = xAxis.GetDistance(xValue);
var y = yAxis.GetDistance(yValue);
var dest = grid.context.pointA;
dest += xAxis.context.dire * x;
dest += yAxis.context.dire * y;
return dest;
}
internal static void DrawAxisTick(VertexHelper vh, Axis axis, AxisTheme theme, DataZoom dataZoom,
Vector3 start, Vector3 end, Vector3 relativedDire)
{
var tickLength = axis.axisTick.GetLength(theme.tickLength);
var axisLength = Vector3.Distance(start, end);
var axisDire = (end - start).normalized;
if (axis.position == Axis.AxisPosition.Right)
{
relativedDire = -relativedDire;
}
if (AxisHelper.NeedShowSplit(axis))
{
var size = AxisHelper.GetScaleNumber(axis, axisLength, dataZoom);
if (axis.IsTime())
{
size += 1;
if (!ChartHelper.IsEquals(axis.GetLastLabelValue(), axis.context.maxValue))
size += 1;
}
var tickWidth = axis.axisTick.GetWidth(theme.tickWidth);
var tickColor = axis.axisTick.GetColor(theme.tickColor);
var current = start;
for (int i = 0; i < size; i++)
{
var scaleWidth = AxisHelper.GetScaleWidth(axis, axisLength, i + 1, dataZoom);
var hideTick = (i == 0 && (!axis.axisTick.showStartTick || axis.axisTick.alignWithLabel)) ||
(i == size - 1 && !axis.axisTick.showEndTick);
if (axis.axisTick.show && !hideTick)
{
UGL.DrawLine(vh, current, current + relativedDire * tickLength, tickWidth, tickColor);
}
current += axisDire * scaleWidth;
}
}
if (axis.show && axis.axisLine.show && axis.axisLine.showArrow)
{
}
}
public static void DrawAxisSplit(VertexHelper vh, Axis axis, AxisTheme theme, DataZoom dataZoom,
Vector3 start, Vector3 end, Axis relativedAxis)
{
if (relativedAxis == null) return;
var axisLength = Vector3.Distance(start, end);
var axisDire = (end - start).normalized;
var splitLength = relativedAxis.context.length;
var relativeDire = relativedAxis.context.dire;
var axisLineWidth = axis.axisLine.GetWidth(theme.lineWidth);
splitLength -= axisLineWidth;
var lineColor = axis.splitLine.GetColor(theme.splitLineColor);
var lineWidth = axis.splitLine.GetWidth(theme.lineWidth);
var lineType = axis.splitLine.GetType(theme.splitLineType);
var size = AxisHelper.GetScaleNumber(axis, axisLength, dataZoom);
if (axis.IsTime())
{
size += 1;
if (!ChartHelper.IsEquals(axis.GetLastLabelValue(), axis.context.maxValue))
size += 1;
}
var current = start;
for (int i = 0; i < size; i++)
{
var scaleWidth = AxisHelper.GetScaleWidth(axis, axisLength, axis.IsTime() ? i : i + 1, dataZoom);
if (axis.boundaryGap && axis.axisTick.alignWithLabel)
current -= axisDire * scaleWidth / 2;
if (axis.splitArea.show && i <= size - 1)
{
var p1 = current;
var p2 = current + relativeDire * splitLength;
var p3 = p2 + axisDire * scaleWidth;
var p4 = p1 + axisDire * scaleWidth;
UGL.DrawQuadrilateral(vh, p1, p2, p3, p4, axis.splitArea.GetColor(i, theme));
}
if (axis.splitLine.show)
{
if (axis.splitLine.NeedShow(i, size))
{
if (relativedAxis == null || !relativedAxis.axisLine.show
|| (Vector3.Distance(current, relativedAxis.context.start) > 0.5f && Vector3.Distance(current, relativedAxis.context.end) > 0.5f))
{
ChartDrawer.DrawLineStyle(vh,
lineType,
lineWidth,
current,
current + relativeDire * splitLength,
lineColor);
}
}
}
current += axisDire * scaleWidth;
}
}
public static Vector3 GetLabelPosition(int i, Axis axis, Axis relativedAxis, AxisTheme theme, float scaleWid)
{
var axisStart = axis.context.start;
var axisEnd = axis.context.end;
var axisDire = axis.context.dire;
var relativedDire = relativedAxis != null ? relativedAxis.context.dire : Vector3.zero;
var axisLength = Vector3.Distance(axisStart, axisEnd);
var inside = axis.axisLabel.inside;
var fontSize = axis.axisLabel.textStyle.GetFontSize(theme);
var current = axis.offset;
if (axis.position == Axis.AxisPosition.Right)
{
relativedDire = -relativedDire;
}
if (axis.IsTime() || axis.IsValue())
{
scaleWid = axis.context.minMaxRange != 0 ?
axis.GetDistance(axis.GetLabelValue(i), axisLength) :
0;
}
return axisStart + axisDire * scaleWid + axis.axisLabel.offset - relativedDire * (axis.axisLabel.distance + fontSize / 2);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 52469636872044a81a291bb00b71a140
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -15,6 +15,9 @@ namespace XCharts.Runtime
/// 坐标轴的起点Y
/// </summary>
public float y;
public Vector3 start;
public Vector3 end;
public Vector3 dire;
/// <summary>
/// 坐标轴原点X
/// </summary>
@@ -25,6 +28,7 @@ namespace XCharts.Runtime
public float zeroY;
public float width;
public float height;
public float length;
public Vector3 position;
public float left;
public float right;
@@ -66,6 +70,10 @@ namespace XCharts.Runtime
public List<double> labelValueList { get { return m_LabelValueList; } }
public List<ChartLabel> labelObjectList { get { return m_AxisLabelList; } }
public int dataZoomStartIndex;
/// <summary>
/// 添加过的历史数据总数
/// </summary>
public int addedDataCount;
internal List<string> filterData;
internal bool lastCheckInverse;
@@ -81,6 +89,7 @@ namespace XCharts.Runtime
internal void Clear()
{
addedDataCount = 0;
m_RuntimeData.Clear();
}

View File

@@ -58,7 +58,7 @@ namespace XCharts
(!axis.boundaryGap && (local.y > pY - splitWid / 2 && local.y <= pY + splitWid / 2)))
{
axis.context.pointerValue = j;
axis.context.pointerLabelPosition = axis.GetLabelObjectPosition(j);
axis.context.pointerLabelPosition = axis.GetCategoryPosition(j, dataCount);
if (j != lastPointerValue)
{
if (chart.onAxisPointerValueChanged != null)
@@ -78,7 +78,7 @@ namespace XCharts
(!axis.boundaryGap && (local.x > pX - splitWid / 2 && local.x <= pX + splitWid / 2)))
{
axis.context.pointerValue = j;
axis.context.pointerLabelPosition = axis.GetLabelObjectPosition(j);
axis.context.pointerLabelPosition = axis.GetCategoryPosition(j, dataCount);
if (j != lastPointerValue)
{
if (chart.onAxisPointerValueChanged != null)
@@ -147,7 +147,7 @@ namespace XCharts
if (axis.IsCategory())
{
axis.context.minValue = 0;
axis.context.maxValue = SeriesHelper.GetMaxSerieDataCount(chart.series) - 1;
axis.context.maxValue = axis.data.Count > 0 ? axis.data.Count - 1 : SeriesHelper.GetMaxSerieDataCount(chart.series) - 1;
axis.context.minMaxRange = axis.context.maxValue;
return;
}
@@ -267,7 +267,11 @@ namespace XCharts
if (axis.interval == 0)
{
if (axis.splitNumber > 0)
if (range >= double.MaxValue / 2)
{
tick = range / 4;
}
else if (axis.splitNumber > 0)
{
tick = range / axis.splitNumber;
}
@@ -365,6 +369,115 @@ namespace XCharts
}
}
protected void InitAxis3D(Axis relativedAxis, Orient orient)
{
Axis axis = component;
var axisLength = (axis.context.end - axis.context.start).magnitude;
if (axisLength == 0) return;
chart.InitAxisRuntimeData(axis);
var objName = ChartCached.GetComponentObjectName(axis);
var axisObj = ChartHelper.AddObject(objName,
chart.transform,
chart.chartMinAnchor,
chart.chartMaxAnchor,
chart.chartPivot,
chart.chartSizeDelta);
axisObj.SetActive(axis.show);
axisObj.hideFlags = chart.chartHideFlags;
ChartHelper.HideAllObject(axisObj);
axis.gameObject = axisObj;
axis.context.labelObjectList.Clear();
if (!axis.show)
return;
var axisLabelTextStyle = axis.axisLabel.textStyle;
var dataZoom = chart.GetDataZoomOfAxis(axis);
var splitNumber = AxisHelper.GetScaleNumber(axis, axisLength, dataZoom);
var totalWidth = 0f;
var eachWidth = AxisHelper.GetEachWidth(axis, axisLength, dataZoom);
var gapWidth = axis.boundaryGap ? eachWidth / 2 : 0;
var textWidth = axis.axisLabel.width > 0 ?
axis.axisLabel.width :
AxisHelper.GetScaleWidth(axis, axisLength, 0, dataZoom);
var textHeight = axis.axisLabel.height > 0 ?
axis.axisLabel.height :
20f;
var isPercentStack = SeriesHelper.IsPercentStack<Bar>(chart.series);
var inside = axis.axisLabel.inside;
var defaultAlignment = orient == Orient.Horizonal ? TextAnchor.MiddleCenter :
((inside && axis.IsLeft()) || (!inside && axis.IsRight()) ?
TextAnchor.MiddleLeft :
TextAnchor.MiddleRight);
if (axis.IsCategory() && axis.boundaryGap)
splitNumber -= 1;
axis.context.aligment = defaultAlignment;
for (int i = 0; i < splitNumber; i++)
{
var labelWidth = AxisHelper.GetScaleWidth(axis, axisLength, i + 1, dataZoom);
var labelName = AxisHelper.GetLabelName(axis, axisLength, i,
axis.context.destMinValue,
axis.context.destMaxValue,
dataZoom, isPercentStack);
var label = ChartHelper.AddAxisLabelObject(splitNumber, i,
ChartCached.GetAxisLabelName(i),
axisObj.transform,
new Vector2(textWidth, textHeight),
axis, chart.theme.axis, labelName,
Color.clear,
defaultAlignment,
chart.theme.GetColor(i));
if (i == 0)
axis.axisLabel.SetRelatedText(label.text, labelWidth);
var pos = GetLabelPosition(totalWidth + gapWidth, i);
label.SetPosition(pos);
axis.context.labelObjectList.Add(label);
totalWidth += labelWidth;
}
if (axis.axisName.show)
{
ChartLabel label = null;
var offset = axis.axisName.labelStyle.offset;
var autoColor = axis.axisLine.GetColor(chart.theme.axis.lineColor);
switch (axis.axisName.labelStyle.position)
{
case LabelStyle.Position.Start:
label = ChartHelper.AddChartLabel(s_DefaultAxisName, axisObj.transform, axis.axisName.labelStyle,
chart.theme.axis, axis.axisName.name, autoColor, TextAnchor.MiddleCenter);
label.SetActive(axis.axisName.labelStyle.show);
label.SetPosition(axis.context.start + offset);
break;
case LabelStyle.Position.Middle:
label = ChartHelper.AddChartLabel(s_DefaultAxisName, axisObj.transform, axis.axisName.labelStyle,
chart.theme.axis, axis.axisName.name, autoColor, TextAnchor.MiddleCenter);
label.SetActive(axis.axisName.labelStyle.show);
label.SetPosition((axis.context.start + axis.context.end) / 2 + offset);
break;
default:
label = ChartHelper.AddChartLabel(s_DefaultAxisName, axisObj.transform, axis.axisName.labelStyle,
chart.theme.axis, axis.axisName.name, autoColor, TextAnchor.MiddleCenter);
label.SetActive(axis.axisName.labelStyle.show);
label.SetPosition(axis.context.end + offset);
break;
}
}
}
protected void InitAxis(Axis relativedAxis, Orient orient,
float axisStartX, float axisStartY, float axisLength, float relativedLength)
{
@@ -865,7 +978,6 @@ namespace XCharts
for (int i = 0; i < size; i++)
{
var scaleWidth = AxisHelper.GetScaleWidth(axis, axisLength, axis.IsTime() ? i : i + 1, dataZoom);
if (axis.boundaryGap && axis.axisTick.alignWithLabel)
current -= scaleWidth / 2;

View File

@@ -65,10 +65,13 @@ namespace XCharts.Runtime
if (axis.splitNumber <= 0)
{
var eachWid = coordinateWid / dataCount;
var min = axis is YAxis ? 20 : 80;
var min = axis.minCategorySpacing > 0
? axis.minCategorySpacing
: (Mathf.Abs(axis.context.dire.y) < 0.01 ? 80 : 20);
if (eachWid > min) return dataCount;
var tick = Mathf.CeilToInt(min / eachWid);
return (int)(dataCount / tick);
return tick <= 1 ? dataCount : (int)(dataCount / tick);
}
else
{
@@ -245,21 +248,20 @@ namespace XCharts.Runtime
{
if (index < 0)
return 0;
int num = GetScaleNumber(axis, coordinateWidth, dataZoom);
int splitNum = GetSplitNumber(axis, coordinateWidth, dataZoom);
if (num <= 0)
num = 1;
if (axis.IsTime() || axis.IsValue())
{
var value = axis.GetLabelValue(index);
var lastValue = axis.GetLabelValue(index - 1);
return axis.context.minMaxRange == 0 ? 0 :
(float)(coordinateWidth * (value - lastValue) / axis.context.minMaxRange);
var width = axis.context.minMaxRange == 0 ? 0 :
(float)(coordinateWidth * ((value - lastValue) / axis.context.minMaxRange));
return width;
}
else
{
int num = GetScaleNumber(axis, coordinateWidth, dataZoom);
int splitNum = GetSplitNumber(axis, coordinateWidth, dataZoom);
if (num <= 0)
num = 1;
var data = axis.GetDataList(dataZoom);
if (axis.IsCategory() && data.Count > 0 && splitNum > 0)
{
@@ -344,7 +346,7 @@ namespace XCharts.Runtime
int maxSplit = 0;
maxValue = ChartHelper.GetMaxLogValue(maxValue, axis.logBase, axis.logBaseE, out maxSplit);
minValue = ChartHelper.GetMinLogValue(minValue, axis.logBase, axis.logBaseE, out minSplit);
var splitNumber = maxSplit + minSplit;
if (splitNumber > 15)
splitNumber = 15;
@@ -544,11 +546,14 @@ namespace XCharts.Runtime
/// <param name="axis"></param>
/// <param name="value"></param>
/// <returns></returns>
public static int GetAxisValueSplitIndex(Axis axis, double value, int totalSplitNumber = -1)
public static int GetAxisValueSplitIndex(Axis axis, double value, bool checkMaxCache, int totalSplitNumber = -1)
{
if (axis.IsCategory())
{
return (int)value;
if (checkMaxCache)
return axis.maxCache > 0 ? (int)value - (axis.GetAddedDataCount() - axis.data.Count) : (int)value;
else
return (int)value;
}
else
{
@@ -633,7 +638,7 @@ namespace XCharts.Runtime
var startX = grid.context.x + yAxis.offset;
if (yAxis.IsRight())
startX += grid.context.width;
else if (yAxis.axisLine.onZero && relativedAxis != null && relativedAxis.IsValue()
else if (yAxis.axisLine.onZero && relativedAxis != null && relativedAxis.IsValue()
&& relativedAxis.gridIndex == yAxis.gridIndex)
startX += relativedAxis.context.offset;
return startX;

View File

@@ -15,6 +15,7 @@ namespace XCharts.Runtime
[SerializeField] private bool m_AutoColor;
[SerializeField][Since("v3.3.0")] private bool m_ShowStartLine = true;
[SerializeField][Since("v3.3.0")] private bool m_ShowEndLine = true;
[SerializeField][Since("v3.11.0")] private bool m_ShowZLine = true;
/// <summary>
/// The distance between the split line and axis line.
@@ -53,6 +54,15 @@ namespace XCharts.Runtime
get { return m_ShowEndLine; }
set { if (PropertyUtil.SetStruct(ref m_ShowEndLine, value)) SetVerticesDirty(); }
}
/// <summary>
/// Whether to show the Z axis part of the split line. Generally used for 3D coordinate systems.
/// ||是否显示Z轴部分分割线。一般用于3D坐标系。
/// </summary>
public bool showZLine
{
get { return m_ShowZLine; }
set { if (PropertyUtil.SetStruct(ref m_ShowZLine, value)) SetVerticesDirty(); }
}
public override bool vertsDirty { get { return m_VertsDirty || m_LineStyle.anyDirty; } }
public override void ClearVerticesDirty()

View File

@@ -45,6 +45,7 @@ namespace XCharts.Runtime
axis.context.x = parallel.context.x;
axis.context.y = parallel.context.y + (axis.index) * each;
axis.context.width = parallel.context.width;
axis.context.length = parallel.context.width;
}
else
{
@@ -52,6 +53,7 @@ namespace XCharts.Runtime
axis.context.x = parallel.context.x + (axis.index) * each;
axis.context.y = parallel.context.y;
axis.context.width = parallel.context.height;
axis.context.length = parallel.context.height;
}
axis.context.orient = m_Orient;
axis.context.height = 0;

View File

@@ -179,7 +179,7 @@ namespace XCharts.Runtime
{
var outsideRaidus = totalWidth + radiusAxis.splitLine.GetWidth(chart.theme.axis.splitLineWidth) * 2;
var splitLineColor = radiusAxis.splitLine.GetColor(chart.theme.axis.splitLineColor);
UGL.DrawDoughnut(vh, cenPos, totalWidth, outsideRaidus, splitLineColor, Color.clear);
UGL.DrawDoughnut(vh, cenPos, totalWidth, outsideRaidus, splitLineColor, ColorUtil.clearColor32);
}
}
if (radiusAxis.show && radiusAxis.axisTick.show)

View File

@@ -123,6 +123,12 @@ namespace XCharts.Runtime
else
context.y = chartY + context.bottom;
context.start = new Vector3(context.x, context.y);
if (m_Orient == Orient.Horizonal)
context.end = new Vector3(context.x + context.width, context.y);
else
context.end = new Vector3(context.x, context.y + context.height);
context.length = (context.end - context.start).magnitude;
context.position = new Vector3(context.x, context.y);
}

View File

@@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace XCharts.Runtime
{
@@ -16,7 +17,28 @@ namespace XCharts.Runtime
public override void Update()
{
UpdateAxisMinMaxValue(component.index, component);
UpdatePointerValue(component);
if (!chart.isTriggerOnClick)
{
UpdatePointerValue(component);
}
}
public override void OnPointerClick(PointerEventData eventData)
{
base.OnPointerClick(eventData);
if (chart.isTriggerOnClick)
{
UpdatePointerValue(component);
}
}
public override void OnPointerExit(PointerEventData eventData)
{
base.OnPointerExit(eventData);
if (chart.isTriggerOnClick)
{
component.context.pointerValue = double.PositiveInfinity;
}
}
public override void DrawBase(VertexHelper vh)
@@ -35,6 +57,11 @@ namespace XCharts.Runtime
var relativedAxis = chart.GetChartComponent<YAxis>(axis.gridIndex);
axis.context.x = grid.context.x;
axis.context.y = AxisHelper.GetXAxisXOrY(grid, axis, relativedAxis);
axis.context.start = new Vector3(grid.context.x, axis.context.y);
axis.context.end = new Vector3(grid.context.x + grid.context.width, axis.context.y);
var vec = axis.context.end - axis.context.start;
axis.context.dire = vec.normalized;
axis.context.length = vec.magnitude;
axis.context.zeroY = grid.context.y;
axis.context.zeroX = grid.context.x + axis.context.offset;
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5e8b7c21c2d5a45f09bfd4028bbe5f63
guid: 6350e9983955e49c5b48704d3866cbfe
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// The x axis in cartesian(rectangular) coordinate.
/// ||直角坐标系 grid 中的 x 轴。
/// </summary>
[Since("v3.11.0")]
[System.Serializable]
[RequireChartComponent(typeof(GridCoord3D))]
[ComponentHandler(typeof(XAxis3DHander), true)]
public class XAxis3D : Axis
{
public override void SetDefaultValue()
{
m_Show = true;
m_Type = AxisType.Category;
m_Min = 0;
m_Max = 0;
m_SplitNumber = 0;
m_BoundaryGap = true;
m_Position = AxisPosition.Bottom;
m_Offset = 0;
m_Data = new List<string>() { "x1", "x2", "x3", "x4", "x5" };
m_Icons = new List<Sprite>(5);
splitLine.show = false;
splitLine.lineStyle.type = LineStyle.Type.None;
axisLabel.textLimit.enable = true;
axisName.name = "X";
axisName.labelStyle.position = LabelStyle.Position.Middle;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9129bca9c2a864e1ea337d7eb74d1024
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,190 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace XCharts.Runtime
{
[UnityEngine.Scripting.Preserve]
internal sealed class XAxis3DHander : AxisHandler<XAxis3D>
{
protected override Orient orient { get { return Orient.Horizonal; } }
public override void InitComponent()
{
InitXAxis(component);
}
public override void Update()
{
UpdateAxisMinMaxValue(component.index, component);
if (!chart.isTriggerOnClick)
{
UpdatePointerValue(component);
}
}
public override void OnPointerClick(PointerEventData eventData)
{
base.OnPointerClick(eventData);
if (chart.isTriggerOnClick)
{
UpdatePointerValue(component);
}
}
public override void OnPointerExit(PointerEventData eventData)
{
base.OnPointerExit(eventData);
if (chart.isTriggerOnClick)
{
component.context.pointerValue = double.PositiveInfinity;
}
}
public override void DrawBase(VertexHelper vh)
{
UpdatePosition(component);
DrawXAxisSplit(vh, component);
DrawXAxisLine(vh, component);
DrawXAxisTick(vh, component);
}
private void UpdatePosition(XAxis3D axis)
{
var grid = chart.GetChartComponent<GridCoord3D>(axis.gridIndex);
if (grid != null)
{
if (axis.position == Axis.AxisPosition.Right || axis.position == Axis.AxisPosition.Top)
{
axis.context.start = grid.xyExchanged ? grid.context.pointD : grid.context.pointB;
axis.context.end = grid.context.pointC;
}
else
{
axis.context.start = grid.context.pointA;
axis.context.end = grid.xyExchanged ? grid.context.pointB : grid.context.pointD;
}
var vect = axis.context.end - axis.context.start;
axis.context.x = axis.context.start.x;
axis.context.y = axis.context.start.y;
axis.context.dire = vect.normalized;
axis.context.length = vect.magnitude;
}
}
private void InitXAxis(XAxis3D xAxis)
{
var theme = chart.theme;
var xAxisIndex = xAxis.index;
xAxis.painter = chart.painter;
xAxis.refreshComponent = delegate ()
{
var yAxis = chart.GetChartComponent<YAxis3D>(xAxis.index);
InitAxis3D(yAxis, orient);
};
xAxis.refreshComponent();
}
internal override void UpdateAxisLabelText(Axis axis)
{
base.UpdateAxisLabelText(axis);
if (axis.IsTime() || axis.IsValue())
{
for (int i = 0; i < axis.context.labelObjectList.Count; i++)
{
var label = axis.context.labelObjectList[i];
if (label != null)
{
var pos = GetLabelPosition(0, i);
label.SetPosition(pos);
CheckValueLabelActive(component, i, label, pos);
}
}
}
}
protected override Vector3 GetLabelPosition(float scaleWid, int i)
{
var yAxis = chart.GetChartComponent<YAxis3D>(component.index);
return Axis3DHelper.GetLabelPosition(i, component, yAxis, chart.theme.axis, scaleWid);
}
private void DrawXAxisSplit(VertexHelper vh, XAxis3D xAxis)
{
if (AxisHelper.NeedShowSplit(xAxis))
{
var grid = chart.GetChartComponent<GridCoord3D>(xAxis.gridIndex);
var relativedAxis = chart.GetChartComponent<YAxis3D>(xAxis.gridIndex);
var dataZoom = chart.GetDataZoomOfAxis(xAxis);
var isLeft = grid.IsLeft();
if (grid.xyExchanged)
{
Axis3DHelper.DrawAxisSplit(vh, xAxis, chart.theme.axis, dataZoom,
grid.context.pointA,
grid.context.pointB,
relativedAxis);
if (xAxis.splitLine.showZLine)
{
var relativedAxis2 = chart.GetChartComponent<ZAxis3D>(xAxis.gridIndex);
Axis3DHelper.DrawAxisSplit(vh, xAxis, chart.theme.axis, dataZoom,
isLeft ? grid.context.pointD : grid.context.pointA,
isLeft ? grid.context.pointC : grid.context.pointB,
relativedAxis2);
}
}
else
{
Axis3DHelper.DrawAxisSplit(vh, xAxis, chart.theme.axis, dataZoom,
grid.context.pointA,
grid.context.pointD,
relativedAxis);
if (xAxis.splitLine.showZLine)
{
var relativedAxis2 = chart.GetChartComponent<ZAxis3D>(xAxis.gridIndex);
Axis3DHelper.DrawAxisSplit(vh, xAxis, chart.theme.axis, dataZoom,
grid.context.pointB,
grid.context.pointC,
relativedAxis2);
}
}
}
}
private void DrawXAxisTick(VertexHelper vh, XAxis3D xAxis)
{
if (AxisHelper.NeedShowSplit(xAxis))
{
var grid = chart.GetChartComponent<GridCoord3D>(xAxis.gridIndex);
if (grid == null)
return;
var dataZoom = chart.GetDataZoomOfAxis(xAxis);
var relativedAxis = chart.GetChartComponent<YAxis3D>(xAxis.gridIndex);
Axis3DHelper.DrawAxisTick(vh, xAxis, chart.theme.axis, dataZoom,
xAxis.context.start,
xAxis.context.end,
-relativedAxis.context.dire);
}
}
private void DrawXAxisLine(VertexHelper vh, XAxis3D axis)
{
if (axis.show && axis.axisLine.show)
{
var theme = chart.theme.axis;
var lineWidth = axis.axisLine.GetWidth(theme.lineWidth);
var lineType = axis.axisLine.GetType(theme.lineType);
var lineColor = axis.axisLine.GetColor(theme.lineColor);
var start = axis.context.start;
var end = axis.context.end;
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, start, end, lineColor);
}
}
internal override float GetAxisLineXOrY()
{
return component.context.y;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fc1147481a423494d963df29b423f3a0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -35,6 +35,11 @@ namespace XCharts.Runtime
var relativedAxis = chart.GetChartComponent<XAxis>(axis.gridIndex);
axis.context.x = AxisHelper.GetYAxisXOrY(grid, axis, relativedAxis);
axis.context.y = grid.context.y;
axis.context.start = new Vector3(axis.context.x, grid.context.y);
axis.context.end = new Vector3(axis.context.x, grid.context.y + grid.context.height);
var vect = axis.context.end - axis.context.start;
axis.context.dire = vect.normalized;
axis.context.length = vect.magnitude;
axis.context.zeroX = axis.context.x;
axis.context.zeroY = axis.context.y + axis.context.offset;
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aa26616789b6b4903aae479a4c552b89
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
namespace XCharts.Runtime
{
/// <summary>
/// The x axis in cartesian(rectangular) coordinate.
/// ||直角坐标系 grid 中的 y 轴。
/// </summary>
[Since("v3.11.0")]
[System.Serializable]
[RequireChartComponent(typeof(GridCoord3D), typeof(XAxis3D))]
[ComponentHandler(typeof(YAxis3DHander), true)]
public class YAxis3D : Axis
{
public override void SetDefaultValue()
{
m_Show = true;
m_Type = AxisType.Value;
m_Min = 0;
m_Max = 0;
m_SplitNumber = 0;
m_BoundaryGap = false;
m_Position = AxisPosition.Left;
m_Data = new List<string>(5);
splitLine.show = true;
splitLine.lineStyle.type = LineStyle.Type.None;
axisLabel.textLimit.enable = false;
axisTick.showStartTick = true;
axisName.name = "Y";
axisName.labelStyle.position = LabelStyle.Position.Middle;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a3cb4a6657aaf473bbae7162eb189cc0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,176 @@
using UnityEngine;
using UnityEngine.UI;
namespace XCharts.Runtime
{
[UnityEngine.Scripting.Preserve]
internal sealed class YAxis3DHander : AxisHandler<YAxis3D>
{
protected override Orient orient { get { return Orient.Vertical; } }
public override void InitComponent()
{
InitYAxis(component);
}
public override void Update()
{
UpdateAxisMinMaxValue(component.index, component);
UpdatePointerValue(component);
}
public override void DrawBase(VertexHelper vh)
{
UpdatePosition(component);
DrawYAxisSplit(vh, component.index, component);
DrawYAxisLine(vh, component.index, component);
DrawYAxisTick(vh, component.index, component);
}
private void UpdatePosition(YAxis3D axis)
{
var grid = chart.GetChartComponent<GridCoord3D>(axis.gridIndex);
if (grid != null)
{
if (axis.position == Axis.AxisPosition.Right)
{
axis.context.start = grid.xyExchanged ? grid.context.pointB : grid.context.pointD;
axis.context.end = grid.context.pointC;
}
else
{
axis.context.start = grid.context.pointA;
axis.context.end = grid.xyExchanged ? grid.context.pointD : grid.context.pointB;
}
axis.context.x = axis.context.start.x;
axis.context.y = axis.context.start.y;
var vect = axis.context.end - axis.context.start;
axis.context.dire = vect.normalized;
axis.context.length = vect.magnitude;
}
}
private void InitYAxis(YAxis3D yAxis)
{
var theme = chart.theme;
var yAxisIndex = yAxis.index;
yAxis.painter = chart.painter;
yAxis.refreshComponent = delegate ()
{
var grid = chart.GetChartComponent<GridCoord3D>(yAxis.gridIndex);
if (grid != null)
{
var xAxis = chart.GetChartComponent<YAxis3D>(yAxis.index);
InitAxis3D(xAxis, orient);
}
};
yAxis.refreshComponent();
}
internal override void UpdateAxisLabelText(Axis axis)
{
base.UpdateAxisLabelText(axis);
if (axis.IsTime() || axis.IsValue())
{
for (int i = 0; i < axis.context.labelObjectList.Count; i++)
{
var label = axis.context.labelObjectList[i];
if (label != null)
{
var pos = GetLabelPosition(0, i);
label.SetPosition(pos);
CheckValueLabelActive(axis, i, label, pos);
}
}
}
}
protected override Vector3 GetLabelPosition(float scaleWid, int i)
{
var xAxis = chart.GetChartComponent<XAxis3D>(component.index);
return Axis3DHelper.GetLabelPosition(i, component, xAxis, chart.theme.axis, scaleWid);
}
private void DrawYAxisSplit(VertexHelper vh, int yAxisIndex, YAxis3D yAxis)
{
if (AxisHelper.NeedShowSplit(yAxis))
{
var grid = chart.GetChartComponent<GridCoord3D>(yAxis.gridIndex);
var relativedAxis = chart.GetChartComponent<XAxis3D>(yAxis.gridIndex);
var dataZoom = chart.GetDataZoomOfAxis(yAxis);
var isLeft = grid.IsLeft();
if (grid.xyExchanged)
{
Axis3DHelper.DrawAxisSplit(vh, yAxis, chart.theme.axis, dataZoom,
grid.context.pointA,
grid.context.pointD,
relativedAxis);
if (yAxis.splitLine.showZLine)
{
var relativedAxis2 = chart.GetChartComponent<ZAxis3D>(yAxis.gridIndex);
Axis3DHelper.DrawAxisSplit(vh, yAxis, chart.theme.axis, dataZoom,
grid.context.pointB, grid.context.pointC, relativedAxis2);
}
}
else
{
Axis3DHelper.DrawAxisSplit(vh, yAxis, chart.theme.axis, dataZoom,
grid.context.pointA,
grid.context.pointB,
relativedAxis);
if (yAxis.splitLine.showZLine)
{
var relativedAxis2 = chart.GetChartComponent<ZAxis3D>(yAxis.gridIndex);
Axis3DHelper.DrawAxisSplit(vh, yAxis, chart.theme.axis, dataZoom,
isLeft ? grid.context.pointD : grid.context.pointA,
isLeft ? grid.context.pointC : grid.context.pointB,
relativedAxis2);
}
}
}
}
private void DrawYAxisTick(VertexHelper vh, int yAxisIndex, YAxis3D yAxis)
{
if (AxisHelper.NeedShowSplit(yAxis))
{
var grid = chart.GetChartComponent<GridCoord3D>(yAxis.gridIndex);
if (grid == null)
return;
var dataZoom = chart.GetDataZoomOfAxis(yAxis);
var relativedAxis = chart.GetChartComponent<XAxis3D>(yAxis.gridIndex);
Axis3DHelper.DrawAxisTick(vh, yAxis, chart.theme.axis, dataZoom,
yAxis.context.start,
yAxis.context.end,
-relativedAxis.context.dire);
}
}
private void DrawYAxisLine(VertexHelper vh, int axisIndex, YAxis3D axis)
{
if (axis.show && axis.axisLine.show)
{
var grid = chart.GetChartComponent<GridCoord3D>(axis.gridIndex);
if (grid == null)
return;
var theme = chart.theme.axis;
var lineWidth = axis.axisLine.GetWidth(theme.lineWidth);
var lineType = axis.axisLine.GetType(theme.lineType);
var lineColor = axis.axisLine.GetColor(theme.lineColor);
var start = axis.context.start;
var end = axis.context.end;
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, start, end, lineColor);
}
}
internal override float GetAxisLineXOrY()
{
return component.context.x;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 56b4be734c61645e1bf91c22a6e3da6c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 378448672ed084b0798c7ad343314693
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More