mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
Merge branch 'master' into 3.0
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
[master](#master)
|
[master](#master)
|
||||||
|
[v3.6.0](#v360)
|
||||||
[v3.5.0](#v350)
|
[v3.5.0](#v350)
|
||||||
[v3.4.0](#v340)
|
[v3.4.0](#v340)
|
||||||
[v3.3.0](#v330)
|
[v3.3.0](#v330)
|
||||||
@@ -60,6 +61,41 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
## v3.6.0
|
||||||
|
|
||||||
|
* (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.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.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
|
||||||
|
* (2023.03.03) Fixed `Animation` changing animation that might not work
|
||||||
|
* (2023.02.28) Fixed issue with Serie's Label not refreshing when `Legend` is clicked
|
||||||
|
* (2023.02.26) Adds DataZoom's `startEndFunction` delegate
|
||||||
|
* (2023.02.12) Refactor the Component code and adjust the API
|
||||||
|
* (2023.02.10) Fix `Axis` with incorrect minimum in `Log` axis in some cases
|
||||||
|
* (2023.02.10) Optimizes the default display format of Axis's value Label
|
||||||
|
* (2023.02.08) Added startLock and endLock for DataZoom
|
||||||
|
* (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.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`
|
||||||
|
* (2022.12.29) Added `+` to list editor
|
||||||
|
* (2022.12.29) Fixed `UpdateXYData()` interface affecting data accuracy (#238)
|
||||||
|
* (2022.12.28) Fixed abnormal display when setting `border` when `Pie` has only one data (#237)
|
||||||
|
* (2022.12.22) Adjust `Covert` rename to `Convert`, involving interfaces such as: `ConvertXYAxis()`, `CovertSerie()`, etc
|
||||||
|
* (2022.12.22) Fixed abnormal display of `Label` after `Convert XY Axis`
|
||||||
|
* (2022.12.12) Fixed an issue where the `Value` Axis of `axis` calculated the value range incorrectly in some cases
|
||||||
|
* (2022.12.12) Optimized legend's formatter to support `{h}` wildcards
|
||||||
|
* (2022.12.12) Fixed abnormal display of Legend's formatter when set to a fixed value
|
||||||
|
* (2022.12.08) Added `AreaStyle` `toTop` parameter to set whether the line graph gradient goes to the top or to the actual position
|
||||||
|
* (2022.12.07) Adds text wildcard `{h}` for `Formatter` to support setting current color values
|
||||||
|
|
||||||
## v3.5.0
|
## v3.5.0
|
||||||
|
|
||||||
Highlights:
|
Highlights:
|
||||||
@@ -610,7 +646,7 @@ Details:
|
|||||||
* (2020.04.19) 优化`LineChart`折线图的区域填充渐变效果
|
* (2020.04.19) 优化`LineChart`折线图的区域填充渐变效果
|
||||||
* (2020.04.19) 增加`AxisLabel`的`onZero`参数可将`Label`显示在`0`刻度上
|
* (2020.04.19) 增加`AxisLabel`的`onZero`参数可将`Label`显示在`0`刻度上
|
||||||
* (2020.04.19) 增加`Serie`和`AxisLabel`的`showAsPositiveNumber`参数将负数数值显示为正数
|
* (2020.04.19) 增加`Serie`和`AxisLabel`的`showAsPositiveNumber`参数将负数数值显示为正数
|
||||||
* (2020.04.18) 增加`Covert XY Axis`互换XY轴配置
|
* (2020.04.18) 增加`Convert XY Axis`互换XY轴配置
|
||||||
* (2020.04.17) 增加`Axis`可通过`inverse`参数设置坐标轴反转
|
* (2020.04.17) 增加`Axis`可通过`inverse`参数设置坐标轴反转
|
||||||
* (2020.04.16) 修复`Check warning`在`Unity2019.3`上的显示问题
|
* (2020.04.16) 修复`Check warning`在`Unity2019.3`上的显示问题
|
||||||
* (2020.04.16) 修复`PieChart`在设置`Space`参数后动画绘制异常的问题
|
* (2020.04.16) 修复`PieChart`在设置`Space`参数后动画绘制异常的问题
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 2
|
sidebar_position: 31
|
||||||
slug: /configuration
|
slug: /configuration
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -7,76 +7,176 @@ slug: /configuration
|
|||||||
|
|
||||||
## Serie
|
## Serie
|
||||||
|
|
||||||
|||||
|
- [Bar](#bar)
|
||||||
|--|--|--|--|
|
- [BaseScatter](#basescatter)
|
||||||
|[Bar](#bar)|[BaseScatter](#basescatter)|[Candlestick](#candlestick)|[EffectScatter](#effectscatter)|
|
- [Candlestick](#candlestick)
|
||||||
|[Heatmap](#heatmap)|[Line](#line)|[Parallel](#parallel)|[Pie](#pie)|
|
- [EffectScatter](#effectscatter)
|
||||||
|[Radar](#radar)|[Ring](#ring)|[Scatter](#scatter)|[Serie](#serie)|
|
- [Heatmap](#heatmap)
|
||||||
|[SimplifiedBar](#simplifiedbar)|[SimplifiedCandlestick](#simplifiedcandlestick)|[SimplifiedLine](#simplifiedline)|
|
- [Line](#line)
|
||||||
|
- [Parallel](#parallel)
|
||||||
|
- [Pie](#pie)
|
||||||
|
- [Radar](#radar)
|
||||||
|
- [Ring](#ring)
|
||||||
|
- [Scatter](#scatter)
|
||||||
|
- [Serie](#serie)
|
||||||
|
- [SimplifiedBar](#simplifiedbar)
|
||||||
|
- [SimplifiedCandlestick](#simplifiedcandlestick)
|
||||||
|
- [SimplifiedLine](#simplifiedline)
|
||||||
|
|
||||||
|
|
||||||
## Theme
|
## Theme
|
||||||
|
|
||||||
|||||
|
- [AngleAxisTheme](#angleaxistheme)
|
||||||
|--|--|--|--|
|
- [AxisTheme](#axistheme)
|
||||||
|[AngleAxisTheme](#angleaxistheme)|[AxisTheme](#axistheme)|[BaseAxisTheme](#baseaxistheme)|[ComponentTheme](#componenttheme)|
|
- [BaseAxisTheme](#baseaxistheme)
|
||||||
|[DataZoomTheme](#datazoomtheme)|[LegendTheme](#legendtheme)|[PolarAxisTheme](#polaraxistheme)|[RadarAxisTheme](#radaraxistheme)|
|
- [ComponentTheme](#componenttheme)
|
||||||
|[RadiusAxisTheme](#radiusaxistheme)|[SerieTheme](#serietheme)|[SubTitleTheme](#subtitletheme)|[Theme](#theme)|
|
- [DataZoomTheme](#datazoomtheme)
|
||||||
|[ThemeStyle](#themestyle)|[TitleTheme](#titletheme)|[TooltipTheme](#tooltiptheme)|[VisualMapTheme](#visualmaptheme)|
|
- [LegendTheme](#legendtheme)
|
||||||
|
- [PolarAxisTheme](#polaraxistheme)
|
||||||
|
- [RadarAxisTheme](#radaraxistheme)
|
||||||
|
- [RadiusAxisTheme](#radiusaxistheme)
|
||||||
|
- [SerieTheme](#serietheme)
|
||||||
|
- [SubTitleTheme](#subtitletheme)
|
||||||
|
- [Theme](#theme)
|
||||||
|
- [ThemeStyle](#themestyle)
|
||||||
|
- [TitleTheme](#titletheme)
|
||||||
|
- [TooltipTheme](#tooltiptheme)
|
||||||
|
- [UIComponentTheme](#uicomponenttheme)
|
||||||
|
- [VisualMapTheme](#visualmaptheme)
|
||||||
|
|
||||||
|
|
||||||
## MainComponent
|
## MainComponent
|
||||||
|
|
||||||
|||||
|
- [AngleAxis](#angleaxis)
|
||||||
|--|--|--|--|
|
- [Axis](#axis)
|
||||||
|[AngleAxis](#angleaxis)|[Axis](#axis)|[Background](#background)|[CalendarCoord](#calendarcoord)|
|
- [Background](#background)
|
||||||
|[Comment](#comment)|[CoordSystem](#coordsystem)|[DataZoom](#datazoom)|[GridCoord](#gridcoord)|
|
- [CalendarCoord](#calendarcoord)
|
||||||
|[Legend](#legend)|[MarkArea](#markarea)|[MarkLine](#markline)|[ParallelAxis](#parallelaxis)|
|
- [Comment](#comment)
|
||||||
|[ParallelCoord](#parallelcoord)|[PolarCoord](#polarcoord)|[RadarCoord](#radarcoord)|[RadiusAxis](#radiusaxis)|
|
- [CoordSystem](#coordsystem)
|
||||||
|[Settings](#settings)|[SingleAxis](#singleaxis)|[SingleAxisCoord](#singleaxiscoord)|[Title](#title)|
|
- [DataZoom](#datazoom)
|
||||||
|[Tooltip](#tooltip)|[VisualMap](#visualmap)|[XAxis](#xaxis)|[YAxis](#yaxis)|
|
- [GridCoord](#gridcoord)
|
||||||
|
- [Legend](#legend)
|
||||||
|
- [MarkArea](#markarea)
|
||||||
|
- [MarkLine](#markline)
|
||||||
|
- [ParallelAxis](#parallelaxis)
|
||||||
|
- [ParallelCoord](#parallelcoord)
|
||||||
|
- [PolarCoord](#polarcoord)
|
||||||
|
- [RadarCoord](#radarcoord)
|
||||||
|
- [RadiusAxis](#radiusaxis)
|
||||||
|
- [Settings](#settings)
|
||||||
|
- [SingleAxis](#singleaxis)
|
||||||
|
- [SingleAxisCoord](#singleaxiscoord)
|
||||||
|
- [Title](#title)
|
||||||
|
- [Tooltip](#tooltip)
|
||||||
|
- [VisualMap](#visualmap)
|
||||||
|
- [XAxis](#xaxis)
|
||||||
|
- [YAxis](#yaxis)
|
||||||
|
|
||||||
|
|
||||||
## ChildComponent
|
## ChildComponent
|
||||||
|
|
||||||
|||||
|
- [AngleAxisTheme](#angleaxistheme)
|
||||||
|--|--|--|--|
|
- [AnimationStyle](#animationstyle)
|
||||||
|[AngleAxisTheme](#angleaxistheme)|[AnimationStyle](#animationstyle)|[AreaStyle](#areastyle)|[ArrowStyle](#arrowstyle)|
|
- [AreaStyle](#areastyle)
|
||||||
|[AxisLabel](#axislabel)|[AxisLine](#axisline)|[AxisMinorSplitLine](#axisminorsplitline)|[AxisMinorTick](#axisminortick)|
|
- [ArrowStyle](#arrowstyle)
|
||||||
|[AxisName](#axisname)|[AxisSplitArea](#axissplitarea)|[AxisSplitLine](#axissplitline)|[AxisTheme](#axistheme)|
|
- [AxisLabel](#axislabel)
|
||||||
|[AxisTick](#axistick)|[BaseAxisTheme](#baseaxistheme)|[BaseLine](#baseline)|[BlurStyle](#blurstyle)|
|
- [AxisLine](#axisline)
|
||||||
|[CommentItem](#commentitem)|[CommentMarkStyle](#commentmarkstyle)|[ComponentTheme](#componenttheme)|[DataZoomTheme](#datazoomtheme)|
|
- [AxisMinorSplitLine](#axisminorsplitline)
|
||||||
|[EmphasisStyle](#emphasisstyle)|[EndLabelStyle](#endlabelstyle)|[IconStyle](#iconstyle)|[ImageStyle](#imagestyle)|
|
- [AxisMinorTick](#axisminortick)
|
||||||
|[ItemStyle](#itemstyle)|[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LegendTheme](#legendtheme)|
|
- [AxisName](#axisname)
|
||||||
|[Level](#level)|[LevelStyle](#levelstyle)|[LineArrow](#linearrow)|[LineStyle](#linestyle)|
|
- [AxisSplitArea](#axissplitarea)
|
||||||
|[Location](#location)|[MarkAreaData](#markareadata)|[MarkLineData](#marklinedata)|[MarqueeStyle](#marqueestyle)|
|
- [AxisSplitLine](#axissplitline)
|
||||||
|[Padding](#padding)|[PolarAxisTheme](#polaraxistheme)|[RadarAxisTheme](#radaraxistheme)|[RadiusAxisTheme](#radiusaxistheme)|
|
- [AxisTheme](#axistheme)
|
||||||
|[SelectStyle](#selectstyle)|[SerieData](#seriedata)|[SerieSymbol](#seriesymbol)|[SerieTheme](#serietheme)|
|
- [AxisTick](#axistick)
|
||||||
|[StageColor](#stagecolor)|[StateStyle](#statestyle)|[SubTitleTheme](#subtitletheme)|[SymbolStyle](#symbolstyle)|
|
- [BaseAxisTheme](#baseaxistheme)
|
||||||
|[TextLimit](#textlimit)|[TextPadding](#textpadding)|[TextStyle](#textstyle)|[ThemeStyle](#themestyle)|
|
- [BaseLine](#baseline)
|
||||||
|[TitleStyle](#titlestyle)|[TitleTheme](#titletheme)|[TooltipTheme](#tooltiptheme)|[VisualMapRange](#visualmaprange)|
|
- [BlurStyle](#blurstyle)
|
||||||
|[VisualMapTheme](#visualmaptheme)|
|
- [CommentItem](#commentitem)
|
||||||
|
- [CommentMarkStyle](#commentmarkstyle)
|
||||||
|
- [ComponentTheme](#componenttheme)
|
||||||
|
- [DataZoomTheme](#datazoomtheme)
|
||||||
|
- [EmphasisStyle](#emphasisstyle)
|
||||||
|
- [EndLabelStyle](#endlabelstyle)
|
||||||
|
- [IconStyle](#iconstyle)
|
||||||
|
- [ImageStyle](#imagestyle)
|
||||||
|
- [ItemStyle](#itemstyle)
|
||||||
|
- [LabelLine](#labelline)
|
||||||
|
- [LabelStyle](#labelstyle)
|
||||||
|
- [LegendTheme](#legendtheme)
|
||||||
|
- [Level](#level)
|
||||||
|
- [LevelStyle](#levelstyle)
|
||||||
|
- [LineArrow](#linearrow)
|
||||||
|
- [LineStyle](#linestyle)
|
||||||
|
- [Location](#location)
|
||||||
|
- [MarkAreaData](#markareadata)
|
||||||
|
- [MarkLineData](#marklinedata)
|
||||||
|
- [MarqueeStyle](#marqueestyle)
|
||||||
|
- [Padding](#padding)
|
||||||
|
- [PolarAxisTheme](#polaraxistheme)
|
||||||
|
- [RadarAxisTheme](#radaraxistheme)
|
||||||
|
- [RadiusAxisTheme](#radiusaxistheme)
|
||||||
|
- [SelectStyle](#selectstyle)
|
||||||
|
- [SerieData](#seriedata)
|
||||||
|
- [SerieSymbol](#seriesymbol)
|
||||||
|
- [SerieTheme](#serietheme)
|
||||||
|
- [StageColor](#stagecolor)
|
||||||
|
- [StateStyle](#statestyle)
|
||||||
|
- [SubTitleTheme](#subtitletheme)
|
||||||
|
- [SymbolStyle](#symbolstyle)
|
||||||
|
- [TextLimit](#textlimit)
|
||||||
|
- [TextPadding](#textpadding)
|
||||||
|
- [TextStyle](#textstyle)
|
||||||
|
- [ThemeStyle](#themestyle)
|
||||||
|
- [TitleStyle](#titlestyle)
|
||||||
|
- [TitleTheme](#titletheme)
|
||||||
|
- [TooltipTheme](#tooltiptheme)
|
||||||
|
- [UIComponentTheme](#uicomponenttheme)
|
||||||
|
- [VisualMapRange](#visualmaprange)
|
||||||
|
- [VisualMapTheme](#visualmaptheme)
|
||||||
|
|
||||||
## ISerieExtraComponent
|
|
||||||
|
|
||||||
|||||
|
## ISerieComponent
|
||||||
|--|--|--|--|
|
|
||||||
|[AreaStyle](#areastyle)|[BlurStyle](#blurstyle)|[EmphasisStyle](#emphasisstyle)|[ImageStyle](#imagestyle)|
|
- [AreaStyle](#areastyle)
|
||||||
|[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LineArrow](#linearrow)|[SelectStyle](#selectstyle)|
|
- [BlurStyle](#blurstyle)
|
||||||
|[TitleStyle](#titlestyle)|
|
- [EmphasisStyle](#emphasisstyle)
|
||||||
|
- [ImageStyle](#imagestyle)
|
||||||
|
- [LabelLine](#labelline)
|
||||||
|
- [LabelStyle](#labelstyle)
|
||||||
|
- [LineArrow](#linearrow)
|
||||||
|
- [SelectStyle](#selectstyle)
|
||||||
|
- [TitleStyle](#titlestyle)
|
||||||
|
|
||||||
|
|
||||||
## ISerieDataComponent
|
## ISerieDataComponent
|
||||||
|
|
||||||
|||||
|
- [AreaStyle](#areastyle)
|
||||||
|--|--|--|--|
|
- [BlurStyle](#blurstyle)
|
||||||
|[AreaStyle](#areastyle)|[BlurStyle](#blurstyle)|[EmphasisStyle](#emphasisstyle)|[ImageStyle](#imagestyle)|
|
- [EmphasisStyle](#emphasisstyle)
|
||||||
|[ItemStyle](#itemstyle)|[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LineStyle](#linestyle)|
|
- [ImageStyle](#imagestyle)
|
||||||
|[SelectStyle](#selectstyle)|[SerieSymbol](#seriesymbol)|[TitleStyle](#titlestyle)|
|
- [ItemStyle](#itemstyle)
|
||||||
|
- [LabelLine](#labelline)
|
||||||
|
- [LabelStyle](#labelstyle)
|
||||||
|
- [LineStyle](#linestyle)
|
||||||
|
- [SelectStyle](#selectstyle)
|
||||||
|
- [SerieSymbol](#seriesymbol)
|
||||||
|
- [TitleStyle](#titlestyle)
|
||||||
|
|
||||||
|
|
||||||
## Other Component
|
## Other Component
|
||||||
|
|
||||||
|||||
|
- [BaseSerie](#baseserie)
|
||||||
|--|--|--|--|
|
- [ChartText](#charttext)
|
||||||
|[BaseSerie](#baseserie)|[ChartText](#charttext)|[ChildComponent](#childcomponent)|[DebugInfo](#debuginfo)|
|
- [ChildComponent](#childcomponent)
|
||||||
|[Indicator](#indicator)|[Lang](#lang)|[LangCandlestick](#langcandlestick)|[LangTime](#langtime)|
|
- [DebugInfo](#debuginfo)
|
||||||
|[MainComponent](#maincomponent)|[XCResourcesImporter](#xcresourcesimporter)|[XCSettings](#xcsettings)|
|
- [Indicator](#indicator)
|
||||||
|
- [Lang](#lang)
|
||||||
|
- [LangCandlestick](#langcandlestick)
|
||||||
|
- [LangTime](#langtime)
|
||||||
|
- [MainComponent](#maincomponent)
|
||||||
|
- [XCResourcesImporter](#xcresourcesimporter)
|
||||||
|
- [XCSettings](#xcsettings)
|
||||||
|
|
||||||
|
|
||||||
## AngleAxis
|
## AngleAxis
|
||||||
|
|
||||||
@@ -116,7 +216,7 @@ the animation of serie.
|
|||||||
|
|
||||||
## AreaStyle
|
## AreaStyle
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
The style of area.
|
The style of area.
|
||||||
|
|
||||||
@@ -128,6 +228,7 @@ The style of area.
|
|||||||
|toColor|||Gradient color, start color to toColor.
|
|toColor|||Gradient color, start color to toColor.
|
||||||
|opacity|0.6f||Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0.
|
|opacity|0.6f||Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0.
|
||||||
|innerFill||v3.2.0|Whether to fill only polygonal areas. Currently, only convex polygons are supported.
|
|innerFill||v3.2.0|Whether to fill only polygonal areas. Currently, only convex polygons are supported.
|
||||||
|
|toTop|true|v3.6.0|Whether to fill the gradient color to the top. The default is true, which means that the gradient color is filled to the top. If it is false, the gradient color is filled to the actual position.
|
||||||
|
|
||||||
## ArrowStyle
|
## ArrowStyle
|
||||||
|
|
||||||
@@ -354,7 +455,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai
|
|||||||
|
|
||||||
## BlurStyle
|
## BlurStyle
|
||||||
|
|
||||||
Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
> Since `v3.2.0`
|
> Since `v3.2.0`
|
||||||
|
|
||||||
@@ -473,6 +574,8 @@ DataZoom component is used for zooming a specific area, which enables user to in
|
|||||||
|lineStyle|||阴影线条样式。 [LineStyle](#linestyle)|
|
|lineStyle|||阴影线条样式。 [LineStyle](#linestyle)|
|
||||||
|areaStyle|||阴影填充样式。 [AreaStyle](#areastyle)|
|
|areaStyle|||阴影填充样式。 [AreaStyle](#areastyle)|
|
||||||
|marqueeStyle||v3.5.0|选取框样式。 [MarqueeStyle](#marqueestyle)|
|
|marqueeStyle||v3.5.0|选取框样式。 [MarqueeStyle](#marqueestyle)|
|
||||||
|
|startLock||v3.6.0|Lock start value.
|
||||||
|
|endLock||v3.6.0|Lock end value.
|
||||||
|
|
||||||
## DataZoomTheme
|
## DataZoomTheme
|
||||||
|
|
||||||
@@ -505,7 +608,7 @@ Inherits or Implemented: [BaseScatter](#basescatter)
|
|||||||
|
|
||||||
## EmphasisStyle
|
## EmphasisStyle
|
||||||
|
|
||||||
Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
> Since `v3.2.0`
|
> Since `v3.2.0`
|
||||||
|
|
||||||
@@ -567,7 +670,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent)
|
|||||||
|
|
||||||
## ImageStyle
|
## ImageStyle
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
|field|default|since|comment|
|
|field|default|since|comment|
|
||||||
|--|--|--|--|
|
|--|--|--|--|
|
||||||
@@ -622,6 +725,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieDataComponent]
|
|||||||
|color0|||数据项颜色。
|
|color0|||数据项颜色。
|
||||||
|toColor|||Gradient color1.
|
|toColor|||Gradient color1.
|
||||||
|toColor2|||Gradient color2.Only valid in line diagrams.
|
|toColor2|||Gradient color2.Only valid in line diagrams.
|
||||||
|
|markColor||v3.6.0|Serie's mark color. It is only used to display Legend and Tooltip, and does not affect the drawing color. The default value is clear.
|
||||||
|backgroundColor|||数据项背景颜色。
|
|backgroundColor|||数据项背景颜色。
|
||||||
|backgroundWidth|||数据项背景宽度。
|
|backgroundWidth|||数据项背景宽度。
|
||||||
|centerColor|||中心区域颜色。
|
|centerColor|||中心区域颜色。
|
||||||
@@ -639,7 +743,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieDataComponent]
|
|||||||
|
|
||||||
## LabelLine
|
## LabelLine
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
标签的引导线
|
标签的引导线
|
||||||
|
|
||||||
@@ -658,7 +762,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent
|
|||||||
|
|
||||||
## LabelStyle
|
## LabelStyle
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
Text label of chart, to explain some data information about graphic item like value, name and so on.
|
Text label of chart, to explain some data information about graphic item like value, name and so on.
|
||||||
|
|
||||||
@@ -669,6 +773,7 @@ Text label of chart, to explain some data information about graphic item like va
|
|||||||
|autoOffset|false||是否开启自动偏移。当开启时,Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
|
|autoOffset|false||是否开启自动偏移。当开启时,Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
|
||||||
|offset|||offset to the host graphic element.
|
|offset|||offset to the host graphic element.
|
||||||
|rotate|||Rotation of label.
|
|rotate|||Rotation of label.
|
||||||
|
|autoRotate|false|v3.6.0|auto rotate of label.
|
||||||
|distance|||距离轴线的距离。
|
|distance|||距离轴线的距离。
|
||||||
|formatter|||formatter of label.
|
|formatter|||formatter of label.
|
||||||
|numericFormatter|||Standard numeric format strings.
|
|numericFormatter|||Standard numeric format strings.
|
||||||
@@ -718,6 +823,7 @@ Legend component.The legend component shows different sets of tags, colors, and
|
|||||||
|colors|||the colors of legend item.
|
|colors|||the colors of legend item.
|
||||||
|background||v3.1.0|the sytle of background. [ImageStyle](#imagestyle)|
|
|background||v3.1.0|the sytle of background. [ImageStyle](#imagestyle)|
|
||||||
|padding||v3.1.0|the paddinng of item and background. [Padding](#padding)|
|
|padding||v3.1.0|the paddinng of item and background. [Padding](#padding)|
|
||||||
|
|positions||v3.6.0|the custom positions of legend item.
|
||||||
|
|
||||||
## LegendTheme
|
## LegendTheme
|
||||||
|
|
||||||
@@ -753,7 +859,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai
|
|||||||
|
|
||||||
## LineArrow
|
## LineArrow
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent)
|
||||||
|
|
||||||
|field|default|since|comment|
|
|field|default|since|comment|
|
||||||
|--|--|--|--|
|
|--|--|--|--|
|
||||||
@@ -986,7 +1092,7 @@ Inherits or Implemented: [BaseScatter](#basescatter)
|
|||||||
|
|
||||||
## SelectStyle
|
## SelectStyle
|
||||||
|
|
||||||
Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
> Since `v3.2.0`
|
> Since `v3.2.0`
|
||||||
|
|
||||||
@@ -1008,7 +1114,6 @@ Inherits or Implemented: [BaseSerie](#baseserie),[IComparable](#icomparable)
|
|||||||
|serieName|||Series name used for displaying in tooltip and filtering with legend.
|
|serieName|||Series name used for displaying in tooltip and filtering with legend.
|
||||||
|state||v3.2.0|The default state of a serie.<br/>`SerieState`:<br/>- `Normal`: Normal state.<br/>- `Emphasis`: Emphasis state.<br/>- `Blur`: Blur state.<br/>- `Select`: Select state.<br/>- `Auto`: Auto state.<br/>|
|
|state||v3.2.0|The default state of a serie.<br/>`SerieState`:<br/>- `Normal`: Normal state.<br/>- `Emphasis`: Emphasis state.<br/>- `Blur`: Blur state.<br/>- `Select`: Select state.<br/>- `Auto`: Auto state.<br/>|
|
||||||
|colorBy||v3.2.0|The policy to take color from theme.<br/>`SerieColorBy`:<br/>- `Default`: Select state.<br/>- `Serie`: assigns the colors in the palette by serie, so that all data in the same series are in the same color;.<br/>- `Data`: assigns colors in the palette according to data items, with each data item using a different color..<br/>|
|
|colorBy||v3.2.0|The policy to take color from theme.<br/>`SerieColorBy`:<br/>- `Default`: Select state.<br/>- `Serie`: assigns the colors in the palette by serie, so that all data in the same series are in the same color;.<br/>- `Data`: assigns colors in the palette according to data items, with each data item using a different color..<br/>|
|
||||||
|markColor||v3.4.0|Serie's mark color. It is only used to display Legend and Tooltip, and does not affect the drawing color. The default value is clear.
|
|
||||||
|stack|||If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
|
|stack|||If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
|
||||||
|xAxisIndex|0||the index of XAxis.
|
|xAxisIndex|0||the index of XAxis.
|
||||||
|yAxisIndex|0||the index of YAxis.
|
|yAxisIndex|0||the index of YAxis.
|
||||||
@@ -1024,7 +1129,7 @@ Inherits or Implemented: [BaseSerie](#baseserie),[IComparable](#icomparable)
|
|||||||
|sampleType|||the type of sample.<br/>`SampleType`:<br/>- `Peak`: Take a peak. When the average value of the filter point is greater than or equal to 'sampleAverage', take the maximum value; If you do it the other way around, you get the minimum.<br/>- `Average`: Take the average of the filter points.<br/>- `Max`: Take the maximum value of the filter point.<br/>- `Min`: Take the minimum value of the filter point.<br/>- `Sum`: Take the sum of the filter points.<br/>|
|
|sampleType|||the type of sample.<br/>`SampleType`:<br/>- `Peak`: Take a peak. When the average value of the filter point is greater than or equal to 'sampleAverage', take the maximum value; If you do it the other way around, you get the minimum.<br/>- `Average`: Take the average of the filter points.<br/>- `Max`: Take the maximum value of the filter point.<br/>- `Min`: Take the minimum value of the filter point.<br/>- `Sum`: Take the sum of the filter points.<br/>|
|
||||||
|sampleAverage|0||设定的采样平均值。当sampleType 为 Peak 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为0时会实时计算所有数据的平均值。
|
|sampleAverage|0||设定的采样平均值。当sampleType 为 Peak 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为0时会实时计算所有数据的平均值。
|
||||||
|lineType|||The type of line chart.<br/>`LineType`:<br/>- `Normal`: the normal line chart,<br/>- `Smooth`: the smooth line chart,<br/>- `StepStart`: step line.<br/>- `StepMiddle`: step line.<br/>- `StepEnd`: step line.<br/>|
|
|lineType|||The type of line chart.<br/>`LineType`:<br/>- `Normal`: the normal line chart,<br/>- `Smooth`: the smooth line chart,<br/>- `StepStart`: step line.<br/>- `StepMiddle`: step line.<br/>- `StepEnd`: step line.<br/>|
|
||||||
|smoothLimit|true|v3.4.0|Whether to restrict the curve. When true, the curve between two continuous data of the same value is restricted to not exceed the data point, and is flat to the data point.
|
|smoothLimit|false|v3.4.0|Whether to restrict the curve. When true, the curve between two continuous data of the same value is restricted to not exceed the data point, and is flat to the data point.
|
||||||
|barType|||柱形图类型。<br/>`BarType`:<br/>- `Normal`: normal bar.<br/>- `Zebra`: zebra bar.<br/>- `Capsule`: capsule bar.<br/>|
|
|barType|||柱形图类型。<br/>`BarType`:<br/>- `Normal`: normal bar.<br/>- `Zebra`: zebra bar.<br/>- `Capsule`: capsule bar.<br/>|
|
||||||
|barPercentStack|false||柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。
|
|barPercentStack|false||柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。
|
||||||
|barWidth|0||The width of the bar. Adaptive when default 0.
|
|barWidth|0||The width of the bar. Adaptive when default 0.
|
||||||
@@ -1341,7 +1446,7 @@ Title component, including main title and subtitle.
|
|||||||
|
|
||||||
## TitleStyle
|
## TitleStyle
|
||||||
|
|
||||||
Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieExtraComponent](#iserieextracomponent)
|
Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieComponent](#iseriecomponent)
|
||||||
|
|
||||||
the title of serie.
|
the title of serie.
|
||||||
|
|
||||||
@@ -1404,6 +1509,16 @@ Inherits or Implemented: [ComponentTheme](#componenttheme)
|
|||||||
|labelTextColor|||the text color of tooltip cross indicator's axis label.
|
|labelTextColor|||the text color of tooltip cross indicator's axis label.
|
||||||
|labelBackgroundColor|||the background color of tooltip cross indicator's axis label.
|
|labelBackgroundColor|||the background color of tooltip cross indicator's axis label.
|
||||||
|
|
||||||
|
## UIComponentTheme
|
||||||
|
|
||||||
|
Inherits or Implemented: [ChildComponent](#childcomponent)
|
||||||
|
|
||||||
|
|field|default|since|comment|
|
||||||
|
|--|--|--|--|
|
||||||
|
|show|true||
|
||||||
|
|sharedTheme|||the asset of theme. [Theme](#theme)|
|
||||||
|
|transparentBackground|false||
|
||||||
|
|
||||||
## VisualMap
|
## VisualMap
|
||||||
|
|
||||||
Inherits or Implemented: [MainComponent](#maincomponent)
|
Inherits or Implemented: [MainComponent](#maincomponent)
|
||||||
|
|||||||
@@ -100,29 +100,29 @@ chart.SetSize(580, 300);//代码动态设置尺寸,或直接操作chart.rectTr
|
|||||||
设置标题:
|
设置标题:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var title = chart.GetOrAddChartComponent<Title>();
|
var title = chart.EnsureChartComponent<Title>();
|
||||||
title.text = "Simple Line";
|
title.text = "Simple Line";
|
||||||
```
|
```
|
||||||
|
|
||||||
设置提示框和图例是否显示:
|
设置提示框和图例是否显示:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var tooltip = chart.GetOrAddChartComponent<Tooltip>();
|
var tooltip = chart.EnsureChartComponent<Tooltip>();
|
||||||
tooltip.show = true;
|
tooltip.show = true;
|
||||||
|
|
||||||
var legend = chart.GetOrAddChartComponent<Legend>();
|
var legend = chart.EnsureChartComponent<Legend>();
|
||||||
legend.show = false;
|
legend.show = false;
|
||||||
```
|
```
|
||||||
|
|
||||||
设置坐标轴:
|
设置坐标轴:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
|
|
||||||
var yAxis = chart.GetOrAddChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
yAxis.type = Axis.AxisType.Value;
|
yAxis.type = Axis.AxisType.Value;
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -195,11 +195,11 @@ XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换
|
|||||||
需要先获取组件,再修改里面的参数:
|
需要先获取组件,再修改里面的参数:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var title = chart.GetOrAddChartComponent<Title>();
|
var title = chart.EnsureChartComponent<Title>();
|
||||||
title.text = "Simple LineChart";
|
title.text = "Simple LineChart";
|
||||||
title.subText = "normal line";
|
title.subText = "normal line";
|
||||||
|
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
@@ -234,9 +234,9 @@ serie.roundCap = true;
|
|||||||
给Serie添加额外组件:
|
给Serie添加额外组件:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
serie.AddExtraComponent<AreaStyle>();
|
serie.EnsureComponent<AreaStyle>();
|
||||||
|
|
||||||
var label = serie1.AddExtraComponent<LabelStyle>();
|
var label = serie1.EnsureComponent<LabelStyle>();
|
||||||
label.offset = new Vector3(0,20,0);
|
label.offset = new Vector3(0,20,0);
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ var serieData = chart.AddData(0, 20);
|
|||||||
//var serieData = serie.GetSerieData(0); //从已有数据中获取
|
//var serieData = serie.GetSerieData(0); //从已有数据中获取
|
||||||
serieData.radius = 10;
|
serieData.radius = 10;
|
||||||
|
|
||||||
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件
|
var itemStyle = serieData.EnsureComponent<ItemStyle>(); //给数据项添加ItemStyle组件
|
||||||
itemStyle.color = Color.blue;
|
itemStyle.color = Color.blue;
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,12 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 5
|
sidebar_position: 61
|
||||||
slug: /changelog
|
slug: /changelog
|
||||||
---
|
---
|
||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
[master](#master)
|
[master](#master)
|
||||||
|
[v3.6.0](#v360)
|
||||||
[v3.5.0](#v350)
|
[v3.5.0](#v350)
|
||||||
[v3.4.0](#v340)
|
[v3.4.0](#v340)
|
||||||
[v3.3.0](#v330)
|
[v3.3.0](#v330)
|
||||||
@@ -65,6 +66,59 @@ slug: /changelog
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
## v3.6.0
|
||||||
|
|
||||||
|
版本要点:
|
||||||
|
|
||||||
|
* 增加`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}`的支持
|
||||||
|
* 优化`Tooltip`,`Legend`,`DataZoom`,`Axis`等组件
|
||||||
|
* 重构相关`API`接口,完善回调接口
|
||||||
|
* 修复若干问题
|
||||||
|
|
||||||
|
升级注意:
|
||||||
|
|
||||||
|
* 部分接口有调整,可根据提示更换下接口即可。
|
||||||
|
|
||||||
|
日志详情:
|
||||||
|
|
||||||
|
* (2023.04.01) 发布`v3.6.0`版本
|
||||||
|
* (2023.03.14) 修复`Tooltip`的`titleFormater`设置`{b}`可能不生效的问题
|
||||||
|
* (2023.03.14) 修复`BarChart`在数据为0时不绘制柱条背景的问题 (#250) (by __Ambitroc__)
|
||||||
|
* (2023.03.12) 增加`LabelStyle`的`autoRotate`可设置有角度的竖版文本的自动旋转
|
||||||
|
* (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`可自定义图例的位置
|
||||||
|
* (2023.03.03) 修复`Animation`变更动画可能无效的问题
|
||||||
|
* (2023.02.28) 修复`Legend`点击时`Serie`的`Label`不刷新的问题
|
||||||
|
* (2023.02.26) 增加`DataZoom`的`startEndFunction`委托
|
||||||
|
* (2023.02.12) 重构`Component`相关代码,调整API接口
|
||||||
|
* (2023.02.10) 修复`Axis`在`Log`轴时某些情况下最小值不正确的问题
|
||||||
|
* (2023.02.10) 优化`Axis`的数值`Label`的默认显示格式
|
||||||
|
* (2023.02.08) 增加`DataZoom`的`startLock`和`endLock`参数支持锁定
|
||||||
|
* (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.11) 修复`Inspector`上移除`Component`后图表没有及时刷新的问题 (#241)
|
||||||
|
* (2023.01.06) 修复`Pie`在最后的几个数据都为0时`Label`显示不正常的问题 (#240)
|
||||||
|
* (2023.01.03) 删除`Serie`的`MarkColor`,增加`ItemStyle`的`MarkColor`
|
||||||
|
* (2022.12.29) 增加`Editor`对`List`的`+`添加编辑功能
|
||||||
|
* (2022.12.29) 修复`UpdateXYData()`接口影响数据精度的问题 (#238)
|
||||||
|
* (2022.12.28) 修复`Pie`只有一个数据时设置`border`后显示异常的问题 (#237)
|
||||||
|
* (2022.12.22) 调整`Covert`重命名为`Convert`,涉及的接口有:`ConvertXYAxis()`,`CovertSerie()`等
|
||||||
|
* (2022.12.22) 修复`Convert XY Axis`后Y轴的`Label`显示异常的问题
|
||||||
|
* (2022.12.12) 修复`Axis`的`Value`轴在某些情况下计算数值范围不准确的问题
|
||||||
|
* (2022.12.12) 优化`Legend`的`formatter`支持`{h}`通配符
|
||||||
|
* (2022.12.12) 修复`Legend`的`formatter`设置为固定值时显示不正常的问题
|
||||||
|
* (2022.12.08) 增加`AreaStyle`的`toTop`参数可设置折线图渐变色是到顶部还是到实际位置
|
||||||
|
* (2022.12.07) 增加`Formatter`的文本通配符`{h}`支持设置当前颜色值
|
||||||
|
|
||||||
## v3.5.0
|
## v3.5.0
|
||||||
|
|
||||||
版本要点:
|
版本要点:
|
||||||
@@ -673,7 +727,7 @@ slug: /changelog
|
|||||||
* (2020.04.19) 优化`LineChart`折线图的区域填充渐变效果
|
* (2020.04.19) 优化`LineChart`折线图的区域填充渐变效果
|
||||||
* (2020.04.19) 增加`AxisLabel`的`onZero`参数可将`Label`显示在`0`刻度上
|
* (2020.04.19) 增加`AxisLabel`的`onZero`参数可将`Label`显示在`0`刻度上
|
||||||
* (2020.04.19) 增加`Serie`和`AxisLabel`的`showAsPositiveNumber`参数将负数数值显示为正数
|
* (2020.04.19) 增加`Serie`和`AxisLabel`的`showAsPositiveNumber`参数将负数数值显示为正数
|
||||||
* (2020.04.18) 增加`Covert XY Axis`互换XY轴配置
|
* (2020.04.18) 增加`Convert XY Axis`互换XY轴配置
|
||||||
* (2020.04.17) 增加`Axis`可通过`inverse`参数设置坐标轴反转
|
* (2020.04.17) 增加`Axis`可通过`inverse`参数设置坐标轴反转
|
||||||
* (2020.04.16) 修复`Check warning`在`Unity2019.3`上的显示问题
|
* (2020.04.16) 修复`Check warning`在`Unity2019.3`上的显示问题
|
||||||
* (2020.04.16) 修复`PieChart`在设置`Space`参数后动画绘制异常的问题
|
* (2020.04.16) 修复`PieChart`在设置`Space`参数后动画绘制异常的问题
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 2
|
sidebar_position: 31
|
||||||
slug: /configuration
|
slug: /configuration
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -7,76 +7,176 @@ slug: /configuration
|
|||||||
|
|
||||||
## Serie 系列
|
## Serie 系列
|
||||||
|
|
||||||
|||||
|
- [Bar](#bar)
|
||||||
|--|--|--|--|
|
- [BaseScatter](#basescatter)
|
||||||
|[Bar](#bar)|[BaseScatter](#basescatter)|[Candlestick](#candlestick)|[EffectScatter](#effectscatter)|
|
- [Candlestick](#candlestick)
|
||||||
|[Heatmap](#heatmap)|[Line](#line)|[Parallel](#parallel)|[Pie](#pie)|
|
- [EffectScatter](#effectscatter)
|
||||||
|[Radar](#radar)|[Ring](#ring)|[Scatter](#scatter)|[Serie](#serie)|
|
- [Heatmap](#heatmap)
|
||||||
|[SimplifiedBar](#simplifiedbar)|[SimplifiedCandlestick](#simplifiedcandlestick)|[SimplifiedLine](#simplifiedline)|
|
- [Line](#line)
|
||||||
|
- [Parallel](#parallel)
|
||||||
|
- [Pie](#pie)
|
||||||
|
- [Radar](#radar)
|
||||||
|
- [Ring](#ring)
|
||||||
|
- [Scatter](#scatter)
|
||||||
|
- [Serie](#serie)
|
||||||
|
- [SimplifiedBar](#simplifiedbar)
|
||||||
|
- [SimplifiedCandlestick](#simplifiedcandlestick)
|
||||||
|
- [SimplifiedLine](#simplifiedline)
|
||||||
|
|
||||||
|
|
||||||
## Theme 主题
|
## Theme 主题
|
||||||
|
|
||||||
|||||
|
- [AngleAxisTheme](#angleaxistheme)
|
||||||
|--|--|--|--|
|
- [AxisTheme](#axistheme)
|
||||||
|[AngleAxisTheme](#angleaxistheme)|[AxisTheme](#axistheme)|[BaseAxisTheme](#baseaxistheme)|[ComponentTheme](#componenttheme)|
|
- [BaseAxisTheme](#baseaxistheme)
|
||||||
|[DataZoomTheme](#datazoomtheme)|[LegendTheme](#legendtheme)|[PolarAxisTheme](#polaraxistheme)|[RadarAxisTheme](#radaraxistheme)|
|
- [ComponentTheme](#componenttheme)
|
||||||
|[RadiusAxisTheme](#radiusaxistheme)|[SerieTheme](#serietheme)|[SubTitleTheme](#subtitletheme)|[Theme](#theme)|
|
- [DataZoomTheme](#datazoomtheme)
|
||||||
|[ThemeStyle](#themestyle)|[TitleTheme](#titletheme)|[TooltipTheme](#tooltiptheme)|[VisualMapTheme](#visualmaptheme)|
|
- [LegendTheme](#legendtheme)
|
||||||
|
- [PolarAxisTheme](#polaraxistheme)
|
||||||
|
- [RadarAxisTheme](#radaraxistheme)
|
||||||
|
- [RadiusAxisTheme](#radiusaxistheme)
|
||||||
|
- [SerieTheme](#serietheme)
|
||||||
|
- [SubTitleTheme](#subtitletheme)
|
||||||
|
- [Theme](#theme)
|
||||||
|
- [ThemeStyle](#themestyle)
|
||||||
|
- [TitleTheme](#titletheme)
|
||||||
|
- [TooltipTheme](#tooltiptheme)
|
||||||
|
- [UIComponentTheme](#uicomponenttheme)
|
||||||
|
- [VisualMapTheme](#visualmaptheme)
|
||||||
|
|
||||||
|
|
||||||
## MainComponent 主组件
|
## MainComponent 主组件
|
||||||
|
|
||||||
|||||
|
- [AngleAxis](#angleaxis)
|
||||||
|--|--|--|--|
|
- [Axis](#axis)
|
||||||
|[AngleAxis](#angleaxis)|[Axis](#axis)|[Background](#background)|[CalendarCoord](#calendarcoord)|
|
- [Background](#background)
|
||||||
|[Comment](#comment)|[CoordSystem](#coordsystem)|[DataZoom](#datazoom)|[GridCoord](#gridcoord)|
|
- [CalendarCoord](#calendarcoord)
|
||||||
|[Legend](#legend)|[MarkArea](#markarea)|[MarkLine](#markline)|[ParallelAxis](#parallelaxis)|
|
- [Comment](#comment)
|
||||||
|[ParallelCoord](#parallelcoord)|[PolarCoord](#polarcoord)|[RadarCoord](#radarcoord)|[RadiusAxis](#radiusaxis)|
|
- [CoordSystem](#coordsystem)
|
||||||
|[Settings](#settings)|[SingleAxis](#singleaxis)|[SingleAxisCoord](#singleaxiscoord)|[Title](#title)|
|
- [DataZoom](#datazoom)
|
||||||
|[Tooltip](#tooltip)|[VisualMap](#visualmap)|[XAxis](#xaxis)|[YAxis](#yaxis)|
|
- [GridCoord](#gridcoord)
|
||||||
|
- [Legend](#legend)
|
||||||
|
- [MarkArea](#markarea)
|
||||||
|
- [MarkLine](#markline)
|
||||||
|
- [ParallelAxis](#parallelaxis)
|
||||||
|
- [ParallelCoord](#parallelcoord)
|
||||||
|
- [PolarCoord](#polarcoord)
|
||||||
|
- [RadarCoord](#radarcoord)
|
||||||
|
- [RadiusAxis](#radiusaxis)
|
||||||
|
- [Settings](#settings)
|
||||||
|
- [SingleAxis](#singleaxis)
|
||||||
|
- [SingleAxisCoord](#singleaxiscoord)
|
||||||
|
- [Title](#title)
|
||||||
|
- [Tooltip](#tooltip)
|
||||||
|
- [VisualMap](#visualmap)
|
||||||
|
- [XAxis](#xaxis)
|
||||||
|
- [YAxis](#yaxis)
|
||||||
|
|
||||||
|
|
||||||
## ChildComponent 子组件
|
## ChildComponent 子组件
|
||||||
|
|
||||||
|||||
|
- [AngleAxisTheme](#angleaxistheme)
|
||||||
|--|--|--|--|
|
- [AnimationStyle](#animationstyle)
|
||||||
|[AngleAxisTheme](#angleaxistheme)|[AnimationStyle](#animationstyle)|[AreaStyle](#areastyle)|[ArrowStyle](#arrowstyle)|
|
- [AreaStyle](#areastyle)
|
||||||
|[AxisLabel](#axislabel)|[AxisLine](#axisline)|[AxisMinorSplitLine](#axisminorsplitline)|[AxisMinorTick](#axisminortick)|
|
- [ArrowStyle](#arrowstyle)
|
||||||
|[AxisName](#axisname)|[AxisSplitArea](#axissplitarea)|[AxisSplitLine](#axissplitline)|[AxisTheme](#axistheme)|
|
- [AxisLabel](#axislabel)
|
||||||
|[AxisTick](#axistick)|[BaseAxisTheme](#baseaxistheme)|[BaseLine](#baseline)|[BlurStyle](#blurstyle)|
|
- [AxisLine](#axisline)
|
||||||
|[CommentItem](#commentitem)|[CommentMarkStyle](#commentmarkstyle)|[ComponentTheme](#componenttheme)|[DataZoomTheme](#datazoomtheme)|
|
- [AxisMinorSplitLine](#axisminorsplitline)
|
||||||
|[EmphasisStyle](#emphasisstyle)|[EndLabelStyle](#endlabelstyle)|[IconStyle](#iconstyle)|[ImageStyle](#imagestyle)|
|
- [AxisMinorTick](#axisminortick)
|
||||||
|[ItemStyle](#itemstyle)|[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LegendTheme](#legendtheme)|
|
- [AxisName](#axisname)
|
||||||
|[Level](#level)|[LevelStyle](#levelstyle)|[LineArrow](#linearrow)|[LineStyle](#linestyle)|
|
- [AxisSplitArea](#axissplitarea)
|
||||||
|[Location](#location)|[MarkAreaData](#markareadata)|[MarkLineData](#marklinedata)|[MarqueeStyle](#marqueestyle)|
|
- [AxisSplitLine](#axissplitline)
|
||||||
|[Padding](#padding)|[PolarAxisTheme](#polaraxistheme)|[RadarAxisTheme](#radaraxistheme)|[RadiusAxisTheme](#radiusaxistheme)|
|
- [AxisTheme](#axistheme)
|
||||||
|[SelectStyle](#selectstyle)|[SerieData](#seriedata)|[SerieSymbol](#seriesymbol)|[SerieTheme](#serietheme)|
|
- [AxisTick](#axistick)
|
||||||
|[StageColor](#stagecolor)|[StateStyle](#statestyle)|[SubTitleTheme](#subtitletheme)|[SymbolStyle](#symbolstyle)|
|
- [BaseAxisTheme](#baseaxistheme)
|
||||||
|[TextLimit](#textlimit)|[TextPadding](#textpadding)|[TextStyle](#textstyle)|[ThemeStyle](#themestyle)|
|
- [BaseLine](#baseline)
|
||||||
|[TitleStyle](#titlestyle)|[TitleTheme](#titletheme)|[TooltipTheme](#tooltiptheme)|[VisualMapRange](#visualmaprange)|
|
- [BlurStyle](#blurstyle)
|
||||||
|[VisualMapTheme](#visualmaptheme)|
|
- [CommentItem](#commentitem)
|
||||||
|
- [CommentMarkStyle](#commentmarkstyle)
|
||||||
|
- [ComponentTheme](#componenttheme)
|
||||||
|
- [DataZoomTheme](#datazoomtheme)
|
||||||
|
- [EmphasisStyle](#emphasisstyle)
|
||||||
|
- [EndLabelStyle](#endlabelstyle)
|
||||||
|
- [IconStyle](#iconstyle)
|
||||||
|
- [ImageStyle](#imagestyle)
|
||||||
|
- [ItemStyle](#itemstyle)
|
||||||
|
- [LabelLine](#labelline)
|
||||||
|
- [LabelStyle](#labelstyle)
|
||||||
|
- [LegendTheme](#legendtheme)
|
||||||
|
- [Level](#level)
|
||||||
|
- [LevelStyle](#levelstyle)
|
||||||
|
- [LineArrow](#linearrow)
|
||||||
|
- [LineStyle](#linestyle)
|
||||||
|
- [Location](#location)
|
||||||
|
- [MarkAreaData](#markareadata)
|
||||||
|
- [MarkLineData](#marklinedata)
|
||||||
|
- [MarqueeStyle](#marqueestyle)
|
||||||
|
- [Padding](#padding)
|
||||||
|
- [PolarAxisTheme](#polaraxistheme)
|
||||||
|
- [RadarAxisTheme](#radaraxistheme)
|
||||||
|
- [RadiusAxisTheme](#radiusaxistheme)
|
||||||
|
- [SelectStyle](#selectstyle)
|
||||||
|
- [SerieData](#seriedata)
|
||||||
|
- [SerieSymbol](#seriesymbol)
|
||||||
|
- [SerieTheme](#serietheme)
|
||||||
|
- [StageColor](#stagecolor)
|
||||||
|
- [StateStyle](#statestyle)
|
||||||
|
- [SubTitleTheme](#subtitletheme)
|
||||||
|
- [SymbolStyle](#symbolstyle)
|
||||||
|
- [TextLimit](#textlimit)
|
||||||
|
- [TextPadding](#textpadding)
|
||||||
|
- [TextStyle](#textstyle)
|
||||||
|
- [ThemeStyle](#themestyle)
|
||||||
|
- [TitleStyle](#titlestyle)
|
||||||
|
- [TitleTheme](#titletheme)
|
||||||
|
- [TooltipTheme](#tooltiptheme)
|
||||||
|
- [UIComponentTheme](#uicomponenttheme)
|
||||||
|
- [VisualMapRange](#visualmaprange)
|
||||||
|
- [VisualMapTheme](#visualmaptheme)
|
||||||
|
|
||||||
## ISerieExtraComponent 系列的额外组件
|
|
||||||
|
|
||||||
|||||
|
## ISerieComponent 可添加到Serie的组件
|
||||||
|--|--|--|--|
|
|
||||||
|[AreaStyle](#areastyle)|[BlurStyle](#blurstyle)|[EmphasisStyle](#emphasisstyle)|[ImageStyle](#imagestyle)|
|
|
||||||
|[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LineArrow](#linearrow)|[SelectStyle](#selectstyle)|
|
|
||||||
|[TitleStyle](#titlestyle)|
|
|
||||||
|
|
||||||
## ISerieDataComponent 数据项的额外组件
|
- [AreaStyle](#areastyle)
|
||||||
|
- [BlurStyle](#blurstyle)
|
||||||
|
- [EmphasisStyle](#emphasisstyle)
|
||||||
|
- [ImageStyle](#imagestyle)
|
||||||
|
- [LabelLine](#labelline)
|
||||||
|
- [LabelStyle](#labelstyle)
|
||||||
|
- [LineArrow](#linearrow)
|
||||||
|
- [SelectStyle](#selectstyle)
|
||||||
|
- [TitleStyle](#titlestyle)
|
||||||
|
|
||||||
|
|
||||||
|
## ISerieDataComponent 可添加到SerieData的组件
|
||||||
|
|
||||||
|
- [AreaStyle](#areastyle)
|
||||||
|
- [BlurStyle](#blurstyle)
|
||||||
|
- [EmphasisStyle](#emphasisstyle)
|
||||||
|
- [ImageStyle](#imagestyle)
|
||||||
|
- [ItemStyle](#itemstyle)
|
||||||
|
- [LabelLine](#labelline)
|
||||||
|
- [LabelStyle](#labelstyle)
|
||||||
|
- [LineStyle](#linestyle)
|
||||||
|
- [SelectStyle](#selectstyle)
|
||||||
|
- [SerieSymbol](#seriesymbol)
|
||||||
|
- [TitleStyle](#titlestyle)
|
||||||
|
|
||||||
|||||
|
|
||||||
|--|--|--|--|
|
|
||||||
|[AreaStyle](#areastyle)|[BlurStyle](#blurstyle)|[EmphasisStyle](#emphasisstyle)|[ImageStyle](#imagestyle)|
|
|
||||||
|[ItemStyle](#itemstyle)|[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LineStyle](#linestyle)|
|
|
||||||
|[SelectStyle](#selectstyle)|[SerieSymbol](#seriesymbol)|[TitleStyle](#titlestyle)|
|
|
||||||
|
|
||||||
## Other 其他组件
|
## Other 其他组件
|
||||||
|
|
||||||
|||||
|
- [BaseSerie](#baseserie)
|
||||||
|--|--|--|--|
|
- [ChartText](#charttext)
|
||||||
|[BaseSerie](#baseserie)|[ChartText](#charttext)|[ChildComponent](#childcomponent)|[DebugInfo](#debuginfo)|
|
- [ChildComponent](#childcomponent)
|
||||||
|[Indicator](#indicator)|[Lang](#lang)|[LangCandlestick](#langcandlestick)|[LangTime](#langtime)|
|
- [DebugInfo](#debuginfo)
|
||||||
|[MainComponent](#maincomponent)|[XCResourcesImporter](#xcresourcesimporter)|[XCSettings](#xcsettings)|
|
- [Indicator](#indicator)
|
||||||
|
- [Lang](#lang)
|
||||||
|
- [LangCandlestick](#langcandlestick)
|
||||||
|
- [LangTime](#langtime)
|
||||||
|
- [MainComponent](#maincomponent)
|
||||||
|
- [XCResourcesImporter](#xcresourcesimporter)
|
||||||
|
- [XCSettings](#xcsettings)
|
||||||
|
|
||||||
|
|
||||||
## AngleAxis
|
## AngleAxis
|
||||||
|
|
||||||
@@ -116,7 +216,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent)
|
|||||||
|
|
||||||
## AreaStyle
|
## AreaStyle
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
区域填充样式。
|
区域填充样式。
|
||||||
|
|
||||||
@@ -128,6 +228,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent
|
|||||||
|toColor|||渐变色的终点颜色。
|
|toColor|||渐变色的终点颜色。
|
||||||
|opacity|0.6f||图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
|opacity|0.6f||图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
||||||
|innerFill||v3.2.0|是否只填充多边形区域。目前只支持凸多边形。
|
|innerFill||v3.2.0|是否只填充多边形区域。目前只支持凸多边形。
|
||||||
|
|toTop|true|v3.6.0|渐变色是到顶部还是到实际位置。默认为true到顶部。
|
||||||
|
|
||||||
## ArrowStyle
|
## ArrowStyle
|
||||||
|
|
||||||
@@ -354,7 +455,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai
|
|||||||
|
|
||||||
## BlurStyle
|
## BlurStyle
|
||||||
|
|
||||||
Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
> 从 `v3.2.0` 开始支持
|
> 从 `v3.2.0` 开始支持
|
||||||
|
|
||||||
@@ -473,6 +574,8 @@ DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息
|
|||||||
|lineStyle|||阴影线条样式。 [LineStyle](#linestyle)|
|
|lineStyle|||阴影线条样式。 [LineStyle](#linestyle)|
|
||||||
|areaStyle|||阴影填充样式。 [AreaStyle](#areastyle)|
|
|areaStyle|||阴影填充样式。 [AreaStyle](#areastyle)|
|
||||||
|marqueeStyle||v3.5.0|选取框样式。 [MarqueeStyle](#marqueestyle)|
|
|marqueeStyle||v3.5.0|选取框样式。 [MarqueeStyle](#marqueestyle)|
|
||||||
|
|startLock||v3.6.0|固定起始值,不让改变。
|
||||||
|
|endLock||v3.6.0|固定结束值,不让改变。
|
||||||
|
|
||||||
## DataZoomTheme
|
## DataZoomTheme
|
||||||
|
|
||||||
@@ -505,7 +608,7 @@ Inherits or Implemented: [BaseScatter](#basescatter)
|
|||||||
|
|
||||||
## EmphasisStyle
|
## EmphasisStyle
|
||||||
|
|
||||||
Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
> 从 `v3.2.0` 开始支持
|
> 从 `v3.2.0` 开始支持
|
||||||
|
|
||||||
@@ -567,7 +670,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent)
|
|||||||
|
|
||||||
## ImageStyle
|
## ImageStyle
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
|field|default|since|comment|
|
|field|default|since|comment|
|
||||||
|--|--|--|--|
|
|--|--|--|--|
|
||||||
@@ -622,6 +725,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieDataComponent]
|
|||||||
|color0|||数据项颜色。
|
|color0|||数据项颜色。
|
||||||
|toColor|||渐变色的颜色1。
|
|toColor|||渐变色的颜色1。
|
||||||
|toColor2|||渐变色的颜色2。只在折线图中有效。
|
|toColor2|||渐变色的颜色2。只在折线图中有效。
|
||||||
|
|markColor||v3.6.0|Serie的标识颜色。仅用于Legend和Tooltip的展示,不影响绘制颜色,默认为clear。
|
||||||
|backgroundColor|||数据项背景颜色。
|
|backgroundColor|||数据项背景颜色。
|
||||||
|backgroundWidth|||数据项背景宽度。
|
|backgroundWidth|||数据项背景宽度。
|
||||||
|centerColor|||中心区域颜色。
|
|centerColor|||中心区域颜色。
|
||||||
@@ -639,7 +743,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieDataComponent]
|
|||||||
|
|
||||||
## LabelLine
|
## LabelLine
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
标签的引导线
|
标签的引导线
|
||||||
|
|
||||||
@@ -658,7 +762,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent
|
|||||||
|
|
||||||
## LabelStyle
|
## LabelStyle
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等。
|
图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等。
|
||||||
|
|
||||||
@@ -669,6 +773,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent
|
|||||||
|autoOffset|false||是否开启自动偏移。当开启时,Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
|
|autoOffset|false||是否开启自动偏移。当开启时,Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
|
||||||
|offset|||距离图形元素的偏移
|
|offset|||距离图形元素的偏移
|
||||||
|rotate|||文本的旋转。
|
|rotate|||文本的旋转。
|
||||||
|
|autoRotate|false|v3.6.0|是否自动旋转。
|
||||||
|distance|||距离轴线的距离。
|
|distance|||距离轴线的距离。
|
||||||
|formatter|||标签内容字符串模版格式器。支持用 \n 换行。 模板变量有: {.}:圆点标记。 {a}:系列名。 {a}:系列名。 {b}:类目值或数据名。 {c}:数据值。 {d}:百分比。 {e}:数据名。 {f}:数据和。 示例:“{b}:{c}”
|
|formatter|||标签内容字符串模版格式器。支持用 \n 换行。 模板变量有: {.}:圆点标记。 {a}:系列名。 {a}:系列名。 {b}:类目值或数据名。 {c}:数据值。 {d}:百分比。 {e}:数据名。 {f}:数据和。 示例:“{b}:{c}”
|
||||||
|numericFormatter|||标准数字格式字符串。用于将数值格式化显示为字符串。 使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。 参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
|
|numericFormatter|||标准数字格式字符串。用于将数值格式化显示为字符串。 使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。 参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
|
||||||
@@ -718,6 +823,7 @@ Inherits or Implemented: [MainComponent](#maincomponent),[IPropertyChanged](#ipr
|
|||||||
|colors|||图例标记的颜色列表。
|
|colors|||图例标记的颜色列表。
|
||||||
|background||v3.1.0|背景图样式。 [ImageStyle](#imagestyle)|
|
|background||v3.1.0|背景图样式。 [ImageStyle](#imagestyle)|
|
||||||
|padding||v3.1.0|图例标记和背景的间距。 [Padding](#padding)|
|
|padding||v3.1.0|图例标记和背景的间距。 [Padding](#padding)|
|
||||||
|
|positions||v3.6.0|图例标记的自定义位置列表。
|
||||||
|
|
||||||
## LegendTheme
|
## LegendTheme
|
||||||
|
|
||||||
@@ -753,7 +859,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai
|
|||||||
|
|
||||||
## LineArrow
|
## LineArrow
|
||||||
|
|
||||||
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent)
|
Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent)
|
||||||
|
|
||||||
|field|default|since|comment|
|
|field|default|since|comment|
|
||||||
|--|--|--|--|
|
|--|--|--|--|
|
||||||
@@ -986,7 +1092,7 @@ Inherits or Implemented: [BaseScatter](#basescatter)
|
|||||||
|
|
||||||
## SelectStyle
|
## SelectStyle
|
||||||
|
|
||||||
Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent)
|
Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent)
|
||||||
|
|
||||||
> 从 `v3.2.0` 开始支持
|
> 从 `v3.2.0` 开始支持
|
||||||
|
|
||||||
@@ -1008,7 +1114,6 @@ Inherits or Implemented: [BaseSerie](#baseserie),[IComparable](#icomparable)
|
|||||||
|serieName|||系列名称,用于 tooltip 的显示,legend 的图例筛选。
|
|serieName|||系列名称,用于 tooltip 的显示,legend 的图例筛选。
|
||||||
|state||v3.2.0|系列的默认状态。<br/>`SerieState`:<br/>- `Normal`: 正常状态。<br/>- `Emphasis`: 高亮状态。<br/>- `Blur`: 淡出状态。<br/>- `Select`: 选中状态。<br/>- `Auto`: 自动保持和父节点一致。一般用在SerieData。<br/>|
|
|state||v3.2.0|系列的默认状态。<br/>`SerieState`:<br/>- `Normal`: 正常状态。<br/>- `Emphasis`: 高亮状态。<br/>- `Blur`: 淡出状态。<br/>- `Select`: 选中状态。<br/>- `Auto`: 自动保持和父节点一致。一般用在SerieData。<br/>|
|
||||||
|colorBy||v3.2.0|从主题中取色的策略。<br/>`SerieColorBy`:<br/>- `Default`: 默认策略。每种Serie都有自己的默认的取颜色策略。比如Line默认是Series策略,Pie默认是Data策略<br/>- `Serie`: 按照系列分配调色盘中的颜色,同一系列中的所有数据都是用相同的颜色。<br/>- `Data`: 按照数据项分配调色盘中的颜色,每个数据项都使用不同的颜色。<br/>|
|
|colorBy||v3.2.0|从主题中取色的策略。<br/>`SerieColorBy`:<br/>- `Default`: 默认策略。每种Serie都有自己的默认的取颜色策略。比如Line默认是Series策略,Pie默认是Data策略<br/>- `Serie`: 按照系列分配调色盘中的颜色,同一系列中的所有数据都是用相同的颜色。<br/>- `Data`: 按照数据项分配调色盘中的颜色,每个数据项都使用不同的颜色。<br/>|
|
||||||
|markColor||v3.4.0|Serie的标识颜色。仅用于Legend和Tooltip的展示,不影响绘制颜色,默认为clear。
|
|
||||||
|stack|||数据堆叠,同个类目轴上系列配置相同的stack值后,后一个系列的值会在前一个系列的值上相加。
|
|stack|||数据堆叠,同个类目轴上系列配置相同的stack值后,后一个系列的值会在前一个系列的值上相加。
|
||||||
|xAxisIndex|0||使用X轴的index。
|
|xAxisIndex|0||使用X轴的index。
|
||||||
|yAxisIndex|0||使用Y轴的index。
|
|yAxisIndex|0||使用Y轴的index。
|
||||||
@@ -1024,7 +1129,7 @@ Inherits or Implemented: [BaseSerie](#baseserie),[IComparable](#icomparable)
|
|||||||
|sampleType|||采样类型。当sampleDist大于0时有效。<br/>`SampleType`:<br/>- `Peak`: 取峰值。<br/>- `Average`: 取过滤点的平均值。<br/>- `Max`: 取过滤点的最大值。<br/>- `Min`: 取过滤点的最小值。<br/>- `Sum`: 取过滤点的和。<br/>|
|
|sampleType|||采样类型。当sampleDist大于0时有效。<br/>`SampleType`:<br/>- `Peak`: 取峰值。<br/>- `Average`: 取过滤点的平均值。<br/>- `Max`: 取过滤点的最大值。<br/>- `Min`: 取过滤点的最小值。<br/>- `Sum`: 取过滤点的和。<br/>|
|
||||||
|sampleAverage|0||设定的采样平均值。当sampleType 为 Peak 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为0时会实时计算所有数据的平均值。
|
|sampleAverage|0||设定的采样平均值。当sampleType 为 Peak 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为0时会实时计算所有数据的平均值。
|
||||||
|lineType|||折线图样式类型。<br/>`LineType`:<br/>- `Normal`: 普通折线图。<br/>- `Smooth`: 平滑曲线。<br/>- `StepStart`: 阶梯线图:当前点。<br/>- `StepMiddle`: 阶梯线图:当前点和下一个点的中间。<br/>- `StepEnd`: 阶梯线图:下一个拐点。<br/>|
|
|lineType|||折线图样式类型。<br/>`LineType`:<br/>- `Normal`: 普通折线图。<br/>- `Smooth`: 平滑曲线。<br/>- `StepStart`: 阶梯线图:当前点。<br/>- `StepMiddle`: 阶梯线图:当前点和下一个点的中间。<br/>- `StepEnd`: 阶梯线图:下一个拐点。<br/>|
|
||||||
|smoothLimit|true|v3.4.0|是否限制曲线。当为true时,两个连续相同数值的数据间的曲线会限制为不超出数据点,和数据点是平直的。
|
|smoothLimit|false|v3.4.0|是否限制曲线。当为true时,两个连续相同数值的数据间的曲线会限制为不超出数据点,和数据点是平直的。
|
||||||
|barType|||柱形图类型。<br/>`BarType`:<br/>- `Normal`: 普通柱形图。<br/>- `Zebra`: 斑马柱形图。<br/>- `Capsule`: 胶囊柱形图。<br/>|
|
|barType|||柱形图类型。<br/>`BarType`:<br/>- `Normal`: 普通柱形图。<br/>- `Zebra`: 斑马柱形图。<br/>- `Capsule`: 胶囊柱形图。<br/>|
|
||||||
|barPercentStack|false||柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。
|
|barPercentStack|false||柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。
|
||||||
|barWidth|0||柱条的宽度,不设时自适应。支持设置成相对于类目宽度的百分比。
|
|barWidth|0||柱条的宽度,不设时自适应。支持设置成相对于类目宽度的百分比。
|
||||||
@@ -1341,7 +1446,7 @@ Inherits or Implemented: [MainComponent](#maincomponent),[IPropertyChanged](#ipr
|
|||||||
|
|
||||||
## TitleStyle
|
## TitleStyle
|
||||||
|
|
||||||
Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieExtraComponent](#iserieextracomponent)
|
Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieComponent](#iseriecomponent)
|
||||||
|
|
||||||
标题相关设置。
|
标题相关设置。
|
||||||
|
|
||||||
@@ -1364,7 +1469,7 @@ Inherits or Implemented: [MainComponent](#maincomponent)
|
|||||||
|trigger|||触发类型。<br/>`Tooltip.Trigger`:<br/>- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。<br/>- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。<br/>- `None`: 什么都不触发。<br/>|
|
|trigger|||触发类型。<br/>`Tooltip.Trigger`:<br/>- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。<br/>- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。<br/>- `None`: 什么都不触发。<br/>|
|
||||||
|position||v3.3.0|显示位置类型。<br/>`Tooltip.Position`:<br/>- `Auto`: 自适应。移动平台靠顶部显示,非移动平台跟随鼠标位置。<br/>- `Custom`: 自定义。完全自定义显示位置(x,y)。<br/>- `FixedX`: 只固定坐标X。Y跟随鼠标位置。<br/>- `FixedY`: <br/>|
|
|position||v3.3.0|显示位置类型。<br/>`Tooltip.Position`:<br/>- `Auto`: 自适应。移动平台靠顶部显示,非移动平台跟随鼠标位置。<br/>- `Custom`: 自定义。完全自定义显示位置(x,y)。<br/>- `FixedX`: 只固定坐标X。Y跟随鼠标位置。<br/>- `FixedY`: <br/>|
|
||||||
|itemFormatter|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用
|
|itemFormatter|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用
|
||||||
|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/> {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}"
|
|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}"
|
||||||
|marker|||serie的符号标志。
|
|marker|||serie的符号标志。
|
||||||
|fixedWidth|0||固定宽度。比 minWidth 优先。
|
|fixedWidth|0||固定宽度。比 minWidth 优先。
|
||||||
|fixedHeight|0||固定高度。比 minHeight 优先。
|
|fixedHeight|0||固定高度。比 minHeight 优先。
|
||||||
@@ -1404,6 +1509,16 @@ Inherits or Implemented: [ComponentTheme](#componenttheme)
|
|||||||
|labelTextColor|||十字指示器坐标轴标签的文本颜色。
|
|labelTextColor|||十字指示器坐标轴标签的文本颜色。
|
||||||
|labelBackgroundColor|||十字指示器坐标轴标签的背景颜色。
|
|labelBackgroundColor|||十字指示器坐标轴标签的背景颜色。
|
||||||
|
|
||||||
|
## UIComponentTheme
|
||||||
|
|
||||||
|
Inherits or Implemented: [ChildComponent](#childcomponent)
|
||||||
|
|
||||||
|
|field|default|since|comment|
|
||||||
|
|--|--|--|--|
|
||||||
|
|show|true||
|
||||||
|
|sharedTheme|||主题配置。 [Theme](#theme)|
|
||||||
|
|transparentBackground|false||
|
||||||
|
|
||||||
## VisualMap
|
## VisualMap
|
||||||
|
|
||||||
Inherits or Implemented: [MainComponent](#maincomponent)
|
Inherits or Implemented: [MainComponent](#maincomponent)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 4
|
sidebar_position: 41
|
||||||
slug: /faq
|
slug: /faq
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 6
|
title: 订阅服务
|
||||||
|
sidebar_position: 51
|
||||||
slug: /support
|
slug: /support
|
||||||
---
|
---
|
||||||
|
|
||||||
# 订阅服务
|
# 订阅服务
|
||||||
|
|
||||||
如需技术支持,可订阅`个人VIP`服务。扫后面的二维码后可加VIP群`867291970`,验证信息请输入付费的账号。
|
如需技术支持,可订阅`个人VIP`服务。扫后面的二维码付费后可加VIP群`867291970`,验证信息请输入付费的账号。
|
||||||
企业商务合作可联系QQ:3525422251(XCharts技术支持)。
|
企业商务合作可联系QQ:3525422251(XCharts技术支持)。
|
||||||
|
|
||||||
## 订阅VIP服务
|
## 订阅VIP服务
|
||||||
|
|
||||||
订阅服务分个人订阅和企业订阅:
|
订阅服务分`个人订阅`和`企业订阅`:
|
||||||
|
|
||||||
- `个人`订阅:`个人VIP`属于个人,不可转让,`XCharts`团队只服务于订阅当事人。
|
- `个人订阅`:`个人VIP`属于个人,不可转让,`XCharts`团队只服务于订阅当事人。
|
||||||
- `企业`订阅:`企业VIP`属于企业,席位内可安排固定职员,职员离职后席位可重新安排,`XCharts`团队通过专属企业群为企业服务。
|
- `企业订阅`:`企业VIP`属于企业,席位内可安排固定职员,职员离职后席位可重新安排,`XCharts`团队通过专属企业群为企业服务。
|
||||||
|
|
||||||
订阅服务的优势?
|
订阅服务有哪些优势?
|
||||||
|
|
||||||
- 提高工作效率,节省时间成本。一方面,`XCharts`功能强大,相关配置项非常多,`VIP`服务可快速帮您定位,节省去查找和核对的时间;另一方面,`VIP`的即时回答服务可快速为您答疑解惑,避免中断开发流程。总之,订阅`VIP`可让您能快速上手,快速处理问题,至少能提高`10`倍以上的工作效率。
|
- 提高工作效率,节省时间成本。一方面,`XCharts`功能强大,相关配置项非常多,`VIP`服务可快速帮您定位,节省去查找和核对的时间;另一方面,`VIP`的即时回答服务可快速为您答疑解惑,避免中断开发流程,快速上手,快速处理问题,至少能提高`10`倍以上的工作效率。
|
||||||
- 更多技术交流,更多经验交流。`XCharts`团队成员从业多年,有丰富的技术和工作经验。`VIP`服务不仅可以交流`XCharts`相关的内容,也可以咨询其他方面的技术。`VIP`群也有更多的交流。
|
- 更多技术交流,更多经验交流。`XCharts`团队成员从业多年,有丰富的技术和工作经验。`VIP`服务不仅可以交流`XCharts`相关的内容,也可以咨询其他方面的技术。`VIP`群也有更多的交流。
|
||||||
- 扩展图表的需要订阅`VIP`服务后才能购买,扩展图表超过1年后的更新支持也需要持续订阅`VIP`服务。
|
- 扩展图表需要订阅`VIP`服务后才能购买,扩展图表超过1年后的更新支持也需要持续订阅`VIP`服务。
|
||||||
- `VIP`用户可加入`XCharts`的`GitHub`组织,参与`XCharts`社区构建,访问专有仓库。
|
- `VIP`用户可加入`XCharts`的`GitHub`组织,参与`XCharts`的社区构建,访问专有仓库。拥有`扩展UI组件`等专属功能。
|
||||||
|
- 在`XCharts交流群`里拥有`VIP`专属标识,问题会第一时间得到响应,有问即答。
|
||||||
|
|
||||||
| |免费用户|付费咨询|个人`VIP` | 个人`SVIP` | 企业`VIP` |
|
| |免费用户|付费咨询|个人`VIP` | 个人`SVIP` | 企业`VIP` |
|
||||||
| ----- |--|--|--|--|--|
|
| ----- |--|--|--|--|--|
|
||||||
@@ -34,8 +36,7 @@ slug: /support
|
|||||||
| __`服务内容:`__|
|
| __`服务内容:`__|
|
||||||
| 可商用 | √ | √ | √ | √ | √ |
|
| 可商用 | √ | √ | √ | √ | √ |
|
||||||
| 可二次开发 | √ | √ | √ | √ | √ |
|
| 可二次开发 | √ | √ | √ | √ | √ |
|
||||||
| 有问必答 | | √ | √ | √ | √ |
|
| 有问即答 | | √ | √ | √ | √ |
|
||||||
| 即时回答 | | √ | √ | √ | √ |
|
|
||||||
| 新手指导 | | √ | √ | √ | √ |
|
| 新手指导 | | √ | √ | √ | √ |
|
||||||
| 开发指导 | | √ | √ | √ | √ |
|
| 开发指导 | | √ | √ | √ | √ |
|
||||||
| 优化指导 | | √ | √ | √ | √ |
|
| 优化指导 | | √ | √ | √ | √ |
|
||||||
@@ -44,7 +45,7 @@ slug: /support
|
|||||||
| 需求优先考虑 | | | √ | √ | √ |
|
| 需求优先考虑 | | | √ | √ | √ |
|
||||||
| 可另付费定制 | | | √ | √ | √ |
|
| 可另付费定制 | | | √ | √ | √ |
|
||||||
| 可另付费加急 | | | √ | √ | √ |
|
| 可另付费加急 | | | √ | √ | √ |
|
||||||
| VIP专有功能教程和文档 | | | √待开放 | √待开放 | √待开放 |
|
| 扩展UI组件 | | | √ | √ | √ |
|
||||||
| 扩展图表购买 | | | 按需购买 | __全部免费__ | __全部免费__ |
|
| 扩展图表购买 | | | 按需购买 | __全部免费__ | __全部免费__ |
|
||||||
| 扩展图表源码 | | | 永久持有 | 永久持有 | 永久持有 |
|
| 扩展图表源码 | | | 永久持有 | 永久持有 | 永久持有 |
|
||||||
| 扩展图表更新 | | | 1年更新支持 | 1年更新支持 | 1年更新支持 |
|
| 扩展图表更新 | | | 1年更新支持 | 1年更新支持 | 1年更新支持 |
|
||||||
@@ -53,7 +54,7 @@ slug: /support
|
|||||||
|
|
||||||
扩展图表为另付费购买图表,只对订阅了`VIP`服务的用户开放购买。对于`SVIP`的订阅用户,所有扩展图表仓库可免费使用,不用再单独购买。
|
扩展图表为另付费购买图表,只对订阅了`VIP`服务的用户开放购买。对于`SVIP`的订阅用户,所有扩展图表仓库可免费使用,不用再单独购买。
|
||||||
|
|
||||||
对所有已购买的扩展图表,源码可永久持有,并获得持续一年的更新支持,一年后如需更新支持服务,可继续订阅`VIP`服务。
|
对所有已购买的扩展图表,源码可永久持有,并获得持续一年的更新支持,一年后如需更新支持服务,可再继续订阅`VIP`服务。
|
||||||
|
|
||||||
|编号|扩展图表|价格|备注|
|
|编号|扩展图表|价格|备注|
|
||||||
|--|--|--|--|
|
|--|--|--|--|
|
||||||
@@ -70,13 +71,17 @@ slug: /support
|
|||||||
## 备注说明
|
## 备注说明
|
||||||
|
|
||||||
1. __`付费定制`__ 是指用户可根据自己的需求定制不同的图表或新功能,只有`VIP`用户才享有`付费定制`权利。
|
1. __`付费定制`__ 是指用户可根据自己的需求定制不同的图表或新功能,只有`VIP`用户才享有`付费定制`权利。
|
||||||
2. __`付费加急`__ 是指用户可对自己非常紧急的需求进行付费,将开发优先级提到最高,并可要求在`Deadline`内交付,只有`VIP`用户才享有`付费加急`权利。
|
2. __`付费加急`__ 是指用户可对自己非常紧急的需求进行付费,将开发优先级提到最高,并可要求在指定`截止日期`内交付,只有`VIP`用户才享有`付费加急`权利。
|
||||||
3. __`付费咨询`__ 付费咨询有效期`7`天,且总咨询时长不超过`7`个小时。
|
3. __`付费咨询`__ 付费咨询有效期`7`天,且总咨询时长不超过`7`个小时。
|
||||||
4. __`扩展图表`__ 购买后代码可永久持有和商用,1年的更新支持。
|
4. __`扩展图表`__ 购买后代码可永久持有和商用,1年的更新和技术支持。
|
||||||
|
|
||||||
## 捐助支持
|
## 捐助支持
|
||||||
|
|
||||||
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎任意金额的捐助,非常您的支持!
|
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎任意金额的捐助,非常感谢您的支持!
|
||||||
|
|
||||||
|
## 二维码
|
||||||
|
|
||||||
|
如果看不到二维码图片,可以加QQ`XCharts技术支持:3525422251`或邮件`monitor1394@gmail.com`咨询。
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: 入门教程:5分钟上手 XCharts 3.0
|
title: 入门教程:5分钟上手 XCharts 3.0
|
||||||
sidebar_position: 1
|
sidebar_position: 11
|
||||||
slug: /tutorial01
|
slug: /tutorial01
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -105,29 +105,29 @@ chart.SetSize(580, 300);//代码动态设置尺寸,或直接操作chart.rectTr
|
|||||||
设置标题:
|
设置标题:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var title = chart.GetOrAddChartComponent<Title>();
|
var title = chart.EnsureChartComponent<Title>();
|
||||||
title.text = "Simple Line";
|
title.text = "Simple Line";
|
||||||
```
|
```
|
||||||
|
|
||||||
设置提示框和图例是否显示:
|
设置提示框和图例是否显示:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var tooltip = chart.GetOrAddChartComponent<Tooltip>();
|
var tooltip = chart.EnsureChartComponent<Tooltip>();
|
||||||
tooltip.show = true;
|
tooltip.show = true;
|
||||||
|
|
||||||
var legend = chart.GetOrAddChartComponent<Legend>();
|
var legend = chart.EnsureChartComponent<Legend>();
|
||||||
legend.show = false;
|
legend.show = false;
|
||||||
```
|
```
|
||||||
|
|
||||||
设置坐标轴:
|
设置坐标轴:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
|
|
||||||
var yAxis = chart.GetOrAddChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
yAxis.type = Axis.AxisType.Value;
|
yAxis.type = Axis.AxisType.Value;
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -201,11 +201,11 @@ XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换
|
|||||||
需要先获取组件,再修改里面的参数:
|
需要先获取组件,再修改里面的参数:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
var title = chart.GetOrAddChartComponent<Title>();
|
var title = chart.EnsureChartComponent<Title>();
|
||||||
title.text = "Simple LineChart";
|
title.text = "Simple LineChart";
|
||||||
title.subText = "normal line";
|
title.subText = "normal line";
|
||||||
|
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
@@ -240,9 +240,9 @@ serie.roundCap = true;
|
|||||||
给Serie添加额外组件:
|
给Serie添加额外组件:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
serie.AddExtraComponent<AreaStyle>();
|
serie.EnsureComponent<AreaStyle>();
|
||||||
|
|
||||||
var label = serie1.AddExtraComponent<LabelStyle>();
|
var label = serie1.EnsureComponent<LabelStyle>();
|
||||||
label.offset = new Vector3(0,20,0);
|
label.offset = new Vector3(0,20,0);
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ var serieData = chart.AddData(0, 20);
|
|||||||
//var serieData = serie.GetSerieData(0); //从已有数据中获取
|
//var serieData = serie.GetSerieData(0); //从已有数据中获取
|
||||||
serieData.radius = 10;
|
serieData.radius = 10;
|
||||||
|
|
||||||
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件
|
var itemStyle = serieData.EnsureComponent<ItemStyle>(); //给数据项添加ItemStyle组件
|
||||||
itemStyle.color = Color.blue;
|
itemStyle.color = Color.blue;
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace XCharts.Editor
|
|||||||
{
|
{
|
||||||
public static readonly GUIContent btnAddSerie = new GUIContent("Add Serie", "");
|
public static readonly GUIContent btnAddSerie = new GUIContent("Add Serie", "");
|
||||||
public static readonly GUIContent btnAddComponent = new GUIContent("Add Main Component", "");
|
public static readonly GUIContent btnAddComponent = new GUIContent("Add Main Component", "");
|
||||||
public static readonly GUIContent btnCovertXYAxis = new GUIContent("Covert XY Axis", "");
|
public static readonly GUIContent btnConvertXYAxis = new GUIContent("Convert XY Axis", "");
|
||||||
public static readonly GUIContent btnRebuildChartObject = new GUIContent("Rebuild Chart Object", "");
|
public static readonly GUIContent btnRebuildChartObject = new GUIContent("Rebuild Chart Object", "");
|
||||||
public static readonly GUIContent btnSaveAsImage = new GUIContent("Save As Image", "");
|
public static readonly GUIContent btnSaveAsImage = new GUIContent("Save As Image", "");
|
||||||
public static readonly GUIContent btnCheckWarning = new GUIContent("Check Warning", "");
|
public static readonly GUIContent btnCheckWarning = new GUIContent("Check Warning", "");
|
||||||
@@ -273,8 +273,8 @@ namespace XCharts.Editor
|
|||||||
{
|
{
|
||||||
if (m_Chart.HasChartComponent<XAxis>() && m_Chart.HasChartComponent<YAxis>())
|
if (m_Chart.HasChartComponent<XAxis>() && m_Chart.HasChartComponent<YAxis>())
|
||||||
{
|
{
|
||||||
if (GUILayout.Button(Styles.btnCovertXYAxis))
|
if (GUILayout.Button(Styles.btnConvertXYAxis))
|
||||||
m_Chart.CovertXYAxis(0);
|
m_Chart.ConvertXYAxis(0);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(Styles.btnRebuildChartObject))
|
if (GUILayout.Button(Styles.btnRebuildChartObject))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace XCharts.Editor
|
|||||||
PropertyField(prop, "m_Color");
|
PropertyField(prop, "m_Color");
|
||||||
PropertyField(prop, "m_ToColor");
|
PropertyField(prop, "m_ToColor");
|
||||||
PropertyField(prop, "m_Opacity");
|
PropertyField(prop, "m_Opacity");
|
||||||
|
PropertyField(prop, "m_ToTop");
|
||||||
PropertyField(prop, "m_InnerFill");
|
PropertyField(prop, "m_InnerFill");
|
||||||
--EditorGUI.indentLevel;
|
--EditorGUI.indentLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace XCharts.Editor
|
|||||||
PropertyField(prop, "m_Color0");
|
PropertyField(prop, "m_Color0");
|
||||||
PropertyField(prop, "m_ToColor");
|
PropertyField(prop, "m_ToColor");
|
||||||
PropertyField(prop, "m_ToColor2");
|
PropertyField(prop, "m_ToColor2");
|
||||||
|
PropertyField(prop, "m_MarkColor");
|
||||||
PropertyField(prop, "m_BackgroundColor");
|
PropertyField(prop, "m_BackgroundColor");
|
||||||
PropertyField(prop, "m_BackgroundWidth");
|
PropertyField(prop, "m_BackgroundWidth");
|
||||||
PropertyField(prop, "m_CenterColor");
|
PropertyField(prop, "m_CenterColor");
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace XCharts.Editor
|
|||||||
PropertyField(prop, "m_AutoOffset");
|
PropertyField(prop, "m_AutoOffset");
|
||||||
PropertyField(prop, "m_Offset");
|
PropertyField(prop, "m_Offset");
|
||||||
PropertyField(prop, "m_Distance");
|
PropertyField(prop, "m_Distance");
|
||||||
|
PropertyField(prop, "m_AutoRotate");
|
||||||
PropertyField(prop, "m_Rotate");
|
PropertyField(prop, "m_Rotate");
|
||||||
PropertyField(prop, "m_Width");
|
PropertyField(prop, "m_Width");
|
||||||
PropertyField(prop, "m_Height");
|
PropertyField(prop, "m_Height");
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ namespace XCharts.Editor
|
|||||||
PropertyField("m_RangeMode");
|
PropertyField("m_RangeMode");
|
||||||
PropertyField(m_Start);
|
PropertyField(m_Start);
|
||||||
PropertyField(m_End);
|
PropertyField(m_End);
|
||||||
|
PropertyField("m_StartLock");
|
||||||
|
PropertyField("m_EndLock");
|
||||||
PropertyField(m_MinShowNum);
|
PropertyField(m_MinShowNum);
|
||||||
if (m_Start.floatValue < 0) m_Start.floatValue = 0;
|
if (m_Start.floatValue < 0) m_Start.floatValue = 0;
|
||||||
if (m_End.floatValue > 100) m_End.floatValue = 100;
|
if (m_End.floatValue > 100) m_End.floatValue = 100;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace XCharts.Editor
|
|||||||
PropertyField("m_Padding");
|
PropertyField("m_Padding");
|
||||||
PropertyListField("m_Icons");
|
PropertyListField("m_Icons");
|
||||||
PropertyListField("m_Colors");
|
PropertyListField("m_Colors");
|
||||||
|
PropertyListField("m_Positions");
|
||||||
PropertyListField("m_Data");
|
PropertyListField("m_Data");
|
||||||
--EditorGUI.indentLevel;
|
--EditorGUI.indentLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ namespace XCharts.Editor
|
|||||||
m_Editors[id].OnDisable();
|
m_Editors[id].OnDisable();
|
||||||
chart.RemoveChartComponent(m_Editors[id].component);
|
chart.RemoveChartComponent(m_Editors[id].component);
|
||||||
m_Editors.RemoveAt(id);
|
m_Editors.RemoveAt(id);
|
||||||
|
chart.RebuildChartObject();
|
||||||
m_ComponentsProperty = m_BaseEditor.RefreshComponent();
|
m_ComponentsProperty = m_BaseEditor.RefreshComponent();
|
||||||
RefreshEditors();
|
RefreshEditors();
|
||||||
EditorUtility.SetDirty(chart);
|
EditorUtility.SetDirty(chart);
|
||||||
|
|||||||
121
Editor/MainComponents/UIComponentEditor.cs
Normal file
121
Editor/MainComponents/UIComponentEditor.cs
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Assertions;
|
||||||
|
using XCharts.Runtime;
|
||||||
|
|
||||||
|
namespace XCharts.Editor
|
||||||
|
{
|
||||||
|
public class UIComponentEditor : 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 UIComponent m_UIComponent;
|
||||||
|
|
||||||
|
public static T AddUIComponent<T>(string chartName) where T : UIComponent
|
||||||
|
{
|
||||||
|
return XChartsEditor.AddGraph<T>(chartName);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Dictionary<string, SerializedProperty> m_Properties = new Dictionary<string, SerializedProperty>();
|
||||||
|
|
||||||
|
protected virtual void OnEnable()
|
||||||
|
{
|
||||||
|
m_Properties.Clear();
|
||||||
|
m_UIComponent = (UIComponent) target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
serializedObject.Update();
|
||||||
|
PropertyField("m_Script");
|
||||||
|
|
||||||
|
OnStartInspectorGUI();
|
||||||
|
OnDebugInspectorGUI();
|
||||||
|
serializedObject.ApplyModifiedProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnStartInspectorGUI() { }
|
||||||
|
|
||||||
|
protected virtual void OnDebugInspectorGUI()
|
||||||
|
{
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
PropertyField("m_DebugModel");
|
||||||
|
OnDebugStartInspectorGUI();
|
||||||
|
if (GUILayout.Button(Styles.btnRebuildChartObject))
|
||||||
|
{
|
||||||
|
m_UIComponent.RebuildChartObject();
|
||||||
|
}
|
||||||
|
if (GUILayout.Button(Styles.btnSaveAsImage))
|
||||||
|
{
|
||||||
|
m_UIComponent.SaveAsImage();
|
||||||
|
}
|
||||||
|
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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: cd18af5634e604a3c97fb1ff0fc5d682
|
guid: d226759112b0d463b8fba4830762893c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
23
Editor/MainComponents/UIComponentThemeDrawer.cs
Normal file
23
Editor/MainComponents/UIComponentThemeDrawer.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using XCharts.Runtime;
|
||||||
|
|
||||||
|
namespace XCharts.Editor
|
||||||
|
{
|
||||||
|
[CustomPropertyDrawer(typeof(UIComponentTheme), true)]
|
||||||
|
public class UIComponentThemeDrawer : BasePropertyDrawer
|
||||||
|
{
|
||||||
|
public override string ClassName { get { return "Theme"; } }
|
||||||
|
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_SharedTheme");
|
||||||
|
PropertyField(prop, "m_TransparentBackground");
|
||||||
|
--EditorGUI.indentLevel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 17cd5e3604edc43e5b7b6bfc3c71857b
|
guid: dca2d7a2ed994420182384c2efa48c0c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -48,7 +48,6 @@ namespace XCharts.Editor
|
|||||||
PropertyField("m_Large");
|
PropertyField("m_Large");
|
||||||
PropertyField("m_LargeThreshold");
|
PropertyField("m_LargeThreshold");
|
||||||
PropertyField("m_PlaceHolder");
|
PropertyField("m_PlaceHolder");
|
||||||
PropertyField("m_MarkColor");
|
|
||||||
});
|
});
|
||||||
PropertyField("m_ItemStyle");
|
PropertyField("m_ItemStyle");
|
||||||
PropertyField("m_Animation");
|
PropertyField("m_Animation");
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ namespace XCharts.Editor
|
|||||||
PropertyField("m_ShowAsPositiveNumber");
|
PropertyField("m_ShowAsPositiveNumber");
|
||||||
PropertyField("m_Large");
|
PropertyField("m_Large");
|
||||||
PropertyField("m_LargeThreshold");
|
PropertyField("m_LargeThreshold");
|
||||||
PropertyField("m_MarkColor");
|
|
||||||
});
|
});
|
||||||
PropertyField("m_Symbol");
|
PropertyField("m_Symbol");
|
||||||
PropertyField("m_LineStyle");
|
PropertyField("m_LineStyle");
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace XCharts.Editor
|
|||||||
PropertyField("m_RoundCap");
|
PropertyField("m_RoundCap");
|
||||||
PropertyField("m_Ignore");
|
PropertyField("m_Ignore");
|
||||||
PropertyField("m_IgnoreValue");
|
PropertyField("m_IgnoreValue");
|
||||||
|
PropertyField("m_ClickOffset");
|
||||||
});
|
});
|
||||||
PropertyField("m_ItemStyle");
|
PropertyField("m_ItemStyle");
|
||||||
PropertyField("m_Animation");
|
PropertyField("m_Animation");
|
||||||
|
|||||||
@@ -204,15 +204,15 @@ namespace XCharts.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
serieDataMenus.Clear();
|
serieDataMenus.Clear();
|
||||||
if (serie.GetType().IsDefined(typeof(SerieDataExtraComponentAttribute), false))
|
if (serie.GetType().IsDefined(typeof(SerieDataComponentAttribute), false))
|
||||||
{
|
{
|
||||||
var attribute = serie.GetType().GetAttribute<SerieDataExtraComponentAttribute>();
|
var attribute = serie.GetType().GetAttribute<SerieDataComponentAttribute>();
|
||||||
foreach (var type in attribute.types)
|
foreach (var type in attribute.types)
|
||||||
{
|
{
|
||||||
var size = serieData.FindPropertyRelative(SerieData.extraComponentMap[type]).arraySize;
|
var size = serieData.FindPropertyRelative(SerieData.extraComponentMap[type]).arraySize;
|
||||||
serieDataMenus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
|
serieDataMenus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
|
||||||
{
|
{
|
||||||
serie.GetSerieData(index).GetOrAddComponent(type);
|
serie.GetSerieData(index).EnsureComponent(type);
|
||||||
EditorUtility.SetDirty(chart);
|
EditorUtility.SetDirty(chart);
|
||||||
}, size == 0));
|
}, size == 0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,22 +169,22 @@ namespace XCharts.Editor
|
|||||||
RefreshEditors();
|
RefreshEditors();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
foreach (var type in GetCovertToSerie(editor.serie.GetType()))
|
foreach (var type in GetConvertToSerie(editor.serie.GetType()))
|
||||||
{
|
{
|
||||||
editor.menus.Add(new HeaderMenuInfo("Covert to " + type.Name, () =>
|
editor.menus.Add(new HeaderMenuInfo("Convert to " + type.Name, () =>
|
||||||
{
|
{
|
||||||
CovertSerie(editor.serie, type);
|
ConvertSerie(editor.serie, type);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
if (editor.serie.GetType().IsDefined(typeof(SerieExtraComponentAttribute), false))
|
if (editor.serie.GetType().IsDefined(typeof(SerieComponentAttribute), false))
|
||||||
{
|
{
|
||||||
var attribute = editor.serie.GetType().GetAttribute<SerieExtraComponentAttribute>();
|
var attribute = editor.serie.GetType().GetAttribute<SerieComponentAttribute>();
|
||||||
foreach (var type in attribute.types)
|
foreach (var type in attribute.types)
|
||||||
{
|
{
|
||||||
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
|
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
|
||||||
editor.menus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
|
editor.menus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
|
||||||
{
|
{
|
||||||
editor.serie.AddExtraComponent(type);
|
editor.serie.EnsureComponent(type);
|
||||||
RefreshEditors();
|
RefreshEditors();
|
||||||
chart.RefreshAllComponent();
|
chart.RefreshAllComponent();
|
||||||
EditorUtility.SetDirty(chart);
|
EditorUtility.SetDirty(chart);
|
||||||
@@ -195,7 +195,7 @@ namespace XCharts.Editor
|
|||||||
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
|
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
|
||||||
editor.menus.Add(new HeaderMenuInfo("Remove " + type.Name, () =>
|
editor.menus.Add(new HeaderMenuInfo("Remove " + type.Name, () =>
|
||||||
{
|
{
|
||||||
editor.serie.RemoveExtraComponent(type);
|
editor.serie.RemoveComponent(type);
|
||||||
RefreshEditors();
|
RefreshEditors();
|
||||||
chart.RefreshAllComponent();
|
chart.RefreshAllComponent();
|
||||||
EditorUtility.SetDirty(chart);
|
EditorUtility.SetDirty(chart);
|
||||||
@@ -224,9 +224,9 @@ namespace XCharts.Editor
|
|||||||
AssetDatabase.Refresh();
|
AssetDatabase.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CovertSerie(Serie serie, Type type)
|
public void ConvertSerie(Serie serie, Type type)
|
||||||
{
|
{
|
||||||
chart.CovertSerie(serie, type);
|
chart.ConvertSerie(serie, type);
|
||||||
m_SeriesProperty = m_BaseEditor.RefreshSeries();
|
m_SeriesProperty = m_BaseEditor.RefreshSeries();
|
||||||
RefreshEditors();
|
RefreshEditors();
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ namespace XCharts.Editor
|
|||||||
AssetDatabase.Refresh();
|
AssetDatabase.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Type> GetCovertToSerie(Type serie)
|
private List<Type> GetConvertToSerie(Type serie)
|
||||||
{
|
{
|
||||||
var list = new List<Type>();
|
var list = new List<Type>();
|
||||||
var typeMap = RuntimeUtil.GetAllTypesDerivedFrom<Serie>();
|
var typeMap = RuntimeUtil.GetAllTypesDerivedFrom<Serie>();
|
||||||
|
|||||||
@@ -318,8 +318,8 @@ namespace XCharts.Editor
|
|||||||
{
|
{
|
||||||
EditorGUI.indentLevel++;
|
EditorGUI.indentLevel++;
|
||||||
var listSize = listProp.arraySize;
|
var listSize = listProp.arraySize;
|
||||||
var iconWidth = 14;
|
var iconWidth = 10;
|
||||||
var iconGap = 3f;
|
var iconGap = 0f;
|
||||||
|
|
||||||
if (showSize)
|
if (showSize)
|
||||||
{
|
{
|
||||||
@@ -383,20 +383,25 @@ namespace XCharts.Editor
|
|||||||
var isSerie = "Serie".Equals(element.type);
|
var isSerie = "Serie".Equals(element.type);
|
||||||
var elementRect = isSerie ?
|
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 + INDENT_WIDTH - 2 * iconGap, drawRect.height) :
|
||||||
new Rect(drawRect.x, drawRect.y, drawRect.width - 3 * iconWidth, drawRect.height);
|
new Rect(drawRect.x, drawRect.y, drawRect.width - 4 * iconWidth, drawRect.height);
|
||||||
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
|
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
|
||||||
var iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
var iconRect = new Rect(drawRect.width - 4 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
||||||
var oldColor = GUI.contentColor;
|
var oldColor = GUI.contentColor;
|
||||||
GUI.contentColor = Color.black;
|
GUI.contentColor = Color.black;
|
||||||
if (GUI.Button(iconRect, EditorCustomStyles.iconUp, EditorCustomStyles.invisibleButton))
|
if (GUI.Button(iconRect, EditorCustomStyles.iconUp, EditorCustomStyles.invisibleButton))
|
||||||
{
|
{
|
||||||
if (i > 0) listProp.MoveArrayElement(i, i - 1);
|
if (i > 0) listProp.MoveArrayElement(i, i - 1);
|
||||||
}
|
}
|
||||||
iconRect = new Rect(drawRect.width - 2 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
||||||
if (GUI.Button(iconRect, EditorCustomStyles.iconDown, EditorCustomStyles.invisibleButton))
|
if (GUI.Button(iconRect, EditorCustomStyles.iconDown, EditorCustomStyles.invisibleButton))
|
||||||
{
|
{
|
||||||
if (i < listProp.arraySize - 1) listProp.MoveArrayElement(i, i + 1);
|
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);
|
iconRect = new Rect(drawRect.width - iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
||||||
if (GUI.Button(iconRect, EditorCustomStyles.iconRemove, EditorCustomStyles.invisibleButton))
|
if (GUI.Button(iconRect, EditorCustomStyles.iconRemove, EditorCustomStyles.invisibleButton))
|
||||||
{
|
{
|
||||||
@@ -539,7 +544,7 @@ namespace XCharts.Editor
|
|||||||
return HEADER_HEIGHT;
|
return HEADER_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool DrawHeader(string title, bool state, bool drawBackground, SerializedProperty activeField,
|
public static bool DrawHeader(string title, bool state, bool drawBackground, SerializedProperty activeField,
|
||||||
Action<Rect> drawCallback, params HeaderMenuInfo[] menus)
|
Action<Rect> drawCallback, params HeaderMenuInfo[] menus)
|
||||||
{
|
{
|
||||||
var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT);
|
var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT);
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b92d575a960f54e9a9417cca092d1e11
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
using UnityEditor;
|
|
||||||
using XCharts.Runtime;
|
|
||||||
|
|
||||||
namespace XCharts.Editor
|
|
||||||
{
|
|
||||||
[CustomEditor(typeof(ProgressBar), false)]
|
|
||||||
public class ProgressBarEditor : UnityEditor.Editor
|
|
||||||
{
|
|
||||||
|
|
||||||
[MenuItem("XCharts/ProgressBar", priority = 200)]
|
|
||||||
[MenuItem("GameObject/XCharts/ProgressBar", priority = 200)]
|
|
||||||
public static void AddPyramidChart()
|
|
||||||
{
|
|
||||||
XChartsEditor.AddChart<ProgressBar>("ProgressBar");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected SerializedProperty m_Script;
|
|
||||||
protected SerializedProperty m_Value;
|
|
||||||
protected SerializedProperty m_BackgroundColor;
|
|
||||||
protected SerializedProperty m_StartColor;
|
|
||||||
protected SerializedProperty m_EndColor;
|
|
||||||
protected SerializedProperty m_CornerRadius;
|
|
||||||
|
|
||||||
protected virtual void OnEnable()
|
|
||||||
{
|
|
||||||
m_Script = serializedObject.FindProperty("m_Script");
|
|
||||||
m_Value = serializedObject.FindProperty("m_Value");
|
|
||||||
m_BackgroundColor = serializedObject.FindProperty("m_BackgroundColor");
|
|
||||||
m_StartColor = serializedObject.FindProperty("m_StartColor");
|
|
||||||
m_EndColor = serializedObject.FindProperty("m_EndColor");
|
|
||||||
m_CornerRadius = serializedObject.FindProperty("m_CornerRadius");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnInspectorGUI()
|
|
||||||
{
|
|
||||||
serializedObject.Update();
|
|
||||||
OnStartInspectorGUI();
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void OnStartInspectorGUI()
|
|
||||||
{
|
|
||||||
EditorGUILayout.PropertyField(m_Script);
|
|
||||||
EditorGUILayout.PropertyField(m_BackgroundColor);
|
|
||||||
EditorGUILayout.PropertyField(m_StartColor);
|
|
||||||
EditorGUILayout.PropertyField(m_EndColor);
|
|
||||||
EditorGUILayout.PropertyField(m_Value);
|
|
||||||
EditorGUILayout.PropertyField(m_CornerRadius);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
using ADB = UnityEditor.AssetDatabase;
|
||||||
|
|
||||||
|
|
||||||
namespace XCharts.Editor
|
namespace XCharts.Editor
|
||||||
{
|
{
|
||||||
@@ -22,7 +28,7 @@ namespace XCharts.Editor
|
|||||||
canvas = canvasObject.AddComponent<Canvas>();
|
canvas = canvasObject.AddComponent<Canvas>();
|
||||||
canvas.renderMode = RenderMode.ScreenSpaceCamera;
|
canvas.renderMode = RenderMode.ScreenSpaceCamera;
|
||||||
var mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
|
var mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
|
||||||
canvas.worldCamera = mainCamera == null? null : mainCamera.GetComponent<Camera>();
|
canvas.worldCamera = mainCamera == null ? null : mainCamera.GetComponent<Camera>();
|
||||||
canvasObject.AddComponent<CanvasScaler>();
|
canvasObject.AddComponent<CanvasScaler>();
|
||||||
canvasObject.AddComponent<GraphicRaycaster>();
|
canvasObject.AddComponent<GraphicRaycaster>();
|
||||||
if (GameObject.Find("EventSystem") == null)
|
if (GameObject.Find("EventSystem") == null)
|
||||||
@@ -56,24 +62,30 @@ namespace XCharts.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static T AddChart<T>(string chartName) where T : BaseChart
|
public static T AddChart<T>(string chartName) where T : BaseChart
|
||||||
|
{
|
||||||
|
XCThemeMgr.CheckReloadTheme();
|
||||||
|
return AddGraph<T>(chartName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T AddGraph<T>(string graphName) where T : BaseGraph
|
||||||
{
|
{
|
||||||
var parent = GetParent();
|
var parent = GetParent();
|
||||||
if (parent == null) return null;
|
if (parent == null) return null;
|
||||||
XCThemeMgr.CheckReloadTheme();
|
XCThemeMgr.CheckReloadTheme();
|
||||||
var chart = new GameObject();
|
var obj = new GameObject();
|
||||||
chart.name = GetName(parent, chartName);
|
obj.name = GetName(parent, graphName);
|
||||||
chart.layer = LayerMask.NameToLayer("UI");
|
obj.layer = LayerMask.NameToLayer("UI");
|
||||||
var t = chart.AddComponent<T>();
|
var t = obj.AddComponent<T>();
|
||||||
chart.transform.SetParent(parent);
|
obj.transform.SetParent(parent);
|
||||||
chart.transform.localScale = Vector3.one;
|
obj.transform.localScale = Vector3.one;
|
||||||
chart.transform.localPosition = Vector3.zero;
|
obj.transform.localPosition = Vector3.zero;
|
||||||
chart.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
obj.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
||||||
var rect = chart.GetComponent<RectTransform>();
|
var rect = obj.GetComponent<RectTransform>();
|
||||||
rect.anchorMin = new Vector2(0.5f, 0.5f);
|
rect.anchorMin = new Vector2(0.5f, 0.5f);
|
||||||
rect.anchorMax = new Vector2(0.5f, 0.5f);
|
rect.anchorMax = new Vector2(0.5f, 0.5f);
|
||||||
rect.pivot = new Vector2(0.5f, 0.5f);
|
rect.pivot = new Vector2(0.5f, 0.5f);
|
||||||
Selection.activeGameObject = chart;
|
Selection.activeGameObject = obj;
|
||||||
EditorUtility.SetDirty(chart);
|
EditorUtility.SetDirty(obj);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,23 +194,155 @@ namespace XCharts.Editor
|
|||||||
XCThemeMgr.ReloadThemeList();
|
XCThemeMgr.ReloadThemeList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Text mesh pro support
|
||||||
|
#if UNITY_2017_1_OR_NEWER
|
||||||
|
const string SYMBOL_TMP = "dUI_TextMeshPro";
|
||||||
|
const string ASMDEF_TMP = "Unity.TextMeshPro";
|
||||||
|
|
||||||
[MenuItem("XCharts/TextMeshPro Enable")]
|
[MenuItem("XCharts/TextMeshPro Enable")]
|
||||||
public static void EnableTextMeshPro()
|
public static void EnableTextMeshPro()
|
||||||
{
|
{
|
||||||
if (!XChartsMgr.IsExistTMPAssembly())
|
if (!IsSpecifyAssemblyExist(ASMDEF_TMP))
|
||||||
{
|
{
|
||||||
Debug.LogError("TextMeshPro is not in the project, please import TextMeshPro package first.");
|
Debug.LogError("TextMeshPro is not in the project, please import TextMeshPro package first.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
XChartsMgr.EnableTextMeshPro();
|
DefineSymbolsUtil.AddGlobalDefine(SYMBOL_TMP);
|
||||||
XChartsMgr.ModifyTMPRefence();
|
XChartsMgr.RemoveAllChartObject();
|
||||||
|
InsertSpecifyReferenceIntoAssembly(Platform.Editor, ASMDEF_TMP);
|
||||||
|
InsertSpecifyReferenceIntoAssembly(Platform.Runtime, ASMDEF_TMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MenuItem("XCharts/TextMeshPro Disable")]
|
[MenuItem("XCharts/TextMeshPro Disable")]
|
||||||
public static void DisableTextMeshPro()
|
public static void DisableTextMeshPro()
|
||||||
{
|
{
|
||||||
XChartsMgr.ModifyTMPRefence(true);
|
RemoveSpecifyReferenceFromAssembly(Platform.Editor, ASMDEF_TMP);
|
||||||
XChartsMgr.DisableTextMeshPro();
|
RemoveSpecifyReferenceFromAssembly(Platform.Runtime, ASMDEF_TMP);
|
||||||
|
DefineSymbolsUtil.RemoveGlobalDefine(SYMBOL_TMP);
|
||||||
|
XChartsMgr.RemoveAllChartObject();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region InputSystem Support
|
||||||
|
#if UNITY_2019_1_OR_NEWER
|
||||||
|
//As InputSystem is released in 2019.1+ ,when unity version is 2019.1+ , enable InputSystem Support
|
||||||
|
const string SYMBOL_I_S = "INPUT_SYSTEM_ENABLED";
|
||||||
|
const string ASMDEF_I_S = "Unity.InputSystem";
|
||||||
|
[MenuItem("XCharts/InputSystem Enable")]
|
||||||
|
public static void EnableInputSystem()
|
||||||
|
{
|
||||||
|
if (!IsSpecifyAssemblyExist(ASMDEF_I_S))
|
||||||
|
{
|
||||||
|
Debug.LogError("InputSystem is not in the project, please import InputSystem package first.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// insert input system package into editor and runtime assembly
|
||||||
|
InsertSpecifyReferenceIntoAssembly(Platform.Editor, ASMDEF_I_S);
|
||||||
|
InsertSpecifyReferenceIntoAssembly(Platform.Runtime, ASMDEF_I_S);
|
||||||
|
// add scripting define symbols
|
||||||
|
DefineSymbolsUtil.AddGlobalDefine(SYMBOL_I_S);
|
||||||
|
}
|
||||||
|
[MenuItem("XCharts/InputSystem Disable")]
|
||||||
|
public static void DisableInputSystem()
|
||||||
|
{
|
||||||
|
// remove input system package into editor and runtime assembly
|
||||||
|
RemoveSpecifyReferenceFromAssembly(Platform.Editor, ASMDEF_I_S);
|
||||||
|
RemoveSpecifyReferenceFromAssembly(Platform.Runtime, ASMDEF_I_S);
|
||||||
|
// remove scripting define symbols
|
||||||
|
DefineSymbolsUtil.RemoveGlobalDefine(SYMBOL_I_S);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Assistant members
|
||||||
|
#if UNITY_2017_1_OR_NEWER
|
||||||
|
// as text mesh pro is released in 2017.1, so we may use these function and types in 2017.1 or later
|
||||||
|
private static void InsertSpecifyReferenceIntoAssembly(Platform platform, string reference)
|
||||||
|
{
|
||||||
|
var file = GetPackageAssemblyDefinitionPath(platform);
|
||||||
|
var content = File.ReadAllText(file);
|
||||||
|
var data = new AssemblyDefinitionData();
|
||||||
|
EditorJsonUtility.FromJsonOverwrite(content, data);
|
||||||
|
if (!data.references.Contains(reference))
|
||||||
|
{
|
||||||
|
data.references.Add(reference);
|
||||||
|
var json = EditorJsonUtility.ToJson(data, true);
|
||||||
|
File.WriteAllText(file, json);
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void RemoveSpecifyReferenceFromAssembly(Platform platform, string reference)
|
||||||
|
{
|
||||||
|
var file = GetPackageAssemblyDefinitionPath(platform);
|
||||||
|
var content = File.ReadAllText(file);
|
||||||
|
var data = new AssemblyDefinitionData();
|
||||||
|
EditorJsonUtility.FromJsonOverwrite(content, data);
|
||||||
|
if (data.references.Contains(reference))
|
||||||
|
{
|
||||||
|
data.references.Remove(reference);
|
||||||
|
var json = EditorJsonUtility.ToJson(data, true);
|
||||||
|
File.WriteAllText(file, json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Platform { Editor, Runtime }
|
||||||
|
public static string GetPackageAssemblyDefinitionPath(Platform platform)
|
||||||
|
{
|
||||||
|
var p = platform == Platform.Editor ? "Editor" : "Runtime";
|
||||||
|
var f = "XCharts." + p + ".asmdef";
|
||||||
|
var sub = Path.Combine(p, f);
|
||||||
|
string packagePath = Path.GetFullPath("Packages/com.monitor1394.xcharts");
|
||||||
|
if (!Directory.Exists(packagePath))
|
||||||
|
{
|
||||||
|
packagePath = ADB.FindAssets("t:Script")
|
||||||
|
.Where(v => Path.GetFileNameWithoutExtension(ADB.GUIDToAssetPath(v)) == "XChartsMgr")
|
||||||
|
.Select(id => ADB.GUIDToAssetPath(id))
|
||||||
|
.FirstOrDefault();
|
||||||
|
packagePath = Path.GetDirectoryName(packagePath);
|
||||||
|
packagePath = packagePath.Substring(0, packagePath.LastIndexOf("Runtime"));
|
||||||
|
}
|
||||||
|
return Path.Combine(packagePath, sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsSpecifyAssemblyExist(string name)
|
||||||
|
{
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
foreach (var assembly in UnityEditor.Compilation.CompilationPipeline.GetAssemblies(UnityEditor.Compilation.AssembliesType.Player))
|
||||||
|
{
|
||||||
|
if (assembly.name.Equals(name)) return true;
|
||||||
|
}
|
||||||
|
#elif UNITY_2017_3_OR_NEWER
|
||||||
|
foreach (var assembly in UnityEditor.Compilation.CompilationPipeline.GetAssemblies())
|
||||||
|
{
|
||||||
|
if (assembly.name.Equals(name)) return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
class AssemblyDefinitionData
|
||||||
|
{
|
||||||
|
#pragma warning disable 649
|
||||||
|
public string name;
|
||||||
|
public List<string> references;
|
||||||
|
public List<string> includePlatforms;
|
||||||
|
public List<string> excludePlatforms;
|
||||||
|
public bool allowUnsafeCode;
|
||||||
|
public bool overrideReferences;
|
||||||
|
public List<string> precompiledReferences;
|
||||||
|
public bool autoReferenced;
|
||||||
|
public List<string> defineConstraints;
|
||||||
|
public List<string> versionDefines;
|
||||||
|
public bool noEngineReferences;
|
||||||
|
#pragma warning restore 649
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,42 +11,33 @@ namespace XCharts.Example
|
|||||||
private LineChart chart;
|
private LineChart chart;
|
||||||
private float speed = 100f;
|
private float speed = 100f;
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoopDemo()
|
|
||||||
{
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(CheatSheet());
|
StartCoroutine(CheatSheet());
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator CheatSheet()
|
IEnumerator CheatSheet()
|
||||||
{
|
{
|
||||||
StartCoroutine(InitChart());
|
StartCoroutine(InitChart());
|
||||||
StartCoroutine(ComponentTitle());
|
while (true)
|
||||||
yield return new WaitForSeconds(2);
|
{
|
||||||
StartCoroutine(ComponentAxis());
|
StartCoroutine(ComponentTitle());
|
||||||
yield return new WaitForSeconds(2);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(ComponentGrid());
|
StartCoroutine(ComponentAxis());
|
||||||
yield return new WaitForSeconds(2);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(ComponentSerie());
|
StartCoroutine(ComponentGrid());
|
||||||
yield return new WaitForSeconds(4);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(ComponentLegend());
|
StartCoroutine(ComponentSerie());
|
||||||
yield return new WaitForSeconds(4);
|
yield return new WaitForSeconds(4);
|
||||||
StartCoroutine(ComponentTheme());
|
StartCoroutine(ComponentLegend());
|
||||||
yield return new WaitForSeconds(4);
|
yield return new WaitForSeconds(4);
|
||||||
StartCoroutine(ComponentDataZoom());
|
StartCoroutine(ComponentTheme());
|
||||||
yield return new WaitForSeconds(5);
|
yield return new WaitForSeconds(4);
|
||||||
StartCoroutine(ComponentVisualMap());
|
StartCoroutine(ComponentDataZoom());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(5);
|
||||||
LoopDemo();
|
StartCoroutine(ComponentVisualMap());
|
||||||
|
yield return new WaitForSeconds(3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator InitChart()
|
IEnumerator InitChart()
|
||||||
@@ -54,10 +45,10 @@ namespace XCharts.Example
|
|||||||
chart = gameObject.GetComponent<LineChart>();
|
chart = gameObject.GetComponent<LineChart>();
|
||||||
if (chart == null) gameObject.AddComponent<LineChart>();
|
if (chart == null) gameObject.AddComponent<LineChart>();
|
||||||
|
|
||||||
chart.GetChartComponent<Title>().show = true;
|
chart.EnsureChartComponent<Title>().show = true;
|
||||||
chart.GetChartComponent<Title>().text = "术语解析-组件";
|
chart.EnsureChartComponent<Title>().text = "术语解析-组件";
|
||||||
|
|
||||||
var grid = chart.GetOrAddChartComponent<GridCoord>();
|
var grid = chart.EnsureChartComponent<GridCoord>();
|
||||||
grid.bottom = 30;
|
grid.bottom = 30;
|
||||||
grid.right = 30;
|
grid.right = 30;
|
||||||
grid.left = 50;
|
grid.left = 50;
|
||||||
@@ -81,31 +72,31 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ComponentTitle()
|
IEnumerator ComponentTitle()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().text = "术语解析 - 组件";
|
chart.EnsureChartComponent<Title>().text = "术语解析 - 组件";
|
||||||
chart.GetChartComponent<Title>().subText = "Title 标题:可指定主标题和子标题";
|
chart.EnsureChartComponent<Title>().subText = "Title 标题:可指定主标题和子标题";
|
||||||
chart.GetChartComponent<XAxis>().show = true;
|
chart.EnsureChartComponent<XAxis>().show = true;
|
||||||
chart.GetChartComponent<YAxis>().show = true;
|
chart.EnsureChartComponent<YAxis>().show = true;
|
||||||
chart.GetChartComponent<Legend>().show = false;
|
chart.EnsureChartComponent<Legend>().show = false;
|
||||||
chart.series[0].show = false;
|
chart.series[0].show = false;
|
||||||
chart.series[1].show = false;
|
chart.series[1].show = false;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().show = !chart.GetChartComponent<Title>().show;
|
chart.EnsureChartComponent<Title>().show = !chart.EnsureChartComponent<Title>().show;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
yield return new WaitForSeconds(0.2f);
|
yield return new WaitForSeconds(0.2f);
|
||||||
}
|
}
|
||||||
chart.GetChartComponent<Title>().show = true;
|
chart.EnsureChartComponent<Title>().show = true;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator ComponentAxis()
|
IEnumerator ComponentAxis()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "Axis 坐标轴:配置X和Y轴的轴线、刻度、标签等样式外观配置";
|
chart.EnsureChartComponent<Title>().subText = "Axis 坐标轴:配置X和Y轴的轴线、刻度、标签等样式外观配置";
|
||||||
chart.series[0].show = false;
|
chart.series[0].show = false;
|
||||||
chart.series[1].show = false;
|
chart.series[1].show = false;
|
||||||
var xAxis = chart.GetChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
var yAxis = chart.GetChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
xAxis.show = !xAxis.show;
|
xAxis.show = !xAxis.show;
|
||||||
@@ -121,8 +112,8 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ComponentGrid()
|
IEnumerator ComponentGrid()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "Grid 网格:调整坐标系边距和颜色等";
|
chart.EnsureChartComponent<Title>().subText = "Grid 网格:调整坐标系边距和颜色等";
|
||||||
var grid = chart.GetChartComponent<GridCoord>();
|
var grid = chart.EnsureChartComponent<GridCoord>();
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
grid.backgroundColor = i % 2 == 0 ? Color.clear : Color.grey;
|
grid.backgroundColor = i % 2 == 0 ? Color.clear : Color.grey;
|
||||||
@@ -136,7 +127,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ComponentSerie()
|
IEnumerator ComponentSerie()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "Serie 系列:调整坐标系边距和颜色等";
|
chart.EnsureChartComponent<Title>().subText = "Serie 系列:调整坐标系边距和颜色等";
|
||||||
chart.series[0].show = true;
|
chart.series[0].show = true;
|
||||||
chart.series[1].show = true;
|
chart.series[1].show = true;
|
||||||
chart.AnimationReset();
|
chart.AnimationReset();
|
||||||
@@ -157,10 +148,10 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ComponentLegend()
|
IEnumerator ComponentLegend()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "Legend 图例:展示不同系列的名字和颜色,可控制系列显示等";
|
chart.EnsureChartComponent<Title>().subText = "Legend 图例:展示不同系列的名字和颜色,可控制系列显示等";
|
||||||
var legend = chart.GetChartComponent<Legend>();
|
var legend = chart.EnsureChartComponent<Legend>();
|
||||||
legend.show = true;
|
legend.show = true;
|
||||||
var grid = chart.GetChartComponent<GridCoord>();
|
var grid = chart.EnsureChartComponent<GridCoord>();
|
||||||
grid.top = 80;
|
grid.top = 80;
|
||||||
legend.location.top = 50;
|
legend.location.top = 50;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
@@ -187,26 +178,26 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ComponentTheme()
|
IEnumerator ComponentTheme()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "Theme 主题:可从全局上配置图表的颜色、字体等效果,支持默认主题切换";
|
chart.EnsureChartComponent<Title>().subText = "Theme 主题:可从全局上配置图表的颜色、字体等效果,支持默认主题切换";
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
chart.GetChartComponent<Title>().subText = "Theme 主题:Light主题";
|
chart.EnsureChartComponent<Title>().subText = "Theme 主题:Light主题";
|
||||||
chart.UpdateTheme(ThemeType.Light);
|
chart.UpdateTheme(ThemeType.Light);
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
chart.GetChartComponent<Title>().subText = "Theme 主题:Dark主题";
|
chart.EnsureChartComponent<Title>().subText = "Theme 主题:Dark主题";
|
||||||
chart.UpdateTheme(ThemeType.Dark);
|
chart.UpdateTheme(ThemeType.Dark);
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
chart.GetChartComponent<Title>().subText = "Theme 主题:Default主题";
|
chart.EnsureChartComponent<Title>().subText = "Theme 主题:Default主题";
|
||||||
chart.UpdateTheme(ThemeType.Default);
|
chart.UpdateTheme(ThemeType.Default);
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator ComponentDataZoom()
|
IEnumerator ComponentDataZoom()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "DataZoom 区域缩放:可通过拖、拽、缩小、放大来观察细节数据";
|
chart.EnsureChartComponent<Title>().subText = "DataZoom 区域缩放:可通过拖、拽、缩小、放大来观察细节数据";
|
||||||
var grid = chart.GetChartComponent<GridCoord>();
|
var grid = chart.EnsureChartComponent<GridCoord>();
|
||||||
grid.bottom = 70;
|
grid.bottom = 70;
|
||||||
|
|
||||||
var dataZoom = chart.GetOrAddChartComponent<DataZoom>();
|
var dataZoom = chart.EnsureChartComponent<DataZoom>();
|
||||||
dataZoom.enable = true;
|
dataZoom.enable = true;
|
||||||
dataZoom.supportInside = true;
|
dataZoom.supportInside = true;
|
||||||
dataZoom.supportSlider = true;
|
dataZoom.supportSlider = true;
|
||||||
@@ -265,9 +256,9 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ComponentVisualMap()
|
IEnumerator ComponentVisualMap()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "VisualMap 视觉映射:可从全局上配置图表的颜色、字体等效果,支持默认主题切换";
|
chart.EnsureChartComponent<Title>().subText = "VisualMap 视觉映射:可从全局上配置图表的颜色、字体等效果,支持默认主题切换";
|
||||||
|
|
||||||
var visualMap = chart.GetOrAddChartComponent<VisualMap>();
|
var visualMap = chart.EnsureChartComponent<VisualMap>();
|
||||||
visualMap.show = true;
|
visualMap.show = true;
|
||||||
visualMap.showUI = true;
|
visualMap.showUI = true;
|
||||||
visualMap.orient = Orient.Vertical;
|
visualMap.orient = Orient.Vertical;
|
||||||
@@ -292,7 +283,7 @@ namespace XCharts.Example
|
|||||||
"#a50026"
|
"#a50026"
|
||||||
};
|
};
|
||||||
visualMap.AddColors(colors);
|
visualMap.AddColors(colors);
|
||||||
var grid = chart.GetChartComponent<GridCoord>();
|
var grid = chart.EnsureChartComponent<GridCoord>();
|
||||||
grid.left = 80;
|
grid.left = 80;
|
||||||
grid.bottom = 100;
|
grid.bottom = 100;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ namespace XCharts.Example
|
|||||||
{
|
{
|
||||||
if (dataZoom.IsInMarqueeArea(serieData))
|
if (dataZoom.IsInMarqueeArea(serieData))
|
||||||
{
|
{
|
||||||
serieData.GetOrAddComponent<ItemStyle>().color = Color.red;
|
serieData.EnsureComponent<ItemStyle>().color = Color.red;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
serieData.GetOrAddComponent<ItemStyle>().color = Color.clear;
|
serieData.EnsureComponent<ItemStyle>().color = Color.clear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,39 +11,30 @@ namespace XCharts.Example
|
|||||||
private Serie serie;
|
private Serie serie;
|
||||||
private int m_DataNum = 8;
|
private int m_DataNum = 8;
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoopDemo()
|
|
||||||
{
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(PieDemo());
|
StartCoroutine(PieDemo());
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator PieDemo()
|
IEnumerator PieDemo()
|
||||||
{
|
{
|
||||||
StartCoroutine(AddSimpleLine());
|
while (true)
|
||||||
yield return new WaitForSeconds(2);
|
{
|
||||||
StartCoroutine(ChangeLineType());
|
StartCoroutine(AddSimpleLine());
|
||||||
yield return new WaitForSeconds(8);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(LineAreaStyleSettings());
|
StartCoroutine(ChangeLineType());
|
||||||
yield return new WaitForSeconds(5);
|
yield return new WaitForSeconds(8);
|
||||||
StartCoroutine(LineArrowSettings());
|
StartCoroutine(LineAreaStyleSettings());
|
||||||
yield return new WaitForSeconds(2);
|
yield return new WaitForSeconds(5);
|
||||||
StartCoroutine(LineSymbolSettings());
|
StartCoroutine(LineArrowSettings());
|
||||||
yield return new WaitForSeconds(7);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(LineLabelSettings());
|
StartCoroutine(LineSymbolSettings());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(7);
|
||||||
StartCoroutine(LineMutilSerie());
|
StartCoroutine(LineLabelSettings());
|
||||||
yield return new WaitForSeconds(5);
|
yield return new WaitForSeconds(3);
|
||||||
LoopDemo();
|
StartCoroutine(LineMutilSerie());
|
||||||
|
yield return new WaitForSeconds(5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator AddSimpleLine()
|
IEnumerator AddSimpleLine()
|
||||||
@@ -116,7 +107,7 @@ namespace XCharts.Example
|
|||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "AreaStyle 面积图";
|
chart.GetChartComponent<Title>().subText = "AreaStyle 面积图";
|
||||||
|
|
||||||
serie.AddExtraComponent<AreaStyle>();
|
serie.EnsureComponent<AreaStyle>();
|
||||||
serie.areaStyle.show = true;
|
serie.areaStyle.show = true;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
@@ -145,7 +136,7 @@ namespace XCharts.Example
|
|||||||
IEnumerator LineArrowSettings()
|
IEnumerator LineArrowSettings()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "LineArrow 头部箭头";
|
chart.GetChartComponent<Title>().subText = "LineArrow 头部箭头";
|
||||||
chart.GetSerie(0).AddExtraComponent<LineArrow>();
|
chart.GetSerie(0).EnsureComponent<LineArrow>();
|
||||||
serie.lineArrow.show = true;
|
serie.lineArrow.show = true;
|
||||||
serie.lineArrow.position = LineArrow.Position.Start;
|
serie.lineArrow.position = LineArrow.Position.Start;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
@@ -207,7 +198,7 @@ namespace XCharts.Example
|
|||||||
IEnumerator LineLabelSettings()
|
IEnumerator LineLabelSettings()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "SerieLabel 文本标签";
|
chart.GetChartComponent<Title>().subText = "SerieLabel 文本标签";
|
||||||
serie.AddExtraComponent<LabelStyle>();
|
serie.EnsureComponent<LabelStyle>();
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
while (serie.label.offset[1] < 20)
|
while (serie.label.offset[1] < 20)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using XCharts.Runtime;
|
|||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
[ExecuteInEditMode]
|
|
||||||
public class Example11_AddSinCurve : MonoBehaviour
|
public class Example11_AddSinCurve : MonoBehaviour
|
||||||
{
|
{
|
||||||
private float time;
|
private float time;
|
||||||
@@ -18,14 +17,14 @@ namespace XCharts.Example
|
|||||||
{
|
{
|
||||||
chart = gameObject.AddComponent<LineChart>();
|
chart = gameObject.AddComponent<LineChart>();
|
||||||
}
|
}
|
||||||
chart.GetChartComponent<Title>().show = true;
|
chart.EnsureChartComponent<Title>().show = true;
|
||||||
chart.GetChartComponent<Title>().text = "Sin Curve";
|
chart.EnsureChartComponent<Title>().text = "Sin Curve";
|
||||||
|
|
||||||
chart.GetChartComponent<Tooltip>().show = true;
|
chart.EnsureChartComponent<Tooltip>().show = true;
|
||||||
chart.GetChartComponent<Legend>().show = false;
|
chart.EnsureChartComponent<Legend>().show = false;
|
||||||
|
|
||||||
var xAxis = chart.GetChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
var yAxis = chart.GetChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
|
|
||||||
xAxis.show = true;
|
xAxis.show = true;
|
||||||
yAxis.show = true;
|
yAxis.show = true;
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
@@ -29,14 +32,14 @@ namespace XCharts.Example
|
|||||||
chart.Init();
|
chart.Init();
|
||||||
chart.SetSize(580, 300);
|
chart.SetSize(580, 300);
|
||||||
}
|
}
|
||||||
chart.GetOrAddChartComponent<Title>().show = true;
|
chart.EnsureChartComponent<Title>().show = true;
|
||||||
chart.GetOrAddChartComponent<Title>().text = "Line Simple";
|
chart.EnsureChartComponent<Title>().text = "Line Simple";
|
||||||
|
|
||||||
chart.GetOrAddChartComponent<Tooltip>().show = true;
|
chart.EnsureChartComponent<Tooltip>().show = true;
|
||||||
chart.GetOrAddChartComponent<Legend>().show = false;
|
chart.EnsureChartComponent<Legend>().show = false;
|
||||||
|
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
var yAxis = chart.GetOrAddChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
xAxis.show = true;
|
xAxis.show = true;
|
||||||
yAxis.show = true;
|
yAxis.show = true;
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
|
|||||||
@@ -11,48 +11,38 @@ namespace XCharts.Example
|
|||||||
private Serie serie, serie2;
|
private Serie serie, serie2;
|
||||||
private int m_DataNum = 5;
|
private int m_DataNum = 5;
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoopDemo()
|
|
||||||
{
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(PieDemo());
|
StartCoroutine(PieDemo());
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator PieDemo()
|
IEnumerator PieDemo()
|
||||||
{
|
{
|
||||||
StartCoroutine(AddSimpleBar());
|
while (true)
|
||||||
yield return new WaitForSeconds(2);
|
{
|
||||||
StartCoroutine(BarMutilSerie());
|
StartCoroutine(AddSimpleBar());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(ZebraBar());
|
StartCoroutine(BarMutilSerie());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(3);
|
||||||
StartCoroutine(SameBarAndNotStack());
|
StartCoroutine(ZebraBar());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(3);
|
||||||
StartCoroutine(SameBarAndStack());
|
StartCoroutine(SameBarAndNotStack());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(3);
|
||||||
StartCoroutine(SameBarAndPercentStack());
|
StartCoroutine(SameBarAndStack());
|
||||||
yield return new WaitForSeconds(10);
|
yield return new WaitForSeconds(3);
|
||||||
|
StartCoroutine(SameBarAndPercentStack());
|
||||||
LoopDemo();
|
yield return new WaitForSeconds(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator AddSimpleBar()
|
IEnumerator AddSimpleBar()
|
||||||
{
|
{
|
||||||
chart = gameObject.GetComponent<BarChart>();
|
chart = gameObject.GetComponent<BarChart>();
|
||||||
if (chart == null) chart = gameObject.AddComponent<BarChart>();
|
if (chart == null) chart = gameObject.AddComponent<BarChart>();
|
||||||
chart.GetChartComponent<Title>().text = "BarChart - 柱状图";
|
chart.EnsureChartComponent<Title>().text = "BarChart - 柱状图";
|
||||||
chart.GetChartComponent<Title>().subText = "普通柱状图";
|
chart.EnsureChartComponent<Title>().subText = "普通柱状图";
|
||||||
|
|
||||||
var yAxis = chart.GetChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
yAxis.minMaxType = Axis.AxisMinMaxType.Default;
|
yAxis.minMaxType = Axis.AxisMinMaxType.Default;
|
||||||
|
|
||||||
chart.RemoveData();
|
chart.RemoveData();
|
||||||
@@ -68,7 +58,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator BarMutilSerie()
|
IEnumerator BarMutilSerie()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "多条柱状图";
|
chart.EnsureChartComponent<Title>().subText = "多条柱状图";
|
||||||
|
|
||||||
float now = serie.barWidth - 0.35f;
|
float now = serie.barWidth - 0.35f;
|
||||||
while (serie.barWidth > 0.35f)
|
while (serie.barWidth > 0.35f)
|
||||||
@@ -90,7 +80,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator ZebraBar()
|
IEnumerator ZebraBar()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "斑马柱状图";
|
chart.EnsureChartComponent<Title>().subText = "斑马柱状图";
|
||||||
serie.barType = BarType.Zebra;
|
serie.barType = BarType.Zebra;
|
||||||
serie2.barType = BarType.Zebra;
|
serie2.barType = BarType.Zebra;
|
||||||
serie.barZebraWidth = serie.barZebraGap = 4;
|
serie.barZebraWidth = serie.barZebraGap = 4;
|
||||||
@@ -101,7 +91,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator SameBarAndNotStack()
|
IEnumerator SameBarAndNotStack()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "非堆叠同柱";
|
chart.EnsureChartComponent<Title>().subText = "非堆叠同柱";
|
||||||
serie.barType = serie2.barType = BarType.Normal;
|
serie.barType = serie2.barType = BarType.Normal;
|
||||||
serie.stack = "";
|
serie.stack = "";
|
||||||
serie2.stack = "";
|
serie2.stack = "";
|
||||||
@@ -112,7 +102,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator SameBarAndStack()
|
IEnumerator SameBarAndStack()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "堆叠同柱";
|
chart.EnsureChartComponent<Title>().subText = "堆叠同柱";
|
||||||
serie.barType = serie2.barType = BarType.Normal;
|
serie.barType = serie2.barType = BarType.Normal;
|
||||||
serie.stack = "samename";
|
serie.stack = "samename";
|
||||||
serie2.stack = "samename";
|
serie2.stack = "samename";
|
||||||
@@ -132,19 +122,25 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator SameBarAndPercentStack()
|
IEnumerator SameBarAndPercentStack()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "百分比堆叠同柱";
|
chart.EnsureChartComponent<Title>().subText = "百分比堆叠同柱";
|
||||||
serie.barType = serie2.barType = BarType.Normal;
|
serie.barType = serie2.barType = BarType.Normal;
|
||||||
serie.stack = "samename";
|
serie.stack = "samename";
|
||||||
serie2.stack = "samename";
|
serie2.stack = "samename";
|
||||||
|
|
||||||
serie.barPercentStack = true;
|
serie.barPercentStack = true;
|
||||||
|
if (null == serie.label)
|
||||||
serie.AddExtraComponent<LabelStyle>();
|
{
|
||||||
|
serie.EnsureComponent<LabelStyle>();
|
||||||
|
}
|
||||||
serie.label.show = true;
|
serie.label.show = true;
|
||||||
serie.label.position = LabelStyle.Position.Center;
|
serie.label.position = LabelStyle.Position.Center;
|
||||||
serie.label.textStyle.color = Color.white;
|
serie.label.textStyle.color = Color.white;
|
||||||
serie.label.formatter = "{d:f0}%";
|
serie.label.formatter = "{d:f0}%";
|
||||||
|
|
||||||
|
if (null == serie2.label)
|
||||||
|
{
|
||||||
|
serie2.EnsureComponent<LabelStyle>();
|
||||||
|
}
|
||||||
serie2.label.show = true;
|
serie2.label.show = true;
|
||||||
serie2.label.position = LabelStyle.Position.Center;
|
serie2.label.position = LabelStyle.Position.Center;
|
||||||
serie2.label.textStyle.color = Color.white;
|
serie2.label.textStyle.color = Color.white;
|
||||||
|
|||||||
@@ -13,45 +13,37 @@ namespace XCharts.Example
|
|||||||
private float m_RadiusSpeed = 100f;
|
private float m_RadiusSpeed = 100f;
|
||||||
private float m_CenterSpeed = 1f;
|
private float m_CenterSpeed = 1f;
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
LoopDemo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoopDemo()
|
|
||||||
{
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(PieDemo());
|
StartCoroutine(PieDemo());
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator PieDemo()
|
IEnumerator PieDemo()
|
||||||
{
|
{
|
||||||
StartCoroutine(PieAdd());
|
while (true)
|
||||||
yield return new WaitForSeconds(2);
|
{
|
||||||
StartCoroutine(PieShowLabel());
|
StartCoroutine(PieAdd());
|
||||||
yield return new WaitForSeconds(4);
|
yield return new WaitForSeconds(2);
|
||||||
StartCoroutine(Doughnut());
|
StartCoroutine(PieShowLabel());
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(4);
|
||||||
StartCoroutine(DoublePie());
|
StartCoroutine(Doughnut());
|
||||||
yield return new WaitForSeconds(2);
|
yield return new WaitForSeconds(3);
|
||||||
StartCoroutine(RosePie());
|
StartCoroutine(DoublePie());
|
||||||
yield return new WaitForSeconds(5);
|
yield return new WaitForSeconds(2);
|
||||||
LoopDemo();
|
StartCoroutine(RosePie());
|
||||||
|
yield return new WaitForSeconds(5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator PieAdd()
|
IEnumerator PieAdd()
|
||||||
{
|
{
|
||||||
chart = gameObject.GetComponent<PieChart>();
|
chart = gameObject.GetComponent<PieChart>();
|
||||||
if (chart == null) chart = gameObject.AddComponent<PieChart>();
|
if (chart == null) chart = gameObject.AddComponent<PieChart>();
|
||||||
|
yield return null;
|
||||||
chart.GetChartComponent<Title>().text = "PieChart - 饼图";
|
chart.GetChartComponent<Title>().text = "PieChart - 饼图";
|
||||||
chart.GetChartComponent<Title>().subText = "基础饼图";
|
chart.GetChartComponent<Title>().subText = "基础饼图";
|
||||||
|
|
||||||
var legend = chart.GetChartComponent<Legend>();
|
var legend = chart.EnsureChartComponent<Legend>();
|
||||||
legend.show = true;
|
legend.show = true;
|
||||||
legend.location.align = Location.Align.TopLeft;
|
legend.location.align = Location.Align.TopLeft;
|
||||||
legend.location.top = 60;
|
legend.location.top = 60;
|
||||||
@@ -72,7 +64,7 @@ namespace XCharts.Example
|
|||||||
chart.AddData(0, 135, "视频广告");
|
chart.AddData(0, 135, "视频广告");
|
||||||
chart.AddData(0, 1548, "搜索引擎");
|
chart.AddData(0, 1548, "搜索引擎");
|
||||||
|
|
||||||
chart.onPointerClickPie = delegate(PointerEventData e, int serieIndex, int dataIndex)
|
chart.onSerieClick = delegate (SerieEventData data)
|
||||||
{
|
{
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -81,9 +73,9 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator PieShowLabel()
|
IEnumerator PieShowLabel()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "显示文本标签";
|
chart.EnsureChartComponent<Title>().subText = "显示文本标签";
|
||||||
|
|
||||||
serie.AddExtraComponent<LabelStyle>();
|
serie.EnsureComponent<LabelStyle>();
|
||||||
serie.label.show = true;
|
serie.label.show = true;
|
||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
yield return new WaitForSeconds(1);
|
yield return new WaitForSeconds(1);
|
||||||
@@ -105,7 +97,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator Doughnut()
|
IEnumerator Doughnut()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "圆环图";
|
chart.EnsureChartComponent<Title>().subText = "圆环图";
|
||||||
serie.radius[0] = 2f;
|
serie.radius[0] = 2f;
|
||||||
while (serie.radius[0] < serie.radius[1] * 0.7f)
|
while (serie.radius[0] < serie.radius[1] * 0.7f)
|
||||||
{
|
{
|
||||||
@@ -129,8 +121,7 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator DoublePie()
|
IEnumerator DoublePie()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "多图组合";
|
chart.EnsureChartComponent<Title>().subText = "多图组合";
|
||||||
|
|
||||||
serie1 = chart.AddSerie<Pie>("访问来源2");
|
serie1 = chart.AddSerie<Pie>("访问来源2");
|
||||||
chart.AddData(1, 335, "直达");
|
chart.AddData(1, 335, "直达");
|
||||||
chart.AddData(1, 679, "营销广告");
|
chart.AddData(1, 679, "营销广告");
|
||||||
@@ -146,7 +137,14 @@ namespace XCharts.Example
|
|||||||
chart.RefreshChart();
|
chart.RefreshChart();
|
||||||
yield return null;
|
yield return null;
|
||||||
}
|
}
|
||||||
|
if (null == serie.label)
|
||||||
|
{
|
||||||
|
serie.EnsureComponent<LabelStyle>();
|
||||||
|
}
|
||||||
|
if (null == serie1.label)
|
||||||
|
{
|
||||||
|
serie1.EnsureComponent<LabelStyle>();
|
||||||
|
}
|
||||||
serie1.label.show = true;
|
serie1.label.show = true;
|
||||||
serie1.label.position = LabelStyle.Position.Inside;
|
serie1.label.position = LabelStyle.Position.Inside;
|
||||||
serie1.label.textStyle.color = Color.white;
|
serie1.label.textStyle.color = Color.white;
|
||||||
@@ -158,8 +156,8 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
IEnumerator RosePie()
|
IEnumerator RosePie()
|
||||||
{
|
{
|
||||||
chart.GetChartComponent<Title>().subText = "玫瑰图";
|
chart.EnsureChartComponent<Title>().subText = "玫瑰图";
|
||||||
chart.GetChartComponent<Legend>().show = false;
|
chart.EnsureChartComponent<Legend>().show = false;
|
||||||
serie1.ClearData();
|
serie1.ClearData();
|
||||||
serie.ClearData();
|
serie.ClearData();
|
||||||
serie1.radius = serie.radius = new float[2] { 0, 80 };
|
serie1.radius = serie.radius = new float[2] { 0, 80 };
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@@ -19,7 +21,7 @@ namespace XCharts.Example
|
|||||||
var serieIndex = 0;
|
var serieIndex = 0;
|
||||||
var serie = chart.GetSerie(serieIndex);
|
var serie = chart.GetSerie(serieIndex);
|
||||||
if (serie == null) return;
|
if (serie == null) return;
|
||||||
serie.AddExtraComponent<LabelStyle>();
|
serie.EnsureComponent<LabelStyle>();
|
||||||
serie.label.show = true;
|
serie.label.show = true;
|
||||||
serie.label.position = LabelStyle.Position.Outside;
|
serie.label.position = LabelStyle.Position.Outside;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace XCharts.Example
|
|||||||
serie.itemStyle.borderColor = Color.clear;
|
serie.itemStyle.borderColor = Color.clear;
|
||||||
|
|
||||||
//设置高亮样式
|
//设置高亮样式
|
||||||
var emphasisStyle = serie.AddExtraComponent<EmphasisStyle>();
|
var emphasisStyle = serie.EnsureComponent<EmphasisStyle>();
|
||||||
emphasisStyle.itemStyle.show = true;
|
emphasisStyle.itemStyle.show = true;
|
||||||
emphasisStyle.itemStyle.borderWidth = 1;
|
emphasisStyle.itemStyle.borderWidth = 1;
|
||||||
emphasisStyle.itemStyle.borderColor = Color.black;
|
emphasisStyle.itemStyle.borderColor = Color.black;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@@ -17,7 +19,7 @@ namespace XCharts.Example
|
|||||||
{
|
{
|
||||||
chart = gameObject.AddComponent<BaseChart>();
|
chart = gameObject.AddComponent<BaseChart>();
|
||||||
}
|
}
|
||||||
chart.GetOrAddChartComponent<PolarCoord>();
|
chart.EnsureChartComponent<PolarCoord>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@@ -18,7 +20,7 @@ namespace XCharts.Example
|
|||||||
{
|
{
|
||||||
chart = gameObject.AddComponent<CandlestickChart>();
|
chart = gameObject.AddComponent<CandlestickChart>();
|
||||||
}
|
}
|
||||||
GenerateOHLC(dataCount);
|
AddData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
@@ -29,9 +31,7 @@ namespace XCharts.Example
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddData() { }
|
void AddData()
|
||||||
|
|
||||||
void GenerateOHLC(int count)
|
|
||||||
{
|
{
|
||||||
chart.ClearData();
|
chart.ClearData();
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ namespace XCharts.Example
|
|||||||
var boxVals = new float[4];
|
var boxVals = new float[4];
|
||||||
var dayRange = 12;
|
var dayRange = 12;
|
||||||
|
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < dataCount; i++)
|
||||||
{
|
{
|
||||||
baseValue = baseValue + Random.Range(0f, 1f) * 30 - 10;
|
baseValue = baseValue + Random.Range(0f, 1f) * 30 - 10;
|
||||||
for (int j = 0; j < 4; j++)
|
for (int j = 0; j < 4; j++)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
@@ -30,22 +33,22 @@ namespace XCharts.Example
|
|||||||
chart.Init();
|
chart.Init();
|
||||||
chart.SetSize(1200, 600);
|
chart.SetSize(1200, 600);
|
||||||
}
|
}
|
||||||
var title = chart.GetOrAddChartComponent<Title>();
|
var title = chart.EnsureChartComponent<Title>();
|
||||||
title.text = "Simple LineChart";
|
title.text = "Simple LineChart";
|
||||||
title.subText = "normal line";
|
title.subText = "normal line";
|
||||||
|
|
||||||
var tooltip = chart.GetOrAddChartComponent<Tooltip>();
|
var tooltip = chart.EnsureChartComponent<Tooltip>();
|
||||||
tooltip.show = true;
|
tooltip.show = true;
|
||||||
|
|
||||||
var legend = chart.GetOrAddChartComponent<Legend>();
|
var legend = chart.EnsureChartComponent<Legend>();
|
||||||
legend.show = false;
|
legend.show = false;
|
||||||
|
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
|
|
||||||
var yAxis = chart.GetOrAddChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
yAxis.type = Axis.AxisType.Value;
|
yAxis.type = Axis.AxisType.Value;
|
||||||
|
|
||||||
chart.RemoveData();
|
chart.RemoveData();
|
||||||
|
|||||||
@@ -15,20 +15,20 @@ namespace XCharts.Example
|
|||||||
|
|
||||||
void ModifyComponent()
|
void ModifyComponent()
|
||||||
{
|
{
|
||||||
var title = chart.GetOrAddChartComponent<Title>();
|
var title = chart.EnsureChartComponent<Title>();
|
||||||
title.text = "Simple LineChart";
|
title.text = "Simple LineChart";
|
||||||
title.subText = "normal line";
|
title.subText = "normal line";
|
||||||
|
|
||||||
var serie1 = chart.AddSerie<Line>();
|
var serie1 = chart.AddSerie<Line>();
|
||||||
//var serie2 = chart.GetSerie<Line>();
|
//var serie2 = chart.GetSerie<Line>();
|
||||||
|
|
||||||
serie1.AddExtraComponent<AreaStyle>();
|
serie1.EnsureComponent<AreaStyle>();
|
||||||
var label = serie1.AddExtraComponent<LabelStyle>();
|
var label = serie1.EnsureComponent<LabelStyle>();
|
||||||
label.offset = new Vector3(0, 20, 0);
|
label.offset = new Vector3(0, 20, 0);
|
||||||
|
|
||||||
var serieData = chart.AddData(0, 20);
|
var serieData = chart.AddData(0, 20);
|
||||||
serieData.radius = 10;
|
serieData.radius = 10;
|
||||||
var itemStyle = serieData.GetOrAddComponent<ItemStyle>();
|
var itemStyle = serieData.EnsureComponent<ItemStyle>();
|
||||||
itemStyle.color = Color.blue;
|
itemStyle.color = Color.blue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace XCharts.Example
|
|||||||
serie.symbol.show = false;
|
serie.symbol.show = false;
|
||||||
serie.maxCache = maxCacheDataNumber;
|
serie.maxCache = maxCacheDataNumber;
|
||||||
|
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
xAxis.maxCache = maxCacheDataNumber;
|
xAxis.maxCache = maxCacheDataNumber;
|
||||||
timeNow = DateTime.Now;
|
timeNow = DateTime.Now;
|
||||||
timeNow = timeNow.AddSeconds(-maxCacheDataNumber);
|
timeNow = timeNow.AddSeconds(-maxCacheDataNumber);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@@ -43,11 +45,11 @@ namespace XCharts.Example
|
|||||||
chart.Init();
|
chart.Init();
|
||||||
chart.SetSize(580, 300);
|
chart.SetSize(580, 300);
|
||||||
|
|
||||||
chart.GetOrAddChartComponent<Title>().show = true;
|
chart.EnsureChartComponent<Title>().show = true;
|
||||||
chart.GetOrAddChartComponent<Title>().text = chartName;
|
chart.EnsureChartComponent<Title>().text = chartName;
|
||||||
|
|
||||||
chart.GetOrAddChartComponent<Tooltip>().show = true;
|
chart.EnsureChartComponent<Tooltip>().show = true;
|
||||||
chart.GetOrAddChartComponent<Legend>().show = true;
|
chart.EnsureChartComponent<Legend>().show = true;
|
||||||
|
|
||||||
chart.RemoveData();
|
chart.RemoveData();
|
||||||
chart.AddSerie<Pie>();
|
chart.AddSerie<Pie>();
|
||||||
@@ -65,16 +67,16 @@ namespace XCharts.Example
|
|||||||
chart.Init();
|
chart.Init();
|
||||||
chart.SetSize(580, 300);
|
chart.SetSize(580, 300);
|
||||||
|
|
||||||
chart.GetOrAddChartComponent<Title>().show = true;
|
chart.EnsureChartComponent<Title>().show = true;
|
||||||
chart.GetOrAddChartComponent<Title>().text = chartName;
|
chart.EnsureChartComponent<Title>().text = chartName;
|
||||||
|
|
||||||
chart.GetOrAddChartComponent<Legend>().show = false;
|
chart.EnsureChartComponent<Legend>().show = false;
|
||||||
|
|
||||||
var tooltip = chart.GetOrAddChartComponent<Tooltip>();
|
var tooltip = chart.EnsureChartComponent<Tooltip>();
|
||||||
tooltip.trigger = Tooltip.Trigger.Axis;
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
||||||
|
|
||||||
var xAxis = chart.GetOrAddChartComponent<XAxis>();
|
var xAxis = chart.EnsureChartComponent<XAxis>();
|
||||||
var yAxis = chart.GetOrAddChartComponent<YAxis>();
|
var yAxis = chart.EnsureChartComponent<YAxis>();
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.show = true;
|
xAxis.show = true;
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@@ -12,6 +15,9 @@ namespace XCharts.Example
|
|||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
chart = gameObject.GetComponent<BaseChart>();
|
chart = gameObject.GetComponent<BaseChart>();
|
||||||
|
chart.onSerieClick = OnPointerClickLine;
|
||||||
|
chart.onSerieEnter = OnPointerEnterLine;
|
||||||
|
chart.onSerieExit = OnPointerExitLine;
|
||||||
var btnTrans = transform.parent.Find("Button");
|
var btnTrans = transform.parent.Find("Button");
|
||||||
if (btnTrans)
|
if (btnTrans)
|
||||||
{
|
{
|
||||||
@@ -19,6 +25,21 @@ namespace XCharts.Example
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnPointerClickLine(SerieEventData data)
|
||||||
|
{
|
||||||
|
Debug.Log("OnPointerClick: " + data.serieIndex+ " " + data.dataIndex +" "+ data.dimension);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPointerEnterLine(SerieEventData data)
|
||||||
|
{
|
||||||
|
Debug.Log("OnPointerEnter: " + data.serieIndex + " " + data.dataIndex + " " + data.dimension);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPointerExitLine(SerieEventData data)
|
||||||
|
{
|
||||||
|
Debug.Log("OnPointerExit: " + data.serieIndex + " " + data.dataIndex + " " + data.dimension);
|
||||||
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.Space))
|
if (Input.GetKeyDown(KeyCode.Space))
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using XCharts.Runtime;
|
using XCharts.Runtime;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Example
|
namespace XCharts.Example
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
|
|||||||
@@ -10,5 +10,6 @@
|
|||||||
"overrideReferences": false,
|
"overrideReferences": false,
|
||||||
"precompiledReferences": [],
|
"precompiledReferences": [],
|
||||||
"autoReferenced": true,
|
"autoReferenced": true,
|
||||||
"defineConstraints": []
|
"defineConstraints": [],
|
||||||
|
"versionDefines": []
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ A powerful, easy-to-use, configurable charting and data visualization library fo
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
For more examples, see [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo), You can also go to [Online Demo](https://xcharts-team.github.io/demo/) to see the running effect of `WebGL`.
|
For more examples, see [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo), You can also go to [Online Demo](https://xcharts-team.github.io/examples/) to see the running effect of `WebGL`.
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
|
|||||||
71
README.md
71
README.md
@@ -18,27 +18,27 @@
|
|||||||
<a href="https://github.com/XCharts-Team/XCharts/releases">
|
<a href="https://github.com/XCharts-Team/XCharts/releases">
|
||||||
<img src="https://img.shields.io/github/v/release/XCharts-Team/XCharts?include_prereleases"></img>
|
<img src="https://img.shields.io/github/v/release/XCharts-Team/XCharts?include_prereleases"></img>
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<a href="https://github.com/XCharts-Team/XCharts">
|
||||||
<img src="https://img.shields.io/github/repo-size/monitor1394/unity-ugui-xcharts"></img>
|
<img src="https://img.shields.io/github/repo-size/monitor1394/unity-ugui-xcharts"></img>
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<a href="https://github.com/XCharts-Team/XCharts">
|
||||||
<img src="https://img.shields.io/github/languages/code-size/monitor1394/unity-ugui-xcharts"></img>
|
<img src="https://img.shields.io/github/languages/code-size/monitor1394/unity-ugui-xcharts"></img>
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<a href="https://xcharts-team.github.io/docs/tutorial01">
|
||||||
<img src="https://img.shields.io/badge/Unity-5.6+-green"></img>
|
<img src="https://img.shields.io/badge/Unity-5.6+-green"></img>
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<a href="https://xcharts-team.github.io/docs/tutorial01">
|
||||||
<img src="https://img.shields.io/badge/TextMeshPro-YES-green"></img>
|
<img src="https://img.shields.io/badge/TextMeshPro-YES-green"></img>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="">
|
<a href="https://github.com/XCharts-Team/XCharts/stargazers">
|
||||||
<img src="https://img.shields.io/github/stars/XCharts-Team/XCharts?style=social"></img>
|
<img src="https://img.shields.io/github/stars/XCharts-Team/XCharts?style=social"></img>
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<a href="https://github.com/XCharts-Team/XCharts/forks">
|
||||||
<img src="https://img.shields.io/github/forks/XCharts-Team/XCharts?style=social"></img>
|
<img src="https://img.shields.io/github/forks/XCharts-Team/XCharts?style=social"></img>
|
||||||
</a>
|
</a>
|
||||||
<a href="">
|
<a href="https://github.com/XCharts-Team/XCharts/issues">
|
||||||
<img src="https://img.shields.io/github/issues-closed/XCharts-Team/XCharts?color=green&label=%20%20%20%20issues&logoColor=green&style=social"></img>
|
<img src="https://img.shields.io/github/issues-closed/XCharts-Team/XCharts?color=green&label=%20%20%20%20issues&logoColor=green&style=social"></img>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -46,13 +46,14 @@
|
|||||||
一款基于`UGUI`的功能强大、简单易用的数据可视化图表插件。支持`折线图`、`柱状图`、`饼图`、`雷达图`、`散点图`、`热力图`、`环形图`、`K线图`、`极坐标`、`平行坐标`等十多种内置图表,以及`3D饼图`、`3D柱图`、`3D金字塔`、`漏斗图`、`仪表盘`、`水位图`、`象形柱图`、`甘特图`、`矩形树图`等扩展图表。
|
一款基于`UGUI`的功能强大、简单易用的数据可视化图表插件。支持`折线图`、`柱状图`、`饼图`、`雷达图`、`散点图`、`热力图`、`环形图`、`K线图`、`极坐标`、`平行坐标`等十多种内置图表,以及`3D饼图`、`3D柱图`、`3D金字塔`、`漏斗图`、`仪表盘`、`水位图`、`象形柱图`、`甘特图`、`矩形树图`等扩展图表。
|
||||||
|
|
||||||
[XCharts3.0 官方主页](https://xcharts-team.github.io)
|
[XCharts3.0 官方主页](https://xcharts-team.github.io)
|
||||||
|
[XCharts3.0 在线示例](https://xcharts-team.github.io/examples)
|
||||||
|
|
||||||
[XCharts3.0 教程](Documentation~/zh/tutorial01.md)
|
[XCharts3.0 教程](Documentation~/zh/tutorial01.md)
|
||||||
[XCharts3.0 API](Documentation~/zh/api.md)
|
[XCharts3.0 API](Documentation~/zh/api.md)
|
||||||
[XCharts3.0 问答](Documentation~/zh/faq.md)
|
[XCharts3.0 问答](Documentation~/zh/faq.md)
|
||||||
[XCharts3.0 配置项手册](Documentation~/zh/configuration.md)
|
[XCharts3.0 配置项手册](Documentation~/zh/configuration.md)
|
||||||
[XCharts3.0 更新日志](Documentation~/zh/changelog.md)
|
[XCharts3.0 更新日志](Documentation~/zh/changelog.md)
|
||||||
[XCharts3.0 订阅服务](Documentation~/zh/support.md)
|
[XCharts3.0 订阅服务](Documentation~/zh/support.md)
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
- 支持万级大数据量绘制,支持采样绘制。
|
- 支持万级大数据量绘制,支持采样绘制。
|
||||||
- 支持`TexMeshPro`。
|
- 支持`TexMeshPro`。
|
||||||
- 支持所有`5.6`以上的`Unity`版本。
|
- 支持所有`5.6`以上的`Unity`版本。
|
||||||
|
- 支持 Input System ([如何从 Input Manager 转 Input System](https://xcharts-team.github.io/docs/inputsystem))。
|
||||||
|
|
||||||
## 截图
|
## 截图
|
||||||
|
|
||||||
@@ -77,40 +79,14 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
XCharts不再内置Demo,Demo已独立出单独的仓库 [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo),也可以在浏览器查看`WebGL`下的运行效果 [在线Demo](https://xcharts-team.github.io/demo/) 。
|
|
||||||
|
|
||||||
## `XCharts3.0`
|
|
||||||
|
|
||||||
- 增加`Time`时间轴。
|
|
||||||
- 增加`SingleAxis`单轴。
|
|
||||||
- 增加多种坐标系:`Grid`、`Polar`、`Radar`、`SingleAxis`。
|
|
||||||
- 增加多种动画方式。
|
|
||||||
- 增加多种图表交互。
|
|
||||||
- 增加国际化支持。
|
|
||||||
- 增加`Widgets`小组件。
|
|
||||||
- 增加多种扩展图表。
|
|
||||||
|
|
||||||
## `XCharts3.0` 相比 `XCharts2.0`
|
|
||||||
|
|
||||||
- 更健壮的底层框架。
|
|
||||||
- 更强大的性能。
|
|
||||||
- 更小的序列化文件。
|
|
||||||
- 更好的交互体验。
|
|
||||||
- 更多的组件支持。
|
|
||||||
- 更强大的文本自述能力。
|
|
||||||
- 更合理的组件调整。
|
|
||||||
- 更灵活的组件插拔。
|
|
||||||
- 更高效的二次开发。
|
|
||||||
- 更丰富的Demo示例。
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 注意
|
## 注意
|
||||||
|
|
||||||
- `XCharts3.0` 不完全兼容 `XCharts2.0` 版本,升级`3.0`可能需要调整部分代码和配置。建议旧项目可以继续使用`XCharts2.0`,新项目推荐使用`XCharts3.0`。
|
- `XCharts3.0` 不完全兼容 `XCharts2.0` 版本,升级`3.0`可能需要调整部分代码,图表部分配置需要重新调整。建议旧项目可以继续使用`XCharts2.0`,新项目推荐使用`XCharts3.0`。
|
||||||
- `XCharts2.0` 进入维护阶段,后续只修复严重`bug`,理论上不再加新功能。
|
- `XCharts2.0` 进入维护阶段,后续只修复严重`bug`,原则上不再加新功能。
|
||||||
- `XCharts` 理论上支持`Unity 5.6`及以上版本,但由于版本测试有限难免疏漏,发现版本兼容问题可提`Issue`。
|
- `XCharts` 理论上支持`Unity 5.6`及以上版本,但由于版本测试有限难免疏漏,发现版本兼容问题可提`Issue`。
|
||||||
- 本仓库只包含`XCharts`源码,不包含`Demo`示例部分。需要查看`Demo`请到[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)仓库。
|
- 本仓库只包含`XCharts`源码,不包含`Demo`示例部分。需要查看`Demo`示例源码请到[XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo)仓库。也可以在浏览器查看`WebGL`下的运行效果 [在线Demo](https://xcharts-team.github.io/examples/) 。
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
@@ -118,7 +94,7 @@ XCharts不再内置Demo,Demo已独立出单独的仓库 [XCharts-Demo](https:/
|
|||||||
2. 在`Hierarchy`视图下右键选择`XCharts->LineChart`,即可创建一个默认的折线图。
|
2. 在`Hierarchy`视图下右键选择`XCharts->LineChart`,即可创建一个默认的折线图。
|
||||||
3. 在`Inspector`视图可以调整各个组件的参数,`Game`视图可看到实时效果。
|
3. 在`Inspector`视图可以调整各个组件的参数,`Game`视图可看到实时效果。
|
||||||
|
|
||||||
- 更多使用细节,请看:[XCharts教程:5分钟上手教程](Documentation~/zh/tutorial01.md)
|
- 更多细节,请看:[XCharts教程:5分钟上手教程](Documentation~/zh/tutorial01.md)
|
||||||
- 首次使用,建议先认真看一遍教程。
|
- 首次使用,建议先认真看一遍教程。
|
||||||
|
|
||||||
## 分支
|
## 分支
|
||||||
@@ -130,13 +106,18 @@ XCharts不再内置Demo,Demo已独立出单独的仓库 [XCharts-Demo](https:/
|
|||||||
- `1.0`:XCharts 1.0的稳定分支。带Demo,不再维护。
|
- `1.0`:XCharts 1.0的稳定分支。带Demo,不再维护。
|
||||||
- `1.0-upm`:XCharts 1.0的稳定UMP分支。不带Demo,不再维护。
|
- `1.0-upm`:XCharts 1.0的稳定UMP分支。不带Demo,不再维护。
|
||||||
|
|
||||||
|
## 扩展
|
||||||
|
|
||||||
|
- [扩展图表](https://xcharts-team.github.io/docs/extra) 扩展图表订阅`VIP`后再按需购买,订阅详情请查看[☞ 看这里](Documentation~/zh/support.md)
|
||||||
|
- [扩展组件](https://xcharts-team.github.io/docs/ui) 扩展组件订阅`VIP`后即可免费使用。
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
1. `XCharts`可以免费使用吗?
|
1. `XCharts`可以免费使用吗?
|
||||||
答:`XCharts`使用`MIT`协议,可以免费使用。也可以订阅`VIP`享受更多增值服务。
|
答:`XCharts`使用`MIT`协议,可以免费使用。也可以订阅`VIP`享受更多增值服务。
|
||||||
|
|
||||||
2. `XCharts`支持代码动态添加和修改数据吗?支持从`Excel`或数据库中获取数据吗?
|
2. `XCharts`支持代码动态添加和修改数据吗?支持从`Excel`或数据库中获取数据吗?
|
||||||
答:`XCharts`提供了各种数据操作的接口,支持代码动态修改配置,添加和修改数据,但数据来源需要自己解析或获取,再调用`XCharts`的接口添加到`XCharts`。
|
答:`XCharts`提供了各种数据操作的接口,支持代码动态修改配置,添加和修改数据,但数据来源需要自己解析和获取,再调用`XCharts`的接口添加到图表。
|
||||||
|
|
||||||
3. 这个插件除了用在`Unity`,还能用在其他平台(如`Winform`或`WPF`)吗?
|
3. 这个插件除了用在`Unity`,还能用在其他平台(如`Winform`或`WPF`)吗?
|
||||||
答:目前只支持在`Unity`平台使用。理论上任何支持`UGUI`的`Unity`版本都能运行`XCharts`。
|
答:目前只支持在`Unity`平台使用。理论上任何支持`UGUI`的`Unity`版本都能运行`XCharts`。
|
||||||
@@ -160,4 +141,4 @@ XCharts不再内置Demo,Demo已独立出单独的仓库 [XCharts-Demo](https:/
|
|||||||
- 邮箱:`monitor1394@gmail.com`
|
- 邮箱:`monitor1394@gmail.com`
|
||||||
- QQ群:XCharts交流群(`202030963`)
|
- QQ群:XCharts交流群(`202030963`)
|
||||||
- VIP群:XCharts技术支持VIP群(`867291970`)
|
- VIP群:XCharts技术支持VIP群(`867291970`)
|
||||||
- 捐助、合作和技术支持:[☞ 看这里](Documentation~/zh/support.md)
|
- 捐助、合作、订阅和技术支持:[☞ 看这里](Documentation~/zh/support.md)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace XCharts.Runtime
|
|||||||
AddChartComponentWhenNoExist<XAxis>();
|
AddChartComponentWhenNoExist<XAxis>();
|
||||||
AddChartComponentWhenNoExist<YAxis>();
|
AddChartComponentWhenNoExist<YAxis>();
|
||||||
|
|
||||||
var tooltip = GetOrAddChartComponent<Tooltip>();
|
var tooltip = EnsureChartComponent<Tooltip>();
|
||||||
tooltip.type = Tooltip.Type.Shadow;
|
tooltip.type = Tooltip.Type.Shadow;
|
||||||
tooltip.trigger = Tooltip.Trigger.Axis;
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace XCharts.Runtime
|
|||||||
AddChartComponentWhenNoExist<XAxis>();
|
AddChartComponentWhenNoExist<XAxis>();
|
||||||
AddChartComponentWhenNoExist<YAxis>();
|
AddChartComponentWhenNoExist<YAxis>();
|
||||||
|
|
||||||
var tooltip = GetOrAddChartComponent<Tooltip>();
|
var tooltip = EnsureChartComponent<Tooltip>();
|
||||||
tooltip.type = Tooltip.Type.Shadow;
|
tooltip.type = Tooltip.Type.Shadow;
|
||||||
tooltip.trigger = Tooltip.Trigger.Axis;
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,15 @@ namespace XCharts.Runtime
|
|||||||
tooltip.type = Tooltip.Type.None;
|
tooltip.type = Tooltip.Type.None;
|
||||||
tooltip.trigger = Tooltip.Trigger.Axis;
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
||||||
|
|
||||||
var grid = GetOrAddChartComponent<GridCoord>();
|
var grid = EnsureChartComponent<GridCoord>();
|
||||||
grid.left = 0.12f;
|
grid.left = 0.12f;
|
||||||
|
|
||||||
var xAxis = GetOrAddChartComponent<XAxis>();
|
var xAxis = EnsureChartComponent<XAxis>();
|
||||||
xAxis.type = Axis.AxisType.Category;
|
xAxis.type = Axis.AxisType.Category;
|
||||||
xAxis.boundaryGap = true;
|
xAxis.boundaryGap = true;
|
||||||
xAxis.splitNumber = 10;
|
xAxis.splitNumber = 10;
|
||||||
|
|
||||||
var yAxis = GetOrAddChartComponent<YAxis>();
|
var yAxis = EnsureChartComponent<YAxis>();
|
||||||
yAxis.type = Axis.AxisType.Category;
|
yAxis.type = Axis.AxisType.Category;
|
||||||
yAxis.boundaryGap = true;
|
yAxis.boundaryGap = true;
|
||||||
yAxis.splitNumber = 10;
|
yAxis.splitNumber = 10;
|
||||||
@@ -35,7 +35,7 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
Heatmap.AddDefaultSerie(this, GenerateDefaultSerieName());
|
Heatmap.AddDefaultSerie(this, GenerateDefaultSerieName());
|
||||||
|
|
||||||
var visualMap = GetOrAddChartComponent<VisualMap>();
|
var visualMap = EnsureChartComponent<VisualMap>();
|
||||||
visualMap.autoMinMax = true;
|
visualMap.autoMinMax = true;
|
||||||
visualMap.orient = Orient.Vertical;
|
visualMap.orient = Orient.Vertical;
|
||||||
visualMap.calculable = true;
|
visualMap.calculable = true;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace XCharts.Runtime
|
|||||||
AddChartComponentWhenNoExist<XAxis>();
|
AddChartComponentWhenNoExist<XAxis>();
|
||||||
AddChartComponentWhenNoExist<YAxis>();
|
AddChartComponentWhenNoExist<YAxis>();
|
||||||
|
|
||||||
var tooltip = GetOrAddChartComponent<Tooltip>();
|
var tooltip = EnsureChartComponent<Tooltip>();
|
||||||
tooltip.type = Tooltip.Type.Line;
|
tooltip.type = Tooltip.Type.Line;
|
||||||
tooltip.trigger = Tooltip.Trigger.Axis;
|
tooltip.trigger = Tooltip.Trigger.Axis;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
protected override void DefaultChart()
|
protected override void DefaultChart()
|
||||||
{
|
{
|
||||||
var legend = GetOrAddChartComponent<Legend>();
|
var legend = EnsureChartComponent<Legend>();
|
||||||
legend.show = true;
|
legend.show = true;
|
||||||
|
|
||||||
RemoveData();
|
RemoveData();
|
||||||
|
|||||||
@@ -12,15 +12,15 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
AddChartComponentWhenNoExist<GridCoord>();
|
AddChartComponentWhenNoExist<GridCoord>();
|
||||||
|
|
||||||
var tooltip = GetOrAddChartComponent<Tooltip>();
|
var tooltip = EnsureChartComponent<Tooltip>();
|
||||||
tooltip.type = Tooltip.Type.None;
|
tooltip.type = Tooltip.Type.None;
|
||||||
tooltip.trigger = Tooltip.Trigger.Item;
|
tooltip.trigger = Tooltip.Trigger.Item;
|
||||||
|
|
||||||
var xAxis = GetOrAddChartComponent<XAxis>();
|
var xAxis = EnsureChartComponent<XAxis>();
|
||||||
xAxis.type = Axis.AxisType.Value;
|
xAxis.type = Axis.AxisType.Value;
|
||||||
xAxis.boundaryGap = false;
|
xAxis.boundaryGap = false;
|
||||||
|
|
||||||
var yAxis = GetOrAddChartComponent<YAxis>();
|
var yAxis = EnsureChartComponent<YAxis>();
|
||||||
yAxis.type = Axis.AxisType.Value;
|
yAxis.type = Axis.AxisType.Value;
|
||||||
yAxis.boundaryGap = false;
|
yAxis.boundaryGap = false;
|
||||||
|
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
public float GetUpdateAnimationDuration()
|
public float GetUpdateAnimationDuration()
|
||||||
{
|
{
|
||||||
if (m_Enable && m_DataChangeEnable && IsFinish())
|
if (m_Enable && m_DataChangeEnable)
|
||||||
return m_DataChangeDuration;
|
return m_DataChangeDuration;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -576,13 +576,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
total = context.labelValueList.Count;
|
total = context.labelValueList.Count;
|
||||||
}
|
}
|
||||||
var labelShow = axisLabel.show && (axisLabel.interval == 0 || index % (axisLabel.interval + 1) == 0);
|
return axisLabel.IsNeedShowLabel(index, total);
|
||||||
if (labelShow)
|
|
||||||
{
|
|
||||||
if (!axisLabel.showStartLabel && index == 0) labelShow = false;
|
|
||||||
else if (!axisLabel.showEndLabel && index == total - 1) labelShow = false;
|
|
||||||
}
|
|
||||||
return labelShow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetNeedUpdateFilterData()
|
public void SetNeedUpdateFilterData()
|
||||||
@@ -827,18 +821,18 @@ namespace XCharts.Runtime
|
|||||||
return logBaseE ? (float) Math.Log(value) : (float) Math.Log(value, logBase);
|
return logBaseE ? (float) Math.Log(value) : (float) Math.Log(value, logBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetLogMinIndex()
|
public double GetLogMinIndex()
|
||||||
{
|
{
|
||||||
return logBaseE ?
|
return logBaseE ?
|
||||||
(int) Math.Log(context.minValue) :
|
Math.Log(context.minValue) :
|
||||||
(int) Math.Log(context.minValue, logBase);
|
Math.Log(context.minValue, logBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetLogMaxIndex()
|
public double GetLogMaxIndex()
|
||||||
{
|
{
|
||||||
return logBaseE ?
|
return logBaseE ?
|
||||||
(int) Math.Log(context.maxValue) :
|
Math.Log(context.maxValue) :
|
||||||
(int) Math.Log(context.maxValue, logBase);
|
Math.Log(context.maxValue, logBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double GetLabelValue(int index)
|
public double GetLabelValue(int index)
|
||||||
|
|||||||
@@ -65,9 +65,10 @@ namespace XCharts.Runtime
|
|||||||
if (axis.splitNumber <= 0)
|
if (axis.splitNumber <= 0)
|
||||||
{
|
{
|
||||||
var eachWid = coordinateWid / dataCount;
|
var eachWid = coordinateWid / dataCount;
|
||||||
if (eachWid > 80) return dataCount;
|
var min = axis is YAxis ? 20 : 80;
|
||||||
var tick = Mathf.CeilToInt(80 / eachWid);
|
if (eachWid > min) return dataCount;
|
||||||
return (int) (dataCount / tick);
|
var tick = Mathf.CeilToInt(min / eachWid);
|
||||||
|
return (int)(dataCount / tick);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -131,7 +132,7 @@ namespace XCharts.Runtime
|
|||||||
maxValue = -maxValue;
|
maxValue = -maxValue;
|
||||||
}
|
}
|
||||||
if (forcePercent)
|
if (forcePercent)
|
||||||
return string.Format("{0}%", (int) value);
|
return string.Format("{0}%", (int)value);
|
||||||
else
|
else
|
||||||
return axis.axisLabel.GetFormatterContent(index, value, minValue, maxValue);
|
return axis.axisLabel.GetFormatterContent(index, value, minValue, maxValue);
|
||||||
}
|
}
|
||||||
@@ -218,7 +219,7 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
if (axis.boundaryGap)
|
if (axis.boundaryGap)
|
||||||
{
|
{
|
||||||
scaleNum = dataCount > 2 && dataCount % splitNum == 0 ?
|
scaleNum = dataCount > 1 && dataCount % splitNum == 0 ?
|
||||||
splitNum + 1 :
|
splitNum + 1 :
|
||||||
splitNum + 2;
|
splitNum + 2;
|
||||||
}
|
}
|
||||||
@@ -254,9 +255,8 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
var value = axis.GetLabelValue(index);
|
var value = axis.GetLabelValue(index);
|
||||||
var lastValue = axis.GetLabelValue(index - 1);
|
var lastValue = axis.GetLabelValue(index - 1);
|
||||||
return axis.context.minMaxRange == 0 ?
|
return axis.context.minMaxRange == 0 ? 0 :
|
||||||
0 :
|
(float)(coordinateWidth * (value - lastValue) / axis.context.minMaxRange);
|
||||||
(float) (coordinateWidth * (value - lastValue) / axis.context.minMaxRange);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -344,7 +344,10 @@ namespace XCharts.Runtime
|
|||||||
int maxSplit = 0;
|
int maxSplit = 0;
|
||||||
maxValue = ChartHelper.GetMaxLogValue(maxValue, axis.logBase, axis.logBaseE, out maxSplit);
|
maxValue = ChartHelper.GetMaxLogValue(maxValue, axis.logBase, axis.logBaseE, out maxSplit);
|
||||||
minValue = ChartHelper.GetMinLogValue(minValue, axis.logBase, axis.logBaseE, out minSplit);
|
minValue = ChartHelper.GetMinLogValue(minValue, axis.logBase, axis.logBaseE, out minSplit);
|
||||||
axis.splitNumber = (minSplit > 0 && maxSplit > 0) ? (maxSplit + minSplit - 1) : (maxSplit + minSplit);
|
var splitNumber = (minSplit > 0 && maxSplit > 0) ? (maxSplit + minSplit - 1) : (maxSplit + minSplit);
|
||||||
|
if (splitNumber > 15)
|
||||||
|
splitNumber = 15;
|
||||||
|
axis.splitNumber = splitNumber;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (axis.type == Axis.AxisType.Time) { }
|
if (axis.type == Axis.AxisType.Time) { }
|
||||||
@@ -459,7 +462,7 @@ namespace XCharts.Runtime
|
|||||||
if (axis.IsCategory())
|
if (axis.IsCategory())
|
||||||
{
|
{
|
||||||
if (dataCount == 0) dataCount = axis.data.Count;
|
if (dataCount == 0) dataCount = axis.data.Count;
|
||||||
var categoryIndex = (int) value;
|
var categoryIndex = (int)value;
|
||||||
var scaleWid = AxisHelper.GetDataWidth(axis, gridHeight, dataCount, dataZoom);
|
var scaleWid = AxisHelper.GetDataWidth(axis, gridHeight, dataCount, dataZoom);
|
||||||
float startY = gridXY + (axis.boundaryGap ? scaleWid / 2 : 0);
|
float startY = gridXY + (axis.boundaryGap ? scaleWid / 2 : 0);
|
||||||
return startY + scaleWid * categoryIndex;
|
return startY + scaleWid * categoryIndex;
|
||||||
@@ -467,9 +470,8 @@ namespace XCharts.Runtime
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var yDataHig = (axis.context.minMaxRange == 0) ? 0f :
|
var yDataHig = (axis.context.minMaxRange == 0) ? 0f :
|
||||||
(float) ((value - axis.context.minValue) / axis.context.minMaxRange * gridHeight);
|
(float)((value - axis.context.minValue) / axis.context.minMaxRange * gridHeight);
|
||||||
return gridXY + yDataHig;
|
return gridXY + yDataHig;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,7 +540,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
if (axis.IsCategory())
|
if (axis.IsCategory())
|
||||||
{
|
{
|
||||||
return (int) value;
|
return (int)value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -549,9 +551,9 @@ namespace XCharts.Runtime
|
|||||||
if (totalSplitNumber == -1)
|
if (totalSplitNumber == -1)
|
||||||
totalSplitNumber = GetTotalSplitGridNum(axis);
|
totalSplitNumber = GetTotalSplitGridNum(axis);
|
||||||
if (axis.minMaxType == Axis.AxisMinMaxType.Custom)
|
if (axis.minMaxType == Axis.AxisMinMaxType.Custom)
|
||||||
return Mathf.CeilToInt(((float) ((value - axis.min) / axis.max) * totalSplitNumber) - 1);
|
return Mathf.CeilToInt(((float)((value - axis.min) / axis.max) * totalSplitNumber) - 1);
|
||||||
else
|
else
|
||||||
return Mathf.CeilToInt(((float) ((value - axis.context.minValue) / axis.context.minMaxRange) * totalSplitNumber) - 1);
|
return Mathf.CeilToInt(((float)((value - axis.context.minValue) / axis.context.minMaxRange) * totalSplitNumber) - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -564,15 +566,15 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
if (axis.IsLog())
|
if (axis.IsLog())
|
||||||
{
|
{
|
||||||
int minIndex = axis.GetLogMinIndex();
|
var minIndex = axis.GetLogMinIndex();
|
||||||
float nowIndex = axis.GetLogValue(value);
|
var nowIndex = axis.GetLogValue(value);
|
||||||
return includeGridXY ?
|
return includeGridXY ?
|
||||||
gridXY + (nowIndex - minIndex) / axis.splitNumber * gridHeight :
|
(float)(gridXY + (nowIndex - minIndex) / axis.splitNumber * gridHeight) :
|
||||||
(nowIndex - minIndex) / axis.splitNumber * gridHeight;
|
(float)((nowIndex - minIndex) / axis.splitNumber * gridHeight);
|
||||||
}
|
}
|
||||||
else if (axis.IsCategory())
|
else if (axis.IsCategory())
|
||||||
{
|
{
|
||||||
var categoryIndex = (int) value;
|
var categoryIndex = (int)value;
|
||||||
return includeGridXY ?
|
return includeGridXY ?
|
||||||
gridXY + (axis.boundaryGap ? scaleWidth / 2 : 0) + scaleWidth * categoryIndex :
|
gridXY + (axis.boundaryGap ? scaleWidth / 2 : 0) + scaleWidth * categoryIndex :
|
||||||
(axis.boundaryGap ? scaleWidth / 2 : 0) + scaleWidth * categoryIndex;
|
(axis.boundaryGap ? scaleWidth / 2 : 0) + scaleWidth * categoryIndex;
|
||||||
@@ -583,9 +585,9 @@ namespace XCharts.Runtime
|
|||||||
if (axis.context.minMaxRange != 0)
|
if (axis.context.minMaxRange != 0)
|
||||||
{
|
{
|
||||||
if (realLength)
|
if (realLength)
|
||||||
yDataHig = (float) (value * gridHeight / axis.context.minMaxRange);
|
yDataHig = (float)(value * gridHeight / axis.context.minMaxRange);
|
||||||
else
|
else
|
||||||
yDataHig = (float) ((value - axis.context.minValue) / axis.context.minMaxRange * gridHeight);
|
yDataHig = (float)((value - axis.context.minValue) / axis.context.minMaxRange * gridHeight);
|
||||||
}
|
}
|
||||||
return includeGridXY ?
|
return includeGridXY ?
|
||||||
gridXY + yDataHig :
|
gridXY + yDataHig :
|
||||||
|
|||||||
@@ -96,10 +96,10 @@ namespace XCharts.Runtime
|
|||||||
return new AxisLabel()
|
return new AxisLabel()
|
||||||
{
|
{
|
||||||
m_Show = true,
|
m_Show = true,
|
||||||
m_Interval = 0,
|
m_Interval = 0,
|
||||||
m_Inside = false,
|
m_Inside = false,
|
||||||
m_Distance = 8,
|
m_Distance = 8,
|
||||||
m_TextStyle = new TextStyle(),
|
m_TextStyle = new TextStyle(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,5 +168,16 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
return base.GetFormatterContent(labelIndex, value, minValue, maxValue, isLog);
|
return base.GetFormatterContent(labelIndex, value, minValue, maxValue, isLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsNeedShowLabel(int index, int total)
|
||||||
|
{
|
||||||
|
var labelShow = show && (interval == 0 || index % (interval + 1) == 0);
|
||||||
|
if (labelShow)
|
||||||
|
{
|
||||||
|
if (!showStartLabel && index == 0) labelShow = false;
|
||||||
|
else if (!showEndLabel && index == total - 1) labelShow = false;
|
||||||
|
}
|
||||||
|
return labelShow;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Background component.
|
/// Background component.
|
||||||
/// |
|
/// |背景组件。
|
||||||
/// 背景组件。
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@@ -27,7 +26,7 @@ namespace XCharts.Runtime
|
|||||||
public bool show
|
public bool show
|
||||||
{
|
{
|
||||||
get { return m_Show; }
|
get { return m_Show; }
|
||||||
internal set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); }
|
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the image of background.
|
/// the image of background.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace XCharts.Runtime
|
|||||||
component.gameObject = backgroundObj;
|
component.gameObject = backgroundObj;
|
||||||
backgroundObj.hideFlags = chart.chartHideFlags;
|
backgroundObj.hideFlags = chart.chartHideFlags;
|
||||||
|
|
||||||
var backgroundImage = ChartHelper.GetOrAddComponent<Image>(backgroundObj);
|
var backgroundImage = ChartHelper.EnsureComponent<Image>(backgroundObj);
|
||||||
ChartHelper.UpdateRectTransform(backgroundObj, chart.chartMinAnchor,
|
ChartHelper.UpdateRectTransform(backgroundObj, chart.chartMinAnchor,
|
||||||
chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
||||||
backgroundImage.sprite = component.image;
|
backgroundImage.sprite = component.image;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace XCharts.Runtime
|
|||||||
/// |区域填充样式。
|
/// |区域填充样式。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class AreaStyle : ChildComponent, ISerieExtraComponent, ISerieDataComponent
|
public class AreaStyle : ChildComponent, ISerieComponent, ISerieDataComponent
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Origin position of area.
|
/// Origin position of area.
|
||||||
@@ -38,6 +38,7 @@ namespace XCharts.Runtime
|
|||||||
[SerializeField] private Color32 m_ToColor;
|
[SerializeField] private Color32 m_ToColor;
|
||||||
[SerializeField][Range(0, 1)] private float m_Opacity = 0.6f;
|
[SerializeField][Range(0, 1)] private float m_Opacity = 0.6f;
|
||||||
[SerializeField][Since("v3.2.0")] private bool m_InnerFill;
|
[SerializeField][Since("v3.2.0")] private bool m_InnerFill;
|
||||||
|
[SerializeField][Since("v3.6.0")] private bool m_ToTop = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set this to false to prevent the areafrom showing.
|
/// Set this to false to prevent the areafrom showing.
|
||||||
@@ -93,6 +94,16 @@ namespace XCharts.Runtime
|
|||||||
get { return m_InnerFill; }
|
get { return m_InnerFill; }
|
||||||
set { if (PropertyUtil.SetStruct(ref m_InnerFill, value)) SetVerticesDirty(); }
|
set { if (PropertyUtil.SetStruct(ref m_InnerFill, value)) SetVerticesDirty(); }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to fill the gradient color to the top. The default is true, which means that the gradient color is filled to the top.
|
||||||
|
/// If it is false, the gradient color is filled to the actual position.
|
||||||
|
/// |渐变色是到顶部还是到实际位置。默认为true到顶部。
|
||||||
|
/// </summary>
|
||||||
|
public bool toTop
|
||||||
|
{
|
||||||
|
get { return m_ToTop; }
|
||||||
|
set { if (PropertyUtil.SetStruct(ref m_ToTop, value)) SetVerticesDirty(); }
|
||||||
|
}
|
||||||
|
|
||||||
public Color32 GetColor()
|
public Color32 GetColor()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using UnityEngine.UI;
|
|||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class ImageStyle : ChildComponent, ISerieExtraComponent, ISerieDataComponent
|
public class ImageStyle : ChildComponent, ISerieComponent, ISerieDataComponent
|
||||||
{
|
{
|
||||||
[SerializeField] private bool m_Show = true;
|
[SerializeField] private bool m_Show = true;
|
||||||
[SerializeField] private Sprite m_Sprite;
|
[SerializeField] private Sprite m_Sprite;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace XCharts.Runtime
|
|||||||
[SerializeField] private Color32 m_Color0;
|
[SerializeField] private Color32 m_Color0;
|
||||||
[SerializeField] private Color32 m_ToColor;
|
[SerializeField] private Color32 m_ToColor;
|
||||||
[SerializeField] private Color32 m_ToColor2;
|
[SerializeField] private Color32 m_ToColor2;
|
||||||
|
[SerializeField][Since("v3.6.0")] private Color32 m_MarkColor;
|
||||||
[SerializeField] private Color32 m_BackgroundColor;
|
[SerializeField] private Color32 m_BackgroundColor;
|
||||||
[SerializeField] private float m_BackgroundWidth;
|
[SerializeField] private float m_BackgroundWidth;
|
||||||
[SerializeField] private Color32 m_CenterColor;
|
[SerializeField] private Color32 m_CenterColor;
|
||||||
@@ -35,6 +36,7 @@ namespace XCharts.Runtime
|
|||||||
m_Color0 = Color.clear;
|
m_Color0 = Color.clear;
|
||||||
m_ToColor = Color.clear;
|
m_ToColor = Color.clear;
|
||||||
m_ToColor2 = Color.clear;
|
m_ToColor2 = Color.clear;
|
||||||
|
m_MarkColor = Color.clear;
|
||||||
m_BackgroundColor = Color.clear;
|
m_BackgroundColor = Color.clear;
|
||||||
m_BackgroundWidth = 0;
|
m_BackgroundWidth = 0;
|
||||||
m_CenterColor = Color.clear;
|
m_CenterColor = Color.clear;
|
||||||
@@ -102,6 +104,15 @@ namespace XCharts.Runtime
|
|||||||
set { if (PropertyUtil.SetColor(ref m_ToColor2, value)) SetVerticesDirty(); }
|
set { if (PropertyUtil.SetColor(ref m_ToColor2, value)) SetVerticesDirty(); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Serie's mark color. It is only used to display Legend and Tooltip, and does not affect the drawing color. The default value is clear.
|
||||||
|
/// |Serie的标识颜色。仅用于Legend和Tooltip的展示,不影响绘制颜色,默认为clear。
|
||||||
|
/// </summary>
|
||||||
|
public Color32 markColor
|
||||||
|
{
|
||||||
|
get { return m_MarkColor; }
|
||||||
|
set { if (PropertyUtil.SetStruct(ref m_MarkColor, value)) { SetAllDirty(); } }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 数据项背景颜色。
|
/// 数据项背景颜色。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Color32 backgroundColor
|
public Color32 backgroundColor
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace XCharts.Runtime
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class LineArrow : ChildComponent, ISerieExtraComponent
|
public class LineArrow : ChildComponent, ISerieComponent
|
||||||
{
|
{
|
||||||
public enum Position
|
public enum Position
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,10 +125,10 @@ namespace XCharts.Runtime
|
|||||||
return new Location()
|
return new Location()
|
||||||
{
|
{
|
||||||
align = Align.CenterLeft,
|
align = Align.CenterLeft,
|
||||||
left = 0.03f,
|
left = 0.03f,
|
||||||
right = 0,
|
right = 0,
|
||||||
top = 0,
|
top = 0,
|
||||||
bottom = 0
|
bottom = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,10 +140,10 @@ namespace XCharts.Runtime
|
|||||||
return new Location()
|
return new Location()
|
||||||
{
|
{
|
||||||
align = Align.CenterRight,
|
align = Align.CenterRight,
|
||||||
left = 0,
|
left = 0,
|
||||||
right = 0.03f,
|
right = 0.03f,
|
||||||
top = 0,
|
top = 0,
|
||||||
bottom = 0
|
bottom = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,10 +155,10 @@ namespace XCharts.Runtime
|
|||||||
return new Location()
|
return new Location()
|
||||||
{
|
{
|
||||||
align = Align.TopCenter,
|
align = Align.TopCenter,
|
||||||
left = 0,
|
left = 0,
|
||||||
right = 0,
|
right = 0,
|
||||||
top = 0.03f,
|
top = 0.03f,
|
||||||
bottom = 0
|
bottom = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,10 +170,10 @@ namespace XCharts.Runtime
|
|||||||
return new Location()
|
return new Location()
|
||||||
{
|
{
|
||||||
align = Align.BottomCenter,
|
align = Align.BottomCenter,
|
||||||
left = 0,
|
left = 0,
|
||||||
right = 0,
|
right = 0,
|
||||||
top = 0,
|
top = 0,
|
||||||
bottom = 0.03f
|
bottom = 0.03f
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -268,6 +268,46 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsBottom()
|
||||||
|
{
|
||||||
|
switch (m_Align)
|
||||||
|
{
|
||||||
|
case Align.BottomCenter:
|
||||||
|
case Align.BottomLeft:
|
||||||
|
case Align.BottomRight:
|
||||||
|
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsTop()
|
||||||
|
{
|
||||||
|
switch (m_Align)
|
||||||
|
{
|
||||||
|
case Align.TopCenter:
|
||||||
|
case Align.TopLeft:
|
||||||
|
case Align.TopRight:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsCenter()
|
||||||
|
{
|
||||||
|
switch (m_Align)
|
||||||
|
{
|
||||||
|
case Align.Center:
|
||||||
|
case Align.CenterLeft:
|
||||||
|
case Align.CenterRight:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateRuntimeData(float chartWidth, float chartHeight)
|
public void UpdateRuntimeData(float chartWidth, float chartHeight)
|
||||||
{
|
{
|
||||||
runtimeLeft = left <= 1 ? left * chartWidth : left;
|
runtimeLeft = left <= 1 ? left * chartWidth : left;
|
||||||
|
|||||||
@@ -81,8 +81,6 @@ namespace XCharts.Runtime
|
|||||||
[SerializeField] private RangeMode m_RangeMode;
|
[SerializeField] private RangeMode m_RangeMode;
|
||||||
[SerializeField] private float m_Start;
|
[SerializeField] private float m_Start;
|
||||||
[SerializeField] private float m_End;
|
[SerializeField] private float m_End;
|
||||||
//[SerializeField] private float m_StartValue;
|
|
||||||
//[SerializeField] private float m_EndValue;
|
|
||||||
[SerializeField] private int m_MinShowNum = 1;
|
[SerializeField] private int m_MinShowNum = 1;
|
||||||
[Range(1f, 20f)]
|
[Range(1f, 20f)]
|
||||||
[SerializeField] private float m_ScrollSensitivity = 1.1f;
|
[SerializeField] private float m_ScrollSensitivity = 1.1f;
|
||||||
@@ -91,8 +89,11 @@ namespace XCharts.Runtime
|
|||||||
[SerializeField] private LineStyle m_LineStyle = new LineStyle(LineStyle.Type.Solid);
|
[SerializeField] private LineStyle m_LineStyle = new LineStyle(LineStyle.Type.Solid);
|
||||||
[SerializeField] private AreaStyle m_AreaStyle = new AreaStyle();
|
[SerializeField] private AreaStyle m_AreaStyle = new AreaStyle();
|
||||||
[SerializeField][Since("v3.5.0")] private MarqueeStyle m_MarqueeStyle = new MarqueeStyle();
|
[SerializeField][Since("v3.5.0")] private MarqueeStyle m_MarqueeStyle = new MarqueeStyle();
|
||||||
|
[SerializeField][Since("v3.6.0")] private bool m_StartLock;
|
||||||
|
[SerializeField][Since("v3.6.0")] private bool m_EndLock;
|
||||||
|
|
||||||
public DataZoomContext context = new DataZoomContext();
|
public DataZoomContext context = new DataZoomContext();
|
||||||
|
private CustomDataZoomStartEndFunction m_StartEndFunction;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to show dataZoom.
|
/// Whether to show dataZoom.
|
||||||
@@ -305,6 +306,24 @@ namespace XCharts.Runtime
|
|||||||
set { m_Start = value; if (m_Start < 0) m_Start = 0; if (m_Start > 100) m_Start = 100; SetVerticesDirty(); }
|
set { m_Start = value; if (m_Start < 0) m_Start = 0; if (m_Start > 100) m_Start = 100; SetVerticesDirty(); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Lock start value.
|
||||||
|
/// |固定起始值,不让改变。
|
||||||
|
/// </summary>
|
||||||
|
public bool startLock
|
||||||
|
{
|
||||||
|
get { return m_StartLock; }
|
||||||
|
set { if (PropertyUtil.SetStruct(ref m_StartLock, value)) SetVerticesDirty(); }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Lock end value.
|
||||||
|
/// |固定结束值,不让改变。
|
||||||
|
/// </summary>
|
||||||
|
public bool endLock
|
||||||
|
{
|
||||||
|
get { return m_EndLock; }
|
||||||
|
set { if (PropertyUtil.SetStruct(ref m_EndLock, value)) SetVerticesDirty(); }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// The end percentage of the window out of the data extent, in the range of 0 ~ 100.
|
/// The end percentage of the window out of the data extent, in the range of 0 ~ 100.
|
||||||
/// |数据窗口范围的结束百分比。范围是:0 ~ 100。
|
/// |数据窗口范围的结束百分比。范围是:0 ~ 100。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -375,6 +394,10 @@ namespace XCharts.Runtime
|
|||||||
get { return m_MarqueeStyle; }
|
get { return m_MarqueeStyle; }
|
||||||
set { if (PropertyUtil.SetClass(ref m_MarqueeStyle, value)) SetAllDirty(); }
|
set { if (PropertyUtil.SetClass(ref m_MarqueeStyle, value)) SetAllDirty(); }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// start和end变更委托。
|
||||||
|
/// </summary>
|
||||||
|
public CustomDataZoomStartEndFunction startEndFunction { get { return m_StartEndFunction; } set { m_StartEndFunction = value; } }
|
||||||
|
|
||||||
class AxisIndexValueInfo
|
class AxisIndexValueInfo
|
||||||
{
|
{
|
||||||
@@ -631,12 +654,12 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
internal void UpdateStartLabelPosition(Vector3 pos)
|
internal void UpdateStartLabelPosition(Vector3 pos)
|
||||||
{
|
{
|
||||||
m_StartLabel.SetPosition(pos);
|
if (m_StartLabel != null) m_StartLabel.SetPosition(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void UpdateEndLabelPosition(Vector3 pos)
|
internal void UpdateEndLabelPosition(Vector3 pos)
|
||||||
{
|
{
|
||||||
m_EndLabel.SetPosition(pos);
|
if (m_EndLabel != null) m_EndLabel.SetPosition(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateRuntimeData(float chartX, float chartY, float chartWidth, float chartHeight)
|
public void UpdateRuntimeData(float chartX, float chartY, float chartWidth, float chartHeight)
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XUGL;
|
using XUGL;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
@@ -20,7 +22,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
var dataZoom = component;
|
var dataZoom = component;
|
||||||
dataZoom.painter = chart.m_PainterUpper;
|
dataZoom.painter = chart.m_PainterUpper;
|
||||||
dataZoom.refreshComponent = delegate()
|
dataZoom.refreshComponent = delegate ()
|
||||||
{
|
{
|
||||||
var dataZoomObject = ChartHelper.AddObject(s_DefaultDataZoom + dataZoom.index, chart.transform,
|
var dataZoomObject = ChartHelper.AddObject(s_DefaultDataZoom + dataZoom.index, chart.transform,
|
||||||
chart.chartMinAnchor, chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
chart.chartMinAnchor, chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
||||||
@@ -395,9 +397,13 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
if (end < start)
|
if (end < start)
|
||||||
end = start;
|
end = start;
|
||||||
|
if (dataZoom.startEndFunction != null)
|
||||||
|
dataZoom.startEndFunction(ref start, ref end);
|
||||||
|
|
||||||
dataZoom.start = start;
|
if (!dataZoom.startLock)
|
||||||
dataZoom.end = end;
|
dataZoom.start = start;
|
||||||
|
if (!dataZoom.endLock)
|
||||||
|
dataZoom.end = end;
|
||||||
if (dataZoom.realtime)
|
if (dataZoom.realtime)
|
||||||
{
|
{
|
||||||
chart.OnDataZoomRangeChanged(dataZoom);
|
chart.OnDataZoomRangeChanged(dataZoom);
|
||||||
@@ -464,8 +470,8 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
m_CheckDataZoomLabel = false;
|
m_CheckDataZoomLabel = false;
|
||||||
var xAxis = chart.GetChartComponent<XAxis>(dataZoom.xAxisIndexs[0]);
|
var xAxis = chart.GetChartComponent<XAxis>(dataZoom.xAxisIndexs[0]);
|
||||||
var startIndex = (int) ((xAxis.data.Count - 1) * dataZoom.start / 100);
|
var startIndex = (int)((xAxis.data.Count - 1) * dataZoom.start / 100);
|
||||||
var endIndex = (int) ((xAxis.data.Count - 1) * dataZoom.end / 100);
|
var endIndex = (int)((xAxis.data.Count - 1) * dataZoom.end / 100);
|
||||||
|
|
||||||
if (m_DataZoomLastStartIndex != startIndex || m_DataZoomLastEndIndex != endIndex)
|
if (m_DataZoomLastStartIndex != startIndex || m_DataZoomLastEndIndex != endIndex)
|
||||||
{
|
{
|
||||||
@@ -530,7 +536,7 @@ namespace XCharts.Runtime
|
|||||||
var sampleDist = serie.sampleDist < 2 ? 2 : serie.sampleDist;
|
var sampleDist = serie.sampleDist < 2 ? 2 : serie.sampleDist;
|
||||||
var maxCount = showData.Count;
|
var maxCount = showData.Count;
|
||||||
if (sampleDist > 0)
|
if (sampleDist > 0)
|
||||||
rate = (int) ((maxCount - serie.minShow) / (dataZoom.context.width / sampleDist));
|
rate = (int)((maxCount - serie.minShow) / (dataZoom.context.width / sampleDist));
|
||||||
if (rate < 1)
|
if (rate < 1)
|
||||||
rate = 1;
|
rate = 1;
|
||||||
|
|
||||||
@@ -545,7 +551,7 @@ namespace XCharts.Runtime
|
|||||||
double value = DataHelper.SampleValue(ref showData, serie.sampleType, rate, serie.minShow, maxCount, totalAverage, i,
|
double value = DataHelper.SampleValue(ref showData, serie.sampleType, rate, serie.minShow, maxCount, totalAverage, i,
|
||||||
animationDuration, ref dataChanging, axis, unscaledTime);
|
animationDuration, ref dataChanging, axis, unscaledTime);
|
||||||
float pX = dataZoom.context.x + i * scaleWid;
|
float pX = dataZoom.context.x + i * scaleWid;
|
||||||
float dataHig = (float) ((maxValue - minValue) == 0 ? 0 :
|
float dataHig = (float)((maxValue - minValue) == 0 ? 0 :
|
||||||
(value - minValue) / (maxValue - minValue) * dataZoom.context.height);
|
(value - minValue) / (maxValue - minValue) * dataZoom.context.height);
|
||||||
np = new Vector3(pX, chart.chartY + dataZoom.bottom + dataHig);
|
np = new Vector3(pX, chart.chartY + dataZoom.bottom + dataHig);
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
@@ -621,7 +627,7 @@ namespace XCharts.Runtime
|
|||||||
var sampleDist = serie.sampleDist < 2 ? 2 : serie.sampleDist;
|
var sampleDist = serie.sampleDist < 2 ? 2 : serie.sampleDist;
|
||||||
var maxCount = showData.Count;
|
var maxCount = showData.Count;
|
||||||
if (sampleDist > 0)
|
if (sampleDist > 0)
|
||||||
rate = (int) ((maxCount - serie.minShow) / (dataZoom.context.height / sampleDist));
|
rate = (int)((maxCount - serie.minShow) / (dataZoom.context.height / sampleDist));
|
||||||
if (rate < 1)
|
if (rate < 1)
|
||||||
rate = 1;
|
rate = 1;
|
||||||
|
|
||||||
@@ -637,7 +643,7 @@ namespace XCharts.Runtime
|
|||||||
animationDuration, ref dataChanging, axis, unscaledTime);
|
animationDuration, ref dataChanging, axis, unscaledTime);
|
||||||
float pY = dataZoom.context.y + i * scaleWid;
|
float pY = dataZoom.context.y + i * scaleWid;
|
||||||
float dataHig = (maxValue - minValue) == 0 ? 0 :
|
float dataHig = (maxValue - minValue) == 0 ? 0 :
|
||||||
(float) ((value - minValue) / (maxValue - minValue) * dataZoom.context.width);
|
(float)((value - minValue) / (maxValue - minValue) * dataZoom.context.width);
|
||||||
np = new Vector3(chart.chartX + chart.chartWidth - dataZoom.right - dataHig, pY);
|
np = new Vector3(chart.chartX + chart.chartWidth - dataZoom.right - dataHig, pY);
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace XCharts.Runtime
|
|||||||
/// 标签的引导线
|
/// 标签的引导线
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class LabelLine : ChildComponent, ISerieExtraComponent, ISerieDataComponent
|
public class LabelLine : ChildComponent, ISerieComponent, ISerieDataComponent
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 标签视觉引导线类型
|
/// 标签视觉引导线类型
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace XCharts.Runtime
|
|||||||
/// |图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等。
|
/// |图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class LabelStyle : ChildComponent, ISerieExtraComponent, ISerieDataComponent
|
public class LabelStyle : ChildComponent, ISerieComponent, ISerieDataComponent
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The position of label.
|
/// The position of label.
|
||||||
@@ -74,6 +74,7 @@ namespace XCharts.Runtime
|
|||||||
[SerializeField] protected bool m_AutoOffset = false;
|
[SerializeField] protected bool m_AutoOffset = false;
|
||||||
[SerializeField] protected Vector3 m_Offset;
|
[SerializeField] protected Vector3 m_Offset;
|
||||||
[SerializeField] protected float m_Rotate;
|
[SerializeField] protected float m_Rotate;
|
||||||
|
[SerializeField][Since("v3.6.0")] protected bool m_AutoRotate = false;
|
||||||
[SerializeField] protected float m_Distance;
|
[SerializeField] protected float m_Distance;
|
||||||
[SerializeField] protected string m_Formatter;
|
[SerializeField] protected string m_Formatter;
|
||||||
[SerializeField] protected string m_NumericFormatter = "";
|
[SerializeField] protected string m_NumericFormatter = "";
|
||||||
@@ -155,6 +156,15 @@ namespace XCharts.Runtime
|
|||||||
set { if (PropertyUtil.SetStruct(ref m_Rotate, value)) SetComponentDirty(); }
|
set { if (PropertyUtil.SetStruct(ref m_Rotate, value)) SetComponentDirty(); }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// auto rotate of label.
|
||||||
|
/// |是否自动旋转。
|
||||||
|
/// </summary>
|
||||||
|
public bool autoRotate
|
||||||
|
{
|
||||||
|
get { return m_AutoRotate; }
|
||||||
|
set { if (PropertyUtil.SetStruct(ref m_AutoRotate, value)) SetComponentDirty(); }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 距离轴线的距离。
|
/// 距离轴线的距离。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float distance
|
public float distance
|
||||||
@@ -336,33 +346,38 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
public virtual string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
public virtual string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
|
||||||
{
|
{
|
||||||
|
var newNumericFormatter = numericFormatter;
|
||||||
|
if (string.IsNullOrEmpty(newNumericFormatter) && !isLog)
|
||||||
|
{
|
||||||
|
newNumericFormatter = MathUtil.IsInteger(maxValue) ? "0" : "f" + MathUtil.GetPrecision(maxValue);
|
||||||
|
}
|
||||||
if (string.IsNullOrEmpty(m_Formatter))
|
if (string.IsNullOrEmpty(m_Formatter))
|
||||||
{
|
{
|
||||||
if (isLog)
|
if (isLog)
|
||||||
{
|
{
|
||||||
return GetFormatterFunctionContent(labelIndex, value, ChartCached.NumberToStr(value, numericFormatter));
|
return GetFormatterFunctionContent(labelIndex, value, ChartCached.NumberToStr(value, newNumericFormatter));
|
||||||
}
|
}
|
||||||
if (minValue >= -1 && minValue <= 1 && maxValue >= -1 && maxValue <= 1)
|
if (minValue >= -1 && minValue <= 1 && maxValue >= -1 && maxValue <= 1)
|
||||||
{
|
{
|
||||||
int minAcc = ChartHelper.GetFloatAccuracy(minValue);
|
int minAcc = MathUtil.GetPrecision(minValue);
|
||||||
int maxAcc = ChartHelper.GetFloatAccuracy(maxValue);
|
int maxAcc = MathUtil.GetPrecision(maxValue);
|
||||||
int curAcc = ChartHelper.GetFloatAccuracy(value);
|
int curAcc = MathUtil.GetPrecision(value);
|
||||||
int acc = Mathf.Max(Mathf.Max(minAcc, maxAcc), curAcc);
|
int acc = Mathf.Max(Mathf.Max(minAcc, maxAcc), curAcc);
|
||||||
return GetFormatterFunctionContent(labelIndex, value, ChartCached.FloatToStr(value, numericFormatter, acc));
|
return GetFormatterFunctionContent(labelIndex, value, ChartCached.FloatToStr(value, newNumericFormatter, acc));
|
||||||
}
|
}
|
||||||
return GetFormatterFunctionContent(labelIndex, value, ChartCached.NumberToStr(value, numericFormatter));
|
return GetFormatterFunctionContent(labelIndex, value, ChartCached.NumberToStr(value, newNumericFormatter));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var content = m_Formatter;
|
var content = m_Formatter;
|
||||||
FormatterHelper.ReplaceAxisLabelContent(ref content, numericFormatter, value);
|
FormatterHelper.ReplaceAxisLabelContent(ref content, newNumericFormatter, value);
|
||||||
return GetFormatterFunctionContent(labelIndex, value, content);
|
return GetFormatterFunctionContent(labelIndex, value, content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetFormatterDateTime(int labelIndex, double value, double minValue, double maxValue)
|
public string GetFormatterDateTime(int labelIndex, double value, double minValue, double maxValue)
|
||||||
{
|
{
|
||||||
var timestamp = (int) value;
|
var timestamp = (int)value;
|
||||||
var dateTime = DateTimeUtil.GetDateTime(timestamp);
|
var dateTime = DateTimeUtil.GetDateTime(timestamp);
|
||||||
var dateString = string.Empty;
|
var dateString = string.Empty;
|
||||||
if (string.IsNullOrEmpty(numericFormatter) || numericFormatter.Equals("f2"))
|
if (string.IsNullOrEmpty(numericFormatter) || numericFormatter.Equals("f2"))
|
||||||
|
|||||||
@@ -217,7 +217,9 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
var currAngle = serieData.context.halfAngle;
|
var currAngle = serieData.context.halfAngle;
|
||||||
var offset = labelLine.lineLength2 + serieData.labelObject.GetTextWidth() / 2;
|
var offset = labelLine.lineLength2 + serieData.labelObject.GetTextWidth() / 2;
|
||||||
if ((currAngle - serie.context.startAngle) % 360 > 180)
|
var angle = (currAngle - serie.context.startAngle) % 360;
|
||||||
|
var isLeft = angle > 180 || (angle == 0 && serieData.context.startAngle > 0);
|
||||||
|
if (isLeft)
|
||||||
return serieData.context.labelPosition + new Vector3(-offset, 0, 0);
|
return serieData.context.labelPosition + new Vector3(-offset, 0, 0);
|
||||||
else
|
else
|
||||||
return serieData.context.labelPosition + new Vector3(offset, 0, 0);
|
return serieData.context.labelPosition + new Vector3(offset, 0, 0);
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ namespace XCharts.Runtime
|
|||||||
[SerializeField] private List<Color> m_Colors = new List<Color>();
|
[SerializeField] private List<Color> m_Colors = new List<Color>();
|
||||||
[SerializeField][Since("v3.1.0")] protected ImageStyle m_Background = new ImageStyle() { show = false };
|
[SerializeField][Since("v3.1.0")] protected ImageStyle m_Background = new ImageStyle() { show = false };
|
||||||
[SerializeField][Since("v3.1.0")] protected Padding m_Padding = new Padding();
|
[SerializeField][Since("v3.1.0")] protected Padding m_Padding = new Padding();
|
||||||
|
[SerializeField][Since("v3.6.0")] private List<Vector3> m_Positions = new List<Vector3>();
|
||||||
|
|
||||||
public LegendContext context = new LegendContext();
|
public LegendContext context = new LegendContext();
|
||||||
|
|
||||||
@@ -257,6 +258,15 @@ namespace XCharts.Runtime
|
|||||||
set { if (value != null) { m_Colors = value; SetAllDirty(); } }
|
set { if (value != null) { m_Colors = value; SetAllDirty(); } }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// the custom positions of legend item.
|
||||||
|
/// |图例标记的自定义位置列表。
|
||||||
|
/// </summary>
|
||||||
|
public List<Vector3> positions
|
||||||
|
{
|
||||||
|
get { return m_Positions; }
|
||||||
|
set { if (value != null) { m_Positions = value; SetAllDirty(); } }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 图表是否需要刷新(图例组件不需要刷新图表)
|
/// 图表是否需要刷新(图例组件不需要刷新图表)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool vertsDirty { get { return false; } }
|
public override bool vertsDirty { get { return false; } }
|
||||||
@@ -428,6 +438,14 @@ namespace XCharts.Runtime
|
|||||||
return Color.white;
|
return Color.white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector3 GetPosition(int index, Vector3 defaultPos)
|
||||||
|
{
|
||||||
|
if (index >= 0 && index < m_Positions.Count)
|
||||||
|
return m_Positions[index];
|
||||||
|
else
|
||||||
|
return defaultPos;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Callback handling when parameters change.
|
/// Callback handling when parameters change.
|
||||||
/// |参数变更时的回调处理。
|
/// |参数变更时的回调处理。
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ namespace XCharts.Runtime
|
|||||||
chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
||||||
legend.gameObject = legendObject;
|
legend.gameObject = legendObject;
|
||||||
legendObject.hideFlags = chart.chartHideFlags;
|
legendObject.hideFlags = chart.chartHideFlags;
|
||||||
|
//ChartHelper.DestoryGameObjectByMatch(legendObject.transform, "_");
|
||||||
SeriesHelper.UpdateSerieNameList(chart, ref chart.m_LegendRealShowName);
|
SeriesHelper.UpdateSerieNameList(chart, ref chart.m_LegendRealShowName);
|
||||||
legend.context.background = ChartHelper.AddIcon("background", legendObject.transform, 0, 0);
|
legend.context.background = ChartHelper.AddIcon("background", legendObject.transform, 0, 0);
|
||||||
legend.context.background.transform.SetSiblingIndex(0);
|
legend.context.background.transform.SetSiblingIndex(0);
|
||||||
@@ -85,13 +86,14 @@ namespace XCharts.Runtime
|
|||||||
for (int i = 0; i < datas.Count; i++)
|
for (int i = 0; i < datas.Count; i++)
|
||||||
{
|
{
|
||||||
if (!SeriesHelper.IsLegalLegendName(datas[i])) continue;
|
if (!SeriesHelper.IsLegalLegendName(datas[i])) continue;
|
||||||
string legendName = GetFormatterContent(legend, i, datas[i]);
|
string legendName = datas[i];
|
||||||
|
var legendContent = GetFormatterContent(legend, i, datas[i]);
|
||||||
var readIndex = chart.m_LegendRealShowName.IndexOf(datas[i]);
|
var readIndex = chart.m_LegendRealShowName.IndexOf(datas[i]);
|
||||||
var active = chart.IsActiveByLegend(datas[i]);
|
var active = chart.IsActiveByLegend(datas[i]);
|
||||||
var bgColor = LegendHelper.GetIconColor(chart, legend, readIndex, datas[i], active);
|
var bgColor = LegendHelper.GetIconColor(chart, legend, readIndex, datas[i], active);
|
||||||
bgColor.a = legend.itemOpacity;
|
bgColor.a = legend.itemOpacity;
|
||||||
var item = LegendHelper.AddLegendItem(chart, legend, i, datas[i], legendObject.transform, chart.theme,
|
var item = LegendHelper.AddLegendItem(chart, legend, i, datas[i], legendObject.transform, chart.theme,
|
||||||
legendName, bgColor, active, readIndex);
|
legendContent, bgColor, active, readIndex);
|
||||||
legend.SetButton(legendName, item, totalLegend);
|
legend.SetButton(legendName, item, totalLegend);
|
||||||
ChartHelper.ClearEventListener(item.button.gameObject);
|
ChartHelper.ClearEventListener(item.button.gameObject);
|
||||||
ChartHelper.AddEventListener(item.button.gameObject, EventTriggerType.PointerDown, (data) =>
|
ChartHelper.AddEventListener(item.button.gameObject, EventTriggerType.PointerDown, (data) =>
|
||||||
@@ -154,7 +156,7 @@ namespace XCharts.Runtime
|
|||||||
var content = legend.formatter.Replace("{name}", category);
|
var content = legend.formatter.Replace("{name}", category);
|
||||||
content = content.Replace("{value}", category);
|
content = content.Replace("{value}", category);
|
||||||
var serie = chart.GetSerie(0);
|
var serie = chart.GetSerie(0);
|
||||||
FormatterHelper.ReplaceContent(ref content, dataIndex, legend.numericFormatter, serie, chart);
|
FormatterHelper.ReplaceContent(ref content, dataIndex, legend.numericFormatter, serie, chart, category);
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ namespace XCharts.Runtime
|
|||||||
var objPivot = new Vector2(0, 1);
|
var objPivot = new Vector2(0, 1);
|
||||||
var btnObj = ChartHelper.AddObject(objName, parent, objAnchorMin, objAnchorMax, objPivot, sizeDelta);
|
var btnObj = ChartHelper.AddObject(objName, parent, objAnchorMin, objAnchorMax, objPivot, sizeDelta);
|
||||||
var iconObj = ChartHelper.AddObject("icon", btnObj.transform, anchorMin, anchorMax, pivot, iconSizeDelta);
|
var iconObj = ChartHelper.AddObject("icon", btnObj.transform, anchorMin, anchorMax, pivot, iconSizeDelta);
|
||||||
var img = ChartHelper.GetOrAddComponent<Image>(btnObj);
|
var img = ChartHelper.EnsureComponent<Image>(btnObj);
|
||||||
img.color = Color.clear;
|
img.color = Color.clear;
|
||||||
img.raycastTarget = true;
|
img.raycastTarget = true;
|
||||||
ChartHelper.GetOrAddComponent<Button>(btnObj);
|
ChartHelper.EnsureComponent<Button>(btnObj);
|
||||||
ChartHelper.GetOrAddComponent<Image>(iconObj);
|
ChartHelper.EnsureComponent<Image>(iconObj);
|
||||||
|
|
||||||
var label = ChartHelper.AddChartLabel("content", btnObj.transform, legend.labelStyle, theme.legend,
|
var label = ChartHelper.AddChartLabel("content", btnObj.transform, legend.labelStyle, theme.legend,
|
||||||
content, contentColor, TextAnchor.MiddleLeft);
|
content, contentColor, TextAnchor.MiddleLeft);
|
||||||
@@ -156,6 +156,7 @@ namespace XCharts.Runtime
|
|||||||
var currHeight = 0f;
|
var currHeight = 0f;
|
||||||
var offsetX = 0f;
|
var offsetX = 0f;
|
||||||
var row = 0;
|
var row = 0;
|
||||||
|
var index = 0;
|
||||||
foreach (var kv in legend.context.buttonList)
|
foreach (var kv in legend.context.buttonList)
|
||||||
{
|
{
|
||||||
var item = kv.Value;
|
var item = kv.Value;
|
||||||
@@ -165,7 +166,7 @@ namespace XCharts.Runtime
|
|||||||
offsetX += legend.context.eachWidthDict[row];
|
offsetX += legend.context.eachWidthDict[row];
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
item.SetPosition(new Vector3(startX + offsetX, startY - currHeight));
|
item.SetPosition(legend.GetPosition(index++, new Vector3(startX + offsetX, startY - currHeight)));
|
||||||
currHeight += item.height + legend.itemGap;
|
currHeight += item.height + legend.itemGap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,6 +174,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
var currWidth = 0f;
|
var currWidth = 0f;
|
||||||
var offsetY = 0f;
|
var offsetY = 0f;
|
||||||
|
var index = 0;
|
||||||
foreach (var kv in legend.context.buttonList)
|
foreach (var kv in legend.context.buttonList)
|
||||||
{
|
{
|
||||||
var item = kv.Value;
|
var item = kv.Value;
|
||||||
@@ -181,7 +183,7 @@ namespace XCharts.Runtime
|
|||||||
currWidth = 0;
|
currWidth = 0;
|
||||||
offsetY += legend.context.eachHeight;
|
offsetY += legend.context.eachHeight;
|
||||||
}
|
}
|
||||||
item.SetPosition(new Vector3(startX + currWidth, startY - offsetY));
|
item.SetPosition(legend.GetPosition(index++, new Vector3(startX + currWidth, startY - offsetY)));
|
||||||
currWidth += item.width + legend.itemGap;
|
currWidth += item.width + legend.itemGap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ namespace XCharts.Runtime
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
[Since("v3.2.0")]
|
[Since("v3.2.0")]
|
||||||
public class BlurStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
|
public class BlurStyle : StateStyle, ISerieComponent, ISerieDataComponent
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ namespace XCharts.Runtime
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
[Since("v3.2.0")]
|
[Since("v3.2.0")]
|
||||||
public class EmphasisStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
|
public class EmphasisStyle : StateStyle, ISerieComponent, ISerieDataComponent
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// focus type.
|
/// focus type.
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ namespace XCharts.Runtime
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
[Since("v3.2.0")]
|
[Since("v3.2.0")]
|
||||||
public class SelectStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
|
public class SelectStyle : StateStyle, ISerieComponent, ISerieDataComponent
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ namespace XCharts.Runtime
|
|||||||
/// |标题相关设置。
|
/// |标题相关设置。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class TitleStyle : LabelStyle, ISerieDataComponent, ISerieExtraComponent
|
public class TitleStyle : LabelStyle, ISerieDataComponent, ISerieComponent
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ namespace XCharts.Runtime
|
|||||||
/// {c}为当前所指示或index为0的serie的y维(dimesion为1)的数值。<br/>
|
/// {c}为当前所指示或index为0的serie的y维(dimesion为1)的数值。<br/>
|
||||||
/// {d}为当前所指示或index为0的serie的y维(dimesion为1)百分比值,注意不带%号。<br/>
|
/// {d}为当前所指示或index为0的serie的y维(dimesion为1)百分比值,注意不带%号。<br/>
|
||||||
/// {e}为当前所指示或index为0的serie的数据项serieData的name。<br/>
|
/// {e}为当前所指示或index为0的serie的数据项serieData的name。<br/>
|
||||||
|
/// {h}为当前所指示或index为0的serie的数据项serieData的十六进制颜色值。<br/>
|
||||||
/// {f}为数据总和。<br/>
|
/// {f}为数据总和。<br/>
|
||||||
/// {g}为数据总个数。<br/>
|
/// {g}为数据总个数。<br/>
|
||||||
/// {.1}表示指定index为1的serie对应颜色的圆点。<br/>
|
/// {.1}表示指定index为1的serie对应颜色的圆点。<br/>
|
||||||
@@ -224,6 +225,7 @@ namespace XCharts.Runtime
|
|||||||
/// {e}为当前所指示的serie或数据项的数据项serieData的name。<br/>
|
/// {e}为当前所指示的serie或数据项的数据项serieData的name。<br/>
|
||||||
/// {f}为当前所指示的serie的默认维度的数据总和。<br/>
|
/// {f}为当前所指示的serie的默认维度的数据总和。<br/>
|
||||||
/// {g}为当前所指示的serie的数据总个数。<br/>
|
/// {g}为当前所指示的serie的数据总个数。<br/>
|
||||||
|
/// {h}为当前所指示的serie的十六进制颜色值。<br/>
|
||||||
/// {c0}表示当前数据项维度为0的数据。<br/>
|
/// {c0}表示当前数据项维度为0的数据。<br/>
|
||||||
/// {c1}表示当前数据项维度为1的数据。<br/>
|
/// {c1}表示当前数据项维度为1的数据。<br/>
|
||||||
/// {d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。<br/>
|
/// {d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。<br/>
|
||||||
|
|||||||
@@ -217,19 +217,19 @@ namespace XCharts.Runtime
|
|||||||
view.gameObject.transform.localPosition = Vector3.zero;
|
view.gameObject.transform.localPosition = Vector3.zero;
|
||||||
view.transform = view.gameObject.transform;
|
view.transform = view.gameObject.transform;
|
||||||
|
|
||||||
view.background = ChartHelper.GetOrAddComponent<Image>(view.gameObject);
|
view.background = ChartHelper.EnsureComponent<Image>(view.gameObject);
|
||||||
view.background.sprite = tooltip.backgroundImage;
|
view.background.sprite = tooltip.backgroundImage;
|
||||||
view.background.type = tooltip.backgroundType;
|
view.background.type = tooltip.backgroundType;
|
||||||
view.background.color = ChartHelper.IsClearColor(tooltip.backgroundColor) ?
|
view.background.color = ChartHelper.IsClearColor(tooltip.backgroundColor) ?
|
||||||
Color.white : tooltip.backgroundColor;
|
Color.white : tooltip.backgroundColor;
|
||||||
|
|
||||||
view.border = ChartHelper.GetOrAddComponent<Outline>(view.gameObject);
|
view.border = ChartHelper.EnsureComponent<Outline>(view.gameObject);
|
||||||
view.border.enabled = tooltip.borderWidth > 0;
|
view.border.enabled = tooltip.borderWidth > 0;
|
||||||
view.border.useGraphicAlpha = false;
|
view.border.useGraphicAlpha = false;
|
||||||
view.border.effectColor = tooltip.borderColor;
|
view.border.effectColor = tooltip.borderColor;
|
||||||
view.border.effectDistance = new Vector2(tooltip.borderWidth, -tooltip.borderWidth);
|
view.border.effectDistance = new Vector2(tooltip.borderWidth, -tooltip.borderWidth);
|
||||||
|
|
||||||
view.layout = ChartHelper.GetOrAddComponent<VerticalLayoutGroup>(view.gameObject);
|
view.layout = ChartHelper.EnsureComponent<VerticalLayoutGroup>(view.gameObject);
|
||||||
view.layout.childControlHeight = false;
|
view.layout.childControlHeight = false;
|
||||||
view.layout.childControlWidth = false;
|
view.layout.childControlWidth = false;
|
||||||
view.layout.childForceExpandHeight = false;
|
view.layout.childForceExpandHeight = false;
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ using UnityEngine;
|
|||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using XUGL;
|
using XUGL;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
[UnityEngine.Scripting.Preserve]
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace XCharts.Runtime
|
|||||||
public static class FormatterHelper
|
public static class FormatterHelper
|
||||||
{
|
{
|
||||||
public const string PH_NN = "\n";
|
public const string PH_NN = "\n";
|
||||||
private static Regex s_Regex = new Regex(@"{([a-g|.]\d*)(:\d+(-\d+)?)?(:[c-g|x|p|r]\d*|:0\.#*)?}", RegexOptions.IgnoreCase);
|
private static Regex s_Regex = new Regex(@"{([a-h|.]\d*)(:\d+(-\d+)?)?(:[c-g|x|p|r]\d*|:0\.#*)?}", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexSub = new Regex(@"(0\.#*)|(\d+-\d+)|(\w+)|(\.)", RegexOptions.IgnoreCase);
|
private static Regex s_RegexSub = new Regex(@"(0\.#*)|(\d+-\d+)|(\w+)|(\.)", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexN = new Regex(@"^\d+", RegexOptions.IgnoreCase);
|
private static Regex s_RegexN = new Regex(@"^\d+", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexN_N = new Regex(@"\d+-\d+", RegexOptions.IgnoreCase);
|
private static Regex s_RegexN_N = new Regex(@"\d+-\d+", RegexOptions.IgnoreCase);
|
||||||
@@ -16,8 +16,8 @@ namespace XCharts.Runtime
|
|||||||
private static Regex s_RegexNewLine = new Regex(@"[\\|/]+n|</br>|<br>|<br/>", RegexOptions.IgnoreCase);
|
private static Regex s_RegexNewLine = new Regex(@"[\\|/]+n|</br>|<br>|<br/>", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexForAxisLabel = new Regex(@"{value(:[c-g|x|p|r]\d*)?}", RegexOptions.IgnoreCase);
|
private static Regex s_RegexForAxisLabel = new Regex(@"{value(:[c-g|x|p|r]\d*)?}", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexSubForAxisLabel = new Regex(@"(value)|([c-g|x|p|r]\d*)", RegexOptions.IgnoreCase);
|
private static Regex s_RegexSubForAxisLabel = new Regex(@"(value)|([c-g|x|p|r]\d*)", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexForSerieLabel = new Regex(@"{[a-g|\.]\d*(:[c-g|x|p|r]\d*)?}", RegexOptions.IgnoreCase);
|
private static Regex s_RegexForSerieLabel = new Regex(@"{[a-h|\.]\d*(:[c-g|x|p|r]\d*)?}", RegexOptions.IgnoreCase);
|
||||||
private static Regex s_RegexSubForSerieLabel = new Regex(@"(\.)|([a-g]\d*)|([c-g|x|p|r]\d*)", RegexOptions.IgnoreCase);
|
private static Regex s_RegexSubForSerieLabel = new Regex(@"(\.)|([a-h]\d*)|([c-g|x|p|r]\d*)", RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
public static bool NeedFormat(string content)
|
public static bool NeedFormat(string content)
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 替换字符串中的通配符,支持的通配符有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。
|
/// 替换字符串中的通配符,支持的通配符有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}、{h}。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="content">要替换的字符串</param>
|
/// <param name="content">要替换的字符串</param>
|
||||||
/// <param name="dataIndex">选中的数据项serieData索引</param>
|
/// <param name="dataIndex">选中的数据项serieData索引</param>
|
||||||
@@ -34,10 +34,9 @@ namespace XCharts.Runtime
|
|||||||
/// <param name="series">所有serie</param>
|
/// <param name="series">所有serie</param>
|
||||||
/// <param name="theme">用来获取指定index的颜色</param>
|
/// <param name="theme">用来获取指定index的颜色</param>
|
||||||
/// <param name="category">选中的类目,一般用在折线图和柱状图</param>
|
/// <param name="category">选中的类目,一般用在折线图和柱状图</param>
|
||||||
/// <param name="dataZoom">dataZoom</param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool ReplaceContent(ref string content, int dataIndex, string numericFormatter, Serie serie,
|
public static bool ReplaceContent(ref string content, int dataIndex, string numericFormatter, Serie serie,
|
||||||
BaseChart chart, DataZoom dataZoom = null)
|
BaseChart chart, string colorName = null)
|
||||||
{
|
{
|
||||||
var foundDot = false;
|
var foundDot = false;
|
||||||
var mc = s_Regex.Matches(content);
|
var mc = s_Regex.Matches(content);
|
||||||
@@ -64,16 +63,26 @@ namespace XCharts.Runtime
|
|||||||
targetIndex = 0;
|
targetIndex = 0;
|
||||||
}
|
}
|
||||||
if (serie == null) continue;
|
if (serie == null) continue;
|
||||||
if (p == '.')
|
if (p == '.' || p == 'h' || p == 'H')
|
||||||
{
|
{
|
||||||
var bIndex = targetIndex;
|
var bIndex = dataIndex;
|
||||||
if (argsCount >= 2)
|
if (argsCount >= 2)
|
||||||
{
|
{
|
||||||
var args1Str = args[1].ToString();
|
var args1Str = args[1].ToString();
|
||||||
if (s_RegexN.IsMatch(args1Str)) bIndex = int.Parse(args1Str);
|
if (s_RegexN.IsMatch(args1Str)) bIndex = int.Parse(args1Str);
|
||||||
}
|
}
|
||||||
content = content.Replace(old, ChartCached.ColorToDotStr(chart.theme.GetColor(bIndex)));
|
var color = string.IsNullOrEmpty(colorName) ?
|
||||||
foundDot = true;
|
(Color)chart.GetMarkColor(serie, serie.GetSerieData(bIndex)) :
|
||||||
|
SeriesHelper.GetNameColor(chart, bIndex, colorName);
|
||||||
|
if (p == '.')
|
||||||
|
{
|
||||||
|
content = content.Replace(old, ChartCached.ColorToDotStr(color));
|
||||||
|
foundDot = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
content = content.Replace(old, "#" + ChartCached.ColorToStr(color));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (p == 'a' || p == 'A')
|
else if (p == 'a' || p == 'A')
|
||||||
{
|
{
|
||||||
@@ -90,15 +99,15 @@ namespace XCharts.Runtime
|
|||||||
var args1Str = args[1].ToString();
|
var args1Str = args[1].ToString();
|
||||||
if (s_RegexN.IsMatch(args1Str)) bIndex = int.Parse(args1Str);
|
if (s_RegexN.IsMatch(args1Str)) bIndex = int.Parse(args1Str);
|
||||||
}
|
}
|
||||||
var needCategory = (p != 'e' && p != 'E') && (serie is Line || serie is Bar);
|
var needCategory = (p != 'e' && p != 'E') && serie.defaultColorBy != SerieColorBy.Data;
|
||||||
if (needCategory)
|
if (needCategory)
|
||||||
{
|
{
|
||||||
var category = chart.GetTooltipCategory(dataIndex, serie, dataZoom);
|
var category = chart.GetTooltipCategory(dataIndex, serie);
|
||||||
content = content.Replace(old, category);
|
content = content.Replace(old, category);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var serieData = serie.GetSerieData(bIndex, dataZoom);
|
var serieData = serie.GetSerieData(bIndex);
|
||||||
content = content.Replace(old, serieData.name);
|
content = content.Replace(old, serieData.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,7 +153,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
numericFormatter = SerieHelper.GetNumericFormatter(serie, serie.GetSerieData(bIndex), "");
|
numericFormatter = SerieHelper.GetNumericFormatter(serie, serie.GetSerieData(bIndex), "");
|
||||||
}
|
}
|
||||||
var value = serie.GetData(bIndex, dimensionIndex, dataZoom);
|
var value = serie.GetData(bIndex, dimensionIndex);
|
||||||
if (isPercent)
|
if (isPercent)
|
||||||
{
|
{
|
||||||
var total = serie.GetDataTotal(dimensionIndex, serie.GetSerieData(bIndex));
|
var total = serie.GetDataTotal(dimensionIndex, serie.GetSerieData(bIndex));
|
||||||
@@ -225,6 +234,10 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
content = content.Replace(old, ChartCached.NumberToStr(dataCount, numericFormatter));
|
content = content.Replace(old, ChartCached.NumberToStr(dataCount, numericFormatter));
|
||||||
}
|
}
|
||||||
|
else if (p == 'h' || p == 'H')
|
||||||
|
{
|
||||||
|
content = content.Replace(old, "#" + ChartCached.ColorToStr(color));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
content = TrimAndReplaceLine(content);
|
content = TrimAndReplaceLine(content);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,36 +3,40 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The attribute for serie component.
|
||||||
|
/// |可添加到Serie的组件。
|
||||||
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||||
public sealed class SerieExtraComponentAttribute : Attribute
|
public sealed class SerieComponentAttribute : Attribute
|
||||||
{
|
{
|
||||||
public readonly List<Type> types = new List<Type>();
|
public readonly List<Type> types = new List<Type>();
|
||||||
|
|
||||||
public SerieExtraComponentAttribute()
|
public SerieComponentAttribute()
|
||||||
{ }
|
{ }
|
||||||
public SerieExtraComponentAttribute(Type type1)
|
public SerieComponentAttribute(Type type1)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
}
|
}
|
||||||
public SerieExtraComponentAttribute(Type type1, Type type2)
|
public SerieComponentAttribute(Type type1, Type type2)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
}
|
}
|
||||||
public SerieExtraComponentAttribute(Type type1, Type type2, Type type3)
|
public SerieComponentAttribute(Type type1, Type type2, Type type3)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
AddType(type3);
|
AddType(type3);
|
||||||
}
|
}
|
||||||
public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)
|
public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
AddType(type3);
|
AddType(type3);
|
||||||
AddType(type4);
|
AddType(type4);
|
||||||
}
|
}
|
||||||
public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)
|
public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
@@ -40,7 +44,7 @@ namespace XCharts.Runtime
|
|||||||
AddType(type4);
|
AddType(type4);
|
||||||
AddType(type5);
|
AddType(type5);
|
||||||
}
|
}
|
||||||
public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)
|
public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
@@ -49,7 +53,7 @@ namespace XCharts.Runtime
|
|||||||
AddType(type5);
|
AddType(type5);
|
||||||
AddType(type6);
|
AddType(type6);
|
||||||
}
|
}
|
||||||
public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)
|
public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
@@ -67,7 +71,7 @@ namespace XCharts.Runtime
|
|||||||
types.Add(type);
|
types.Add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Contains<T>() where T : ISerieExtraComponent
|
public bool Contains<T>() where T : ISerieComponent
|
||||||
{
|
{
|
||||||
return Contains(typeof(T));
|
return Contains(typeof(T));
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,11 @@ using System;
|
|||||||
|
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What serie can convert to me
|
/// The attribute for which serie types can be converted to.
|
||||||
|
/// |可转化为哪些Serie类型。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||||
public sealed class SerieConvertAttribute : Attribute
|
public sealed class SerieConvertAttribute : Attribute
|
||||||
{
|
{
|
||||||
public readonly Type type0;
|
public readonly Type type0;
|
||||||
|
|||||||
@@ -3,36 +3,41 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The attribute for serie data component.
|
||||||
|
/// |可添加到SerieData的组件。
|
||||||
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||||
public sealed class SerieDataExtraComponentAttribute : Attribute
|
public sealed class SerieDataComponentAttribute : Attribute
|
||||||
{
|
{
|
||||||
public readonly List<Type> types = new List<Type>();
|
public readonly List<Type> types = new List<Type>();
|
||||||
|
|
||||||
public SerieDataExtraComponentAttribute()
|
public SerieDataComponentAttribute()
|
||||||
{ }
|
{
|
||||||
public SerieDataExtraComponentAttribute(Type type1)
|
}
|
||||||
|
public SerieDataComponentAttribute(Type type1)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
}
|
}
|
||||||
public SerieDataExtraComponentAttribute(Type type1, Type type2)
|
public SerieDataComponentAttribute(Type type1, Type type2)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
}
|
}
|
||||||
public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)
|
public SerieDataComponentAttribute(Type type1, Type type2, Type type3)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
AddType(type3);
|
AddType(type3);
|
||||||
}
|
}
|
||||||
public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)
|
public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
AddType(type3);
|
AddType(type3);
|
||||||
AddType(type4);
|
AddType(type4);
|
||||||
}
|
}
|
||||||
public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)
|
public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
@@ -40,7 +45,7 @@ namespace XCharts.Runtime
|
|||||||
AddType(type4);
|
AddType(type4);
|
||||||
AddType(type5);
|
AddType(type5);
|
||||||
}
|
}
|
||||||
public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)
|
public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
@@ -49,7 +54,7 @@ namespace XCharts.Runtime
|
|||||||
AddType(type5);
|
AddType(type5);
|
||||||
AddType(type6);
|
AddType(type6);
|
||||||
}
|
}
|
||||||
public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)
|
public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)
|
||||||
{
|
{
|
||||||
AddType(type1);
|
AddType(type1);
|
||||||
AddType(type2);
|
AddType(type2);
|
||||||
@@ -67,7 +72,7 @@ namespace XCharts.Runtime
|
|||||||
types.Add(type);
|
types.Add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Contains<T>() where T : ISerieExtraComponent
|
public bool Contains<T>() where T : ISerieComponent
|
||||||
{
|
{
|
||||||
return Contains(typeof(T));
|
return Contains(typeof(T));
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,15 @@ namespace XCharts.Runtime
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Vector3 chartPosition { get { return m_ChartPosition; } }
|
public Vector3 chartPosition { get { return m_ChartPosition; } }
|
||||||
public Rect chartRect { get { return m_ChartRect; } }
|
public Rect chartRect { get { return m_ChartRect; } }
|
||||||
|
/// <summary>
|
||||||
|
/// The callback function of chart init.
|
||||||
|
/// |图表的初始化完成回调。
|
||||||
|
/// </summary>
|
||||||
public Action onInit { set { m_OnInit = value; } }
|
public Action onInit { set { m_OnInit = value; } }
|
||||||
|
/// <summary>
|
||||||
|
/// The callback function of chart update.
|
||||||
|
/// |图表的Update回调。
|
||||||
|
/// </summary>
|
||||||
public Action onUpdate { set { m_OnUpdate = value; } }
|
public Action onUpdate { set { m_OnUpdate = value; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义绘制回调。在绘制Serie前调用。
|
/// 自定义绘制回调。在绘制Serie前调用。
|
||||||
@@ -96,21 +104,48 @@ namespace XCharts.Runtime
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public CustomDrawGaugePointerFunction customDrawGaugePointerFunction { set { m_CustomDrawGaugePointerFunction = value; } get { return m_CustomDrawGaugePointerFunction; } }
|
public CustomDrawGaugePointerFunction customDrawGaugePointerFunction { set { m_CustomDrawGaugePointerFunction = value; } get { return m_CustomDrawGaugePointerFunction; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// the callback function of pointer click serie.
|
||||||
|
/// |鼠标点击Serie回调。
|
||||||
|
/// </summary>
|
||||||
|
[Since("v3.6.0")]
|
||||||
|
public Action<SerieEventData> onSerieClick { set { m_OnSerieClick = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieClick; } }
|
||||||
|
/// <summary>
|
||||||
|
/// the callback function of pointer down serie.
|
||||||
|
/// |鼠标按下Serie回调。
|
||||||
|
/// </summary>
|
||||||
|
[Since("v3.6.0")]
|
||||||
|
public Action<SerieEventData> onSerieDown { set { m_OnSerieDown = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieDown; } }
|
||||||
|
/// <summary>
|
||||||
|
/// the callback function of pointer enter serie.
|
||||||
|
/// |鼠标进入Serie回调。
|
||||||
|
/// </summary>
|
||||||
|
[Since("v3.6.0")]
|
||||||
|
public Action<SerieEventData> onSerieEnter { set { m_OnSerieEnter = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieEnter; } }
|
||||||
|
/// <summary>
|
||||||
|
/// the callback function of pointer exit serie.
|
||||||
|
/// |鼠标离开Serie回调。
|
||||||
|
/// </summary>
|
||||||
|
[Since("v3.6.0")]
|
||||||
|
public Action<SerieEventData> onSerieExit { set { m_OnSerieExit = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieExit; } }
|
||||||
|
/// <summary>
|
||||||
/// the callback function of pointer click pie area.
|
/// the callback function of pointer click pie area.
|
||||||
/// |点击饼图区域回调。参数:PointerEventData,SerieIndex,SerieDataIndex
|
/// |点击饼图区域回调。参数:PointerEventData,SerieIndex,SerieDataIndex
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action<PointerEventData, int, int> onPointerClickPie { set { m_OnPointerClickPie = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerClickPie; } }
|
[Obsolete("Use \"onSerieClick\" instead", true)]
|
||||||
|
public Action<PointerEventData, int, int> onPointerClickPie { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the callback function of pointer enter pie area.
|
/// the callback function of pointer enter pie area.
|
||||||
/// |鼠标进入和离开饼图区域回调,SerieDataIndex为-1时表示离开。参数:PointerEventData,SerieIndex,SerieDataIndex
|
/// |鼠标进入和离开饼图区域回调,SerieDataIndex为-1时表示离开。参数:PointerEventData,SerieIndex,SerieDataIndex
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Since("v3.3.0")]
|
[Since("v3.3.0")]
|
||||||
|
[Obsolete("Use \"onSerieEnter\" instead", true)]
|
||||||
public Action<int, int> onPointerEnterPie { set { m_OnPointerEnterPie = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerEnterPie; } }
|
public Action<int, int> onPointerEnterPie { set { m_OnPointerEnterPie = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerEnterPie; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the callback function of click bar.
|
/// the callback function of click bar.
|
||||||
/// |点击柱形图柱条回调。参数:eventData, dataIndex
|
/// |点击柱形图柱条回调。参数:eventData, dataIndex
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action<PointerEventData, int> onPointerClickBar { set { m_OnPointerClickBar = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerClickBar; } }
|
[Obsolete("Use \"onSerieClick\" instead", true)]
|
||||||
|
public Action<PointerEventData, int> onPointerClickBar { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 坐标轴变更数据索引时回调。参数:axis, dataIndex/dataValue
|
/// 坐标轴变更数据索引时回调。参数:axis, dataIndex/dataValue
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -464,7 +499,7 @@ namespace XCharts.Runtime
|
|||||||
/// 转换X轴和Y轴的配置
|
/// 转换X轴和Y轴的配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="index">坐标轴索引,0或1</param>
|
/// <param name="index">坐标轴索引,0或1</param>
|
||||||
public void CovertXYAxis(int index)
|
public void ConvertXYAxis(int index)
|
||||||
{
|
{
|
||||||
List<MainComponent> m_XAxes;
|
List<MainComponent> m_XAxes;
|
||||||
List<MainComponent> m_YAxes;
|
List<MainComponent> m_YAxes;
|
||||||
@@ -601,13 +636,14 @@ namespace XCharts.Runtime
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Color32 GetMarkColor(Serie serie, SerieData serieData)
|
public Color32 GetMarkColor(Serie serie, SerieData serieData)
|
||||||
{
|
{
|
||||||
if (ChartHelper.IsClearColor(serie.markColor))
|
var itemStyle = SerieHelper.GetItemStyle(serie, serieData);
|
||||||
|
if (ChartHelper.IsClearColor(itemStyle.markColor))
|
||||||
{
|
{
|
||||||
return GetItemColor(serie, serieData);
|
return GetItemColor(serie, serieData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return serie.markColor;
|
return itemStyle.markColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -631,15 +667,5 @@ namespace XCharts.Runtime
|
|||||||
SerieHelper.GetItemColor(out color, out toColor, serie, null, m_Theme);
|
SerieHelper.GetItemColor(out color, out toColor, serie, null, m_Theme);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 保存图表为图片。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="imageType">type of image: png, jpg, exr</param>
|
|
||||||
/// <param name="savePath">save path</param>
|
|
||||||
public void SaveAsImage(string imageType = "png", string savePath = "")
|
|
||||||
{
|
|
||||||
StartCoroutine(SaveAsImageSync(imageType, savePath));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
public T AddChartComponent<T>() where T : MainComponent
|
public T AddChartComponent<T>() where T : MainComponent
|
||||||
{
|
{
|
||||||
return (T) AddChartComponent(typeof(T));
|
return (T)AddChartComponent(typeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
public T AddChartComponentWhenNoExist<T>() where T : MainComponent
|
public T AddChartComponentWhenNoExist<T>() where T : MainComponent
|
||||||
@@ -118,7 +118,7 @@ namespace XCharts.Runtime
|
|||||||
if (attrubte.handler == null)
|
if (attrubte.handler == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var handler = (MainComponentHandler) Activator.CreateInstance(attrubte.handler);
|
var handler = (MainComponentHandler)Activator.CreateInstance(attrubte.handler);
|
||||||
handler.attribute = attrubte;
|
handler.attribute = attrubte;
|
||||||
handler.chart = this;
|
handler.chart = this;
|
||||||
handler.SetComponent(component);
|
handler.SetComponent(component);
|
||||||
@@ -221,9 +221,9 @@ namespace XCharts.Runtime
|
|||||||
return GetChartComponentNum(typeof(T));
|
return GetChartComponentNum(typeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<MainComponent> list;
|
||||||
public int GetChartComponentNum(Type type)
|
public int GetChartComponentNum(Type type)
|
||||||
{
|
{
|
||||||
List<MainComponent> list;
|
|
||||||
if (m_ComponentMaps.TryGetValue(type, out list))
|
if (m_ComponentMaps.TryGetValue(type, out list))
|
||||||
return list.Count;
|
return list.Count;
|
||||||
else
|
else
|
||||||
@@ -245,6 +245,7 @@ namespace XCharts.Runtime
|
|||||||
return m_ComponentMaps[typeof(T)];
|
return m_ComponentMaps[typeof(T)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("'GetOrAddChartComponent' is obsolete, Use 'EnsureChartComponent' instead.")]
|
||||||
public T GetOrAddChartComponent<T>() where T : MainComponent
|
public T GetOrAddChartComponent<T>() where T : MainComponent
|
||||||
{
|
{
|
||||||
var component = GetChartComponent<T>();
|
var component = GetChartComponent<T>();
|
||||||
@@ -254,6 +255,23 @@ namespace XCharts.Runtime
|
|||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ensure the chart has the component, if not, add it.
|
||||||
|
/// Note: it may fail to add.
|
||||||
|
/// |确保图表有该组件,如果没有则添加。注意:有可能添加不成功。
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <returns>component, or null if add failed.</returns>
|
||||||
|
[Since("v3.6.0")]
|
||||||
|
public T EnsureChartComponent<T>() where T : MainComponent
|
||||||
|
{
|
||||||
|
var component = GetChartComponent<T>();
|
||||||
|
if (component == null)
|
||||||
|
return AddChartComponent<T>();
|
||||||
|
else
|
||||||
|
return component;
|
||||||
|
}
|
||||||
|
|
||||||
public bool TryGetChartComponent<T>(out T component, int index = 0)
|
public bool TryGetChartComponent<T>(out T component, int index = 0)
|
||||||
where T : MainComponent
|
where T : MainComponent
|
||||||
{
|
{
|
||||||
@@ -262,7 +280,7 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
if (com is T && com.index == index)
|
if (com is T && com.index == index)
|
||||||
{
|
{
|
||||||
component = (T) com;
|
component = (T)com;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -417,11 +435,11 @@ namespace XCharts.Runtime
|
|||||||
var yAxis = GetChartComponent<YAxis>();
|
var yAxis = GetChartComponent<YAxis>();
|
||||||
if (yAxis.IsCategory())
|
if (yAxis.IsCategory())
|
||||||
{
|
{
|
||||||
return yAxis.GetData((int) yAxis.context.pointerValue, dataZoom);
|
return yAxis.GetData((int)yAxis.context.pointerValue, dataZoom);
|
||||||
}
|
}
|
||||||
else if (xAxis.IsCategory())
|
else if (xAxis.IsCategory())
|
||||||
{
|
{
|
||||||
return xAxis.GetData((int) xAxis.context.pointerValue, dataZoom);
|
return xAxis.GetData((int)xAxis.context.pointerValue, dataZoom);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -431,11 +449,11 @@ namespace XCharts.Runtime
|
|||||||
var yAxis = GetChartComponent<YAxis>(serie.yAxisIndex);
|
var yAxis = GetChartComponent<YAxis>(serie.yAxisIndex);
|
||||||
if (yAxis.IsCategory())
|
if (yAxis.IsCategory())
|
||||||
{
|
{
|
||||||
return yAxis.GetData((int) yAxis.context.pointerValue, dataZoom);
|
return yAxis.GetData((int)yAxis.context.pointerValue, dataZoom);
|
||||||
}
|
}
|
||||||
else if (xAxis.IsCategory())
|
else if (xAxis.IsCategory())
|
||||||
{
|
{
|
||||||
return xAxis.GetData((int) xAxis.context.pointerValue, dataZoom);
|
return xAxis.GetData((int)xAxis.context.pointerValue, dataZoom);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,23 +179,23 @@ namespace XCharts.Runtime
|
|||||||
RefreshChart();
|
RefreshChart();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CovertSerie<T>(Serie serie) where T : Serie
|
public bool ConvertSerie<T>(Serie serie) where T : Serie
|
||||||
{
|
{
|
||||||
return CovertSerie(serie, typeof(T));
|
return ConvertSerie(serie, typeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CovertSerie(Serie serie, Type type)
|
public bool ConvertSerie(Serie serie, Type type)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var newSerie = type.InvokeMember("CovertSerie",
|
var newSerie = type.InvokeMember("ConvertSerie",
|
||||||
BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public, null, null,
|
BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public, null, null,
|
||||||
new object[] { serie }) as Serie;
|
new object[] { serie }) as Serie;
|
||||||
return ReplaceSerie(serie, newSerie);
|
return ReplaceSerie(serie, newSerie);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
Debug.LogError(string.Format("CovertSerie Failed: can't found {0}.CovertSerie(Serie serie)", type.Name));
|
Debug.LogError(string.Format("ConvertSerie Failed: can't found {0}.ConvertSerie(Serie serie)", type.Name));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -647,6 +647,7 @@ namespace XCharts.Runtime
|
|||||||
public void SetSerieActive(Serie serie, bool active)
|
public void SetSerieActive(Serie serie, bool active)
|
||||||
{
|
{
|
||||||
serie.show = active;
|
serie.show = active;
|
||||||
|
serie.RefreshLabel();
|
||||||
serie.AnimationReset();
|
serie.AnimationReset();
|
||||||
if (active) serie.AnimationFadeIn();
|
if (active) serie.AnimationFadeIn();
|
||||||
UpdateLegendColor(serie.serieName, active);
|
UpdateLegendColor(serie.serieName, active);
|
||||||
|
|||||||
@@ -11,13 +11,14 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
[AddComponentMenu("XCharts/EmptyChart", 10)]
|
[AddComponentMenu("XCharts/EmptyChart", 10)]
|
||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform),typeof(CanvasRenderer))]
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public partial class BaseChart : BaseGraph, ISerializationCallbackReceiver
|
public partial class BaseChart : BaseGraph, ISerializationCallbackReceiver
|
||||||
{
|
{
|
||||||
[SerializeField] protected string m_ChartName;
|
[SerializeField] protected string m_ChartName;
|
||||||
[SerializeField] protected ThemeStyle m_Theme = new ThemeStyle();
|
[SerializeField] protected ThemeStyle m_Theme = new ThemeStyle();
|
||||||
[SerializeField] protected Settings m_Settings;
|
[SerializeField] protected Settings m_Settings;
|
||||||
|
[SerializeField] protected DebugInfo m_DebugInfo = new DebugInfo();
|
||||||
|
|
||||||
#pragma warning disable 0414
|
#pragma warning disable 0414
|
||||||
[SerializeField][ListForComponent(typeof(AngleAxis))] private List<AngleAxis> m_AngleAxes = new List<AngleAxis>();
|
[SerializeField][ListForComponent(typeof(AngleAxis))] private List<AngleAxis> m_AngleAxes = new List<AngleAxis>();
|
||||||
@@ -67,6 +68,8 @@ namespace XCharts.Runtime
|
|||||||
public List<MainComponent> components { get { return m_Components; } }
|
public List<MainComponent> components { get { return m_Components; } }
|
||||||
|
|
||||||
public List<Serie> series { get { return m_Series; } }
|
public List<Serie> series { get { return m_Series; } }
|
||||||
|
public DebugInfo debug { get { return m_DebugInfo; } }
|
||||||
|
public override HideFlags chartHideFlags { get { return m_DebugInfo.showAllChartObject ? HideFlags.None : HideFlags.HideInHierarchy; } }
|
||||||
|
|
||||||
protected float m_ChartWidth;
|
protected float m_ChartWidth;
|
||||||
protected float m_ChartHeight;
|
protected float m_ChartHeight;
|
||||||
@@ -86,9 +89,11 @@ namespace XCharts.Runtime
|
|||||||
protected Action<VertexHelper> m_OnDrawTop;
|
protected Action<VertexHelper> m_OnDrawTop;
|
||||||
protected Action<VertexHelper, Serie> m_OnDrawSerieBefore;
|
protected Action<VertexHelper, Serie> m_OnDrawSerieBefore;
|
||||||
protected Action<VertexHelper, Serie> m_OnDrawSerieAfter;
|
protected Action<VertexHelper, Serie> m_OnDrawSerieAfter;
|
||||||
protected Action<PointerEventData, int, int> m_OnPointerClickPie;
|
protected Action<SerieEventData> m_OnSerieClick;
|
||||||
|
protected Action<SerieEventData> m_OnSerieDown;
|
||||||
|
protected Action<SerieEventData> m_OnSerieEnter;
|
||||||
|
protected Action<SerieEventData> m_OnSerieExit;
|
||||||
protected Action<int, int> m_OnPointerEnterPie;
|
protected Action<int, int> m_OnPointerEnterPie;
|
||||||
protected Action<PointerEventData, int> m_OnPointerClickBar;
|
|
||||||
protected Action<Axis, double> m_OnAxisPointerValueChanged;
|
protected Action<Axis, double> m_OnAxisPointerValueChanged;
|
||||||
protected Action<Legend, int, string, bool> m_OnLegendClick;
|
protected Action<Legend, int, string, bool> m_OnLegendClick;
|
||||||
protected Action<Legend, int, string> m_OnLegendEnter;
|
protected Action<Legend, int, string> m_OnLegendEnter;
|
||||||
@@ -743,11 +748,5 @@ namespace XCharts.Runtime
|
|||||||
InitComponentHandlers();
|
InitComponentHandlers();
|
||||||
InitSerieHandlers();
|
InitSerieHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator SaveAsImageSync(string imageType, string path)
|
|
||||||
{
|
|
||||||
yield return new WaitForEndOfFrame();
|
|
||||||
ChartHelper.SaveAsImage(rectTransform, canvas, imageType, path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
@@ -36,6 +37,11 @@ namespace XCharts.Runtime
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Vector3 graphPosition { get { return m_GraphPosition; } }
|
public Vector3 graphPosition { get { return m_GraphPosition; } }
|
||||||
public Rect graphRect { get { return m_GraphRect; } }
|
public Rect graphRect { get { return m_GraphRect; } }
|
||||||
|
public Vector2 graphSizeDelta { get { return m_GraphSizeDelta; } }
|
||||||
|
public Vector2 graphPivot { get { return m_GraphPivot; } }
|
||||||
|
public Vector2 graphMinAnchor { get { return m_GraphMinAnchor; } }
|
||||||
|
public Vector2 graphMaxAnchor { get { return m_GraphMaxAnchor; } }
|
||||||
|
public Vector2 graphAnchoredPosition { get { return m_GraphAnchoredPosition; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The postion of pointer.
|
/// The postion of pointer.
|
||||||
/// |鼠标位置。
|
/// |鼠标位置。
|
||||||
@@ -45,7 +51,8 @@ namespace XCharts.Runtime
|
|||||||
/// Whether the mouse pointer is in the chart.
|
/// Whether the mouse pointer is in the chart.
|
||||||
/// |鼠标是否在图表内。
|
/// |鼠标是否在图表内。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool isPointerInChart { get; protected set; }
|
public bool isPointerInChart
|
||||||
|
{ get { return m_PointerEventData != null; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 警告信息。
|
/// 警告信息。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -165,5 +172,21 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存图表为图片。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="imageType">type of image: png, jpg, exr</param>
|
||||||
|
/// <param name="savePath">save path</param>
|
||||||
|
public void SaveAsImage(string imageType = "png", string savePath = "")
|
||||||
|
{
|
||||||
|
StartCoroutine(SaveAsImageSync(imageType, savePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator SaveAsImageSync(string imageType, string path)
|
||||||
|
{
|
||||||
|
yield return new WaitForEndOfFrame();
|
||||||
|
ChartHelper.SaveAsImage(rectTransform, canvas, imageType, path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
#if INPUT_SYSTEM_ENABLED
|
||||||
|
using Input = XCharts.Runtime.InputHelper;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
@@ -9,310 +12,305 @@ namespace XCharts.Runtime
|
|||||||
public partial class BaseGraph : MaskableGraphic, IPointerDownHandler, IPointerUpHandler,
|
public partial class BaseGraph : MaskableGraphic, IPointerDownHandler, IPointerUpHandler,
|
||||||
IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IPointerClickHandler,
|
IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IPointerClickHandler,
|
||||||
IDragHandler, IEndDragHandler, IScrollHandler
|
IDragHandler, IEndDragHandler, IScrollHandler
|
||||||
|
{
|
||||||
|
[SerializeField] protected bool m_EnableTextMeshPro = false;
|
||||||
|
|
||||||
|
protected Painter m_Painter;
|
||||||
|
protected int m_SiblingIndex;
|
||||||
|
|
||||||
|
protected float m_GraphWidth;
|
||||||
|
protected float m_GraphHeight;
|
||||||
|
protected float m_GraphX;
|
||||||
|
protected float m_GraphY;
|
||||||
|
protected Vector3 m_GraphPosition = Vector3.zero;
|
||||||
|
protected Vector2 m_GraphMinAnchor;
|
||||||
|
protected Vector2 m_GraphMaxAnchor;
|
||||||
|
protected Vector2 m_GraphPivot;
|
||||||
|
protected Vector2 m_GraphSizeDelta;
|
||||||
|
protected Vector2 m_GraphAnchoredPosition;
|
||||||
|
protected Rect m_GraphRect = new Rect(0, 0, 0, 0);
|
||||||
|
protected bool m_RefreshChart = false;
|
||||||
|
protected bool m_ForceOpenRaycastTarget;
|
||||||
|
protected bool m_IsControlledByLayout = false;
|
||||||
|
protected bool m_PainerDirty = false;
|
||||||
|
protected bool m_IsOnValidate = false;
|
||||||
|
protected Vector3 m_LastLocalPosition;
|
||||||
|
protected PointerEventData m_PointerEventData;
|
||||||
|
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnPointerClick;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnPointerDown;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnPointerUp;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnPointerEnter;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnPointerExit;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnBeginDrag;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnDrag;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnEndDrag;
|
||||||
|
protected Action<PointerEventData, BaseGraph> m_OnScroll;
|
||||||
|
|
||||||
|
public virtual HideFlags chartHideFlags { get { return HideFlags.None; } }
|
||||||
|
|
||||||
|
private ScrollRect m_ScrollRect;
|
||||||
|
|
||||||
|
public Painter painter { get { return m_Painter; } }
|
||||||
|
|
||||||
|
protected virtual void InitComponent()
|
||||||
{
|
{
|
||||||
|
InitPainter();
|
||||||
|
}
|
||||||
|
|
||||||
[SerializeField] protected bool m_EnableTextMeshPro = false;
|
protected override void Awake()
|
||||||
[SerializeField] protected DebugInfo m_DebugInfo = new DebugInfo();
|
{
|
||||||
|
CheckTextMeshPro();
|
||||||
|
m_SiblingIndex = 0;
|
||||||
|
m_LastLocalPosition = transform.localPosition;
|
||||||
|
UpdateSize();
|
||||||
|
InitComponent();
|
||||||
|
CheckIsInScrollRect();
|
||||||
|
}
|
||||||
|
|
||||||
protected Painter m_Painter;
|
protected override void Start()
|
||||||
protected int m_SiblingIndex;
|
{
|
||||||
|
m_RefreshChart = true;
|
||||||
|
}
|
||||||
|
|
||||||
protected float m_GraphWidth;
|
protected virtual void Update()
|
||||||
protected float m_GraphHeight;
|
{
|
||||||
protected float m_GraphX;
|
CheckSize();
|
||||||
protected float m_GraphY;
|
if (m_IsOnValidate)
|
||||||
protected Vector3 m_GraphPosition = Vector3.zero;
|
|
||||||
protected Vector2 m_GraphMinAnchor;
|
|
||||||
protected Vector2 m_GraphMaxAnchor;
|
|
||||||
protected Vector2 m_GraphPivot;
|
|
||||||
protected Vector2 m_GraphSizeDelta;
|
|
||||||
protected Vector2 m_GraphAnchoredPosition;
|
|
||||||
protected Rect m_GraphRect = new Rect(0, 0, 0, 0);
|
|
||||||
protected bool m_RefreshChart = false;
|
|
||||||
protected bool m_ForceOpenRaycastTarget;
|
|
||||||
protected bool m_IsControlledByLayout = false;
|
|
||||||
protected bool m_PainerDirty = false;
|
|
||||||
protected bool m_IsOnValidate = false;
|
|
||||||
protected Vector3 m_LastLocalPosition;
|
|
||||||
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnPointerClick;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnPointerDown;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnPointerUp;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnPointerEnter;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnPointerExit;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnBeginDrag;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnDrag;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnEndDrag;
|
|
||||||
protected Action<PointerEventData, BaseGraph> m_OnScroll;
|
|
||||||
|
|
||||||
protected Vector2 graphAnchorMax { get { return m_GraphMinAnchor; } }
|
|
||||||
protected Vector2 graphAnchorMin { get { return m_GraphMaxAnchor; } }
|
|
||||||
protected Vector2 graphPivot { get { return m_GraphPivot; } }
|
|
||||||
public HideFlags chartHideFlags { get { return m_DebugInfo.showAllChartObject ? HideFlags.None : HideFlags.HideInHierarchy; } }
|
|
||||||
public DebugInfo debug { get { return m_DebugInfo; } }
|
|
||||||
private ScrollRect m_ScrollRect;
|
|
||||||
|
|
||||||
public Painter painter { get { return m_Painter; } }
|
|
||||||
|
|
||||||
protected virtual void InitComponent()
|
|
||||||
{
|
|
||||||
InitPainter();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
{
|
||||||
|
m_IsOnValidate = false;
|
||||||
CheckTextMeshPro();
|
CheckTextMeshPro();
|
||||||
m_SiblingIndex = 0;
|
|
||||||
m_LastLocalPosition = transform.localPosition;
|
|
||||||
UpdateSize();
|
|
||||||
InitComponent();
|
InitComponent();
|
||||||
CheckIsInScrollRect();
|
RefreshGraph();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
protected override void Start()
|
|
||||||
{
|
{
|
||||||
m_RefreshChart = true;
|
CheckComponent();
|
||||||
}
|
}
|
||||||
|
CheckPointerPos();
|
||||||
|
CheckRefreshChart();
|
||||||
|
CheckRefreshPainter();
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void Update()
|
protected virtual void SetAllComponentDirty()
|
||||||
{
|
{
|
||||||
CheckSize();
|
|
||||||
if (m_IsOnValidate)
|
|
||||||
{
|
|
||||||
m_IsOnValidate = false;
|
|
||||||
CheckTextMeshPro();
|
|
||||||
InitComponent();
|
|
||||||
RefreshGraph();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CheckComponent();
|
|
||||||
}
|
|
||||||
CheckPointerPos();
|
|
||||||
CheckRefreshChart();
|
|
||||||
CheckRefreshPainter();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void SetAllComponentDirty()
|
|
||||||
{
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying)
|
if (!Application.isPlaying)
|
||||||
{
|
|
||||||
m_IsOnValidate = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
m_PainerDirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void CheckComponent()
|
|
||||||
{
|
|
||||||
if (m_PainerDirty)
|
|
||||||
{
|
|
||||||
InitPainter();
|
|
||||||
m_PainerDirty = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckTextMeshPro()
|
|
||||||
{
|
|
||||||
#if dUI_TextMeshPro
|
|
||||||
var enableTextMeshPro = true;
|
|
||||||
#else
|
|
||||||
var enableTextMeshPro = false;
|
|
||||||
#endif
|
|
||||||
if (m_EnableTextMeshPro != enableTextMeshPro)
|
|
||||||
{
|
|
||||||
m_EnableTextMeshPro = enableTextMeshPro;
|
|
||||||
RebuildChartObject();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
protected override void Reset()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
protected override void OnValidate()
|
|
||||||
{
|
{
|
||||||
m_IsOnValidate = true;
|
m_IsOnValidate = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
m_PainerDirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnDestroy()
|
protected virtual void CheckComponent()
|
||||||
|
{
|
||||||
|
if (m_PainerDirty)
|
||||||
{
|
{
|
||||||
for (int i = transform.childCount - 1; i >= 0; i--)
|
InitPainter();
|
||||||
{
|
m_PainerDirty = false;
|
||||||
DestroyImmediate(transform.GetChild(i).gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnPopulateMesh(VertexHelper vh)
|
|
||||||
{
|
|
||||||
vh.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void InitPainter()
|
|
||||||
{
|
|
||||||
m_Painter = ChartHelper.AddPainterObject("painter_b", transform, m_GraphMinAnchor,
|
|
||||||
m_GraphMaxAnchor, m_GraphPivot, new Vector2(m_GraphWidth, m_GraphHeight), chartHideFlags, 1);
|
|
||||||
m_Painter.type = Painter.Type.Base;
|
|
||||||
m_Painter.onPopulateMesh = OnDrawPainterBase;
|
|
||||||
m_Painter.transform.SetSiblingIndex(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckSize()
|
|
||||||
{
|
|
||||||
var currWidth = rectTransform.rect.width;
|
|
||||||
var currHeight = rectTransform.rect.height;
|
|
||||||
|
|
||||||
if (m_GraphWidth == 0 && m_GraphHeight == 0 && (currWidth != 0 || currHeight != 0))
|
|
||||||
{
|
|
||||||
Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_GraphWidth != currWidth ||
|
|
||||||
m_GraphHeight != currHeight ||
|
|
||||||
m_GraphMinAnchor != rectTransform.anchorMin ||
|
|
||||||
m_GraphMaxAnchor != rectTransform.anchorMax ||
|
|
||||||
m_GraphAnchoredPosition != rectTransform.anchoredPosition)
|
|
||||||
{
|
|
||||||
UpdateSize();
|
|
||||||
}
|
|
||||||
if (!ChartHelper.IsValueEqualsVector3(m_LastLocalPosition, transform.localPosition))
|
|
||||||
{
|
|
||||||
m_LastLocalPosition = transform.localPosition;
|
|
||||||
OnLocalPositionChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void UpdateSize()
|
|
||||||
{
|
|
||||||
m_GraphWidth = rectTransform.rect.width;
|
|
||||||
m_GraphHeight = rectTransform.rect.height;
|
|
||||||
|
|
||||||
m_GraphMaxAnchor = rectTransform.anchorMax;
|
|
||||||
m_GraphMinAnchor = rectTransform.anchorMin;
|
|
||||||
m_GraphSizeDelta = rectTransform.sizeDelta;
|
|
||||||
m_GraphAnchoredPosition = rectTransform.anchoredPosition;
|
|
||||||
|
|
||||||
rectTransform.pivot = LayerHelper.ResetChartPositionAndPivot(m_GraphMinAnchor, m_GraphMaxAnchor,
|
|
||||||
m_GraphWidth, m_GraphHeight, ref m_GraphX, ref m_GraphY);
|
|
||||||
m_GraphPivot = rectTransform.pivot;
|
|
||||||
|
|
||||||
m_GraphRect.x = m_GraphX;
|
|
||||||
m_GraphRect.y = m_GraphY;
|
|
||||||
m_GraphRect.width = m_GraphWidth;
|
|
||||||
m_GraphRect.height = m_GraphHeight;
|
|
||||||
m_GraphPosition.x = m_GraphX;
|
|
||||||
m_GraphPosition.y = m_GraphY;
|
|
||||||
|
|
||||||
OnSizeChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckPointerPos()
|
|
||||||
{
|
|
||||||
if (!isPointerInChart) return;
|
|
||||||
if (canvas == null) return;
|
|
||||||
Vector2 local;
|
|
||||||
if (!ScreenPointToChartPoint(Input.mousePosition, out local))
|
|
||||||
{
|
|
||||||
pointerPos = Vector2.zero;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pointerPos = local;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void CheckIsInScrollRect()
|
|
||||||
{
|
|
||||||
m_ScrollRect = GetComponentInParent<ScrollRect>();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void CheckRefreshChart()
|
|
||||||
{
|
|
||||||
if (m_RefreshChart)
|
|
||||||
{
|
|
||||||
m_Painter.Refresh();
|
|
||||||
m_RefreshChart = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void CheckRefreshPainter()
|
|
||||||
{
|
|
||||||
m_Painter.CheckRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal virtual void RefreshPainter(Painter painter)
|
|
||||||
{
|
|
||||||
if (painter == null) return;
|
|
||||||
painter.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void OnSizeChanged()
|
|
||||||
{
|
|
||||||
m_RefreshChart = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void OnLocalPositionChanged()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
protected virtual void OnDrawPainterBase(VertexHelper vh, Painter painter)
|
|
||||||
{
|
|
||||||
DrawPainterBase(vh);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void DrawPainterBase(VertexHelper vh)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public virtual void OnPointerClick(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_OnPointerClick != null) m_OnPointerClick(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnPointerDown(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_OnPointerDown != null) m_OnPointerDown(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnPointerUp(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_OnPointerUp != null) m_OnPointerUp(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnPointerEnter(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
isPointerInChart = true;
|
|
||||||
if (m_OnPointerEnter != null) m_OnPointerEnter(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnPointerExit(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
isPointerInChart = false;
|
|
||||||
if (m_OnPointerExit != null) m_OnPointerExit(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnBeginDrag(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_ScrollRect != null) m_ScrollRect.OnBeginDrag(eventData);
|
|
||||||
if (m_OnBeginDrag != null) m_OnBeginDrag(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnEndDrag(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_ScrollRect != null) m_ScrollRect.OnEndDrag(eventData);
|
|
||||||
if (m_OnEndDrag != null) m_OnEndDrag(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnDrag(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_ScrollRect != null) m_ScrollRect.OnDrag(eventData);
|
|
||||||
if (m_OnDrag != null) m_OnDrag(eventData, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void OnScroll(PointerEventData eventData)
|
|
||||||
{
|
|
||||||
if (m_ScrollRect != null) m_ScrollRect.OnScroll(eventData);
|
|
||||||
if (m_OnScroll != null) m_OnScroll(eventData, this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckTextMeshPro()
|
||||||
|
{
|
||||||
|
#if dUI_TextMeshPro
|
||||||
|
var enableTextMeshPro = true;
|
||||||
|
#else
|
||||||
|
var enableTextMeshPro = false;
|
||||||
|
#endif
|
||||||
|
if (m_EnableTextMeshPro != enableTextMeshPro)
|
||||||
|
{
|
||||||
|
m_EnableTextMeshPro = enableTextMeshPro;
|
||||||
|
RebuildChartObject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
protected override void Reset() { }
|
||||||
|
|
||||||
|
protected override void OnValidate()
|
||||||
|
{
|
||||||
|
m_IsOnValidate = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected override void OnDestroy()
|
||||||
|
{
|
||||||
|
for (int i = transform.childCount - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
DestroyImmediate(transform.GetChild(i).gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPopulateMesh(VertexHelper vh)
|
||||||
|
{
|
||||||
|
vh.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void InitPainter()
|
||||||
|
{
|
||||||
|
m_Painter = ChartHelper.AddPainterObject("painter_b", transform, m_GraphMinAnchor,
|
||||||
|
m_GraphMaxAnchor, m_GraphPivot, new Vector2(m_GraphWidth, m_GraphHeight), chartHideFlags, 1);
|
||||||
|
m_Painter.type = Painter.Type.Base;
|
||||||
|
m_Painter.onPopulateMesh = OnDrawPainterBase;
|
||||||
|
m_Painter.transform.SetSiblingIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckSize()
|
||||||
|
{
|
||||||
|
var currWidth = rectTransform.rect.width;
|
||||||
|
var currHeight = rectTransform.rect.height;
|
||||||
|
|
||||||
|
if (m_GraphWidth == 0 && m_GraphHeight == 0 && (currWidth != 0 || currHeight != 0))
|
||||||
|
{
|
||||||
|
Awake();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_GraphWidth != currWidth ||
|
||||||
|
m_GraphHeight != currHeight ||
|
||||||
|
m_GraphMinAnchor != rectTransform.anchorMin ||
|
||||||
|
m_GraphMaxAnchor != rectTransform.anchorMax ||
|
||||||
|
m_GraphAnchoredPosition != rectTransform.anchoredPosition)
|
||||||
|
{
|
||||||
|
UpdateSize();
|
||||||
|
}
|
||||||
|
if (!ChartHelper.IsValueEqualsVector3(m_LastLocalPosition, transform.localPosition))
|
||||||
|
{
|
||||||
|
m_LastLocalPosition = transform.localPosition;
|
||||||
|
OnLocalPositionChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void UpdateSize()
|
||||||
|
{
|
||||||
|
m_GraphWidth = rectTransform.rect.width;
|
||||||
|
m_GraphHeight = rectTransform.rect.height;
|
||||||
|
|
||||||
|
m_GraphMaxAnchor = rectTransform.anchorMax;
|
||||||
|
m_GraphMinAnchor = rectTransform.anchorMin;
|
||||||
|
m_GraphSizeDelta = rectTransform.sizeDelta;
|
||||||
|
m_GraphAnchoredPosition = rectTransform.anchoredPosition;
|
||||||
|
|
||||||
|
rectTransform.pivot = LayerHelper.ResetChartPositionAndPivot(m_GraphMinAnchor, m_GraphMaxAnchor,
|
||||||
|
m_GraphWidth, m_GraphHeight, ref m_GraphX, ref m_GraphY);
|
||||||
|
m_GraphPivot = rectTransform.pivot;
|
||||||
|
|
||||||
|
m_GraphRect.x = m_GraphX;
|
||||||
|
m_GraphRect.y = m_GraphY;
|
||||||
|
m_GraphRect.width = m_GraphWidth;
|
||||||
|
m_GraphRect.height = m_GraphHeight;
|
||||||
|
m_GraphPosition.x = m_GraphX;
|
||||||
|
m_GraphPosition.y = m_GraphY;
|
||||||
|
|
||||||
|
OnSizeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckPointerPos()
|
||||||
|
{
|
||||||
|
if (!isPointerInChart) return;
|
||||||
|
if (canvas == null) return;
|
||||||
|
Vector2 mousePos = m_PointerEventData.position;
|
||||||
|
Vector2 local;
|
||||||
|
if (!ScreenPointToChartPoint(mousePos, out local))
|
||||||
|
{
|
||||||
|
pointerPos = Vector2.zero;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pointerPos = local;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void CheckIsInScrollRect()
|
||||||
|
{
|
||||||
|
m_ScrollRect = GetComponentInParent<ScrollRect>();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void CheckRefreshChart()
|
||||||
|
{
|
||||||
|
if (m_RefreshChart && m_Painter != null)
|
||||||
|
{
|
||||||
|
m_Painter.Refresh();
|
||||||
|
m_RefreshChart = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void CheckRefreshPainter()
|
||||||
|
{
|
||||||
|
if (m_Painter == null) return;
|
||||||
|
m_Painter.CheckRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal virtual void RefreshPainter(Painter painter)
|
||||||
|
{
|
||||||
|
if (painter == null) return;
|
||||||
|
painter.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnSizeChanged()
|
||||||
|
{
|
||||||
|
m_RefreshChart = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnLocalPositionChanged() { }
|
||||||
|
|
||||||
|
protected virtual void OnDrawPainterBase(VertexHelper vh, Painter painter)
|
||||||
|
{
|
||||||
|
DrawPainterBase(vh);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void DrawPainterBase(VertexHelper vh) { }
|
||||||
|
|
||||||
|
public virtual void OnPointerClick(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_OnPointerClick != null) m_OnPointerClick(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnPointerDown(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_OnPointerDown != null) m_OnPointerDown(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnPointerUp(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_OnPointerUp != null) m_OnPointerUp(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnPointerEnter(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
m_PointerEventData = eventData;
|
||||||
|
if (m_OnPointerEnter != null) m_OnPointerEnter(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnPointerExit(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
m_PointerEventData = null;
|
||||||
|
if (m_OnPointerExit != null) m_OnPointerExit(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnBeginDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_ScrollRect != null) m_ScrollRect.OnBeginDrag(eventData);
|
||||||
|
if (m_OnBeginDrag != null) m_OnBeginDrag(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnEndDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_ScrollRect != null) m_ScrollRect.OnEndDrag(eventData);
|
||||||
|
if (m_OnEndDrag != null) m_OnEndDrag(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_ScrollRect != null) m_ScrollRect.OnDrag(eventData);
|
||||||
|
if (m_OnDrag != null) m_OnDrag(eventData, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnScroll(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
if (m_ScrollRect != null) m_ScrollRect.OnScroll(eventData);
|
||||||
|
if (m_OnScroll != null) m_OnScroll(eventData, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -22,4 +22,10 @@ namespace XCharts.Runtime
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public delegate float SymbolSizeFunction(List<double> data);
|
public delegate float SymbolSizeFunction(List<double> data);
|
||||||
public delegate void CustomDrawGaugePointerFunction(VertexHelper vh, int serieIndex, int dataIndex, float currentAngle);
|
public delegate void CustomDrawGaugePointerFunction(VertexHelper vh, int serieIndex, int dataIndex, float currentAngle);
|
||||||
|
/// <summary>
|
||||||
|
/// DataZoom的start和end变更时的委托方法。
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="start"></param>
|
||||||
|
/// <param name="end"></param>
|
||||||
|
public delegate void CustomDataZoomStartEndFunction(ref float start, ref float end);
|
||||||
}
|
}
|
||||||
11
Runtime/Internal/Misc/ISerieComponent.cs
Normal file
11
Runtime/Internal/Misc/ISerieComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace XCharts.Runtime
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The interface for serie component.
|
||||||
|
/// |可用于Serie的组件。
|
||||||
|
/// </summary>
|
||||||
|
public interface ISerieComponent
|
||||||
|
{
|
||||||
|
bool show { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ namespace XCharts.Runtime
|
|||||||
{
|
{
|
||||||
public interface ISerieContainer
|
public interface ISerieContainer
|
||||||
{
|
{
|
||||||
//bool runtimeIsPointerEnter { get; }
|
|
||||||
int index { get; }
|
int index { get; }
|
||||||
bool IsPointerEnter();
|
bool IsPointerEnter();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using UnityEngine;
|
|
||||||
using UnityEngine.EventSystems;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
namespace XCharts.Runtime
|
namespace XCharts.Runtime
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The interface for serie data component.
|
||||||
|
/// |可用于SerieData的组件。
|
||||||
|
/// </summary>
|
||||||
public interface ISerieDataComponent
|
public interface ISerieDataComponent
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user