3.0
2
.github/FUNDING.yml
vendored
@@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: ['https://www.paypal.com/paypalme/monitor1394','https://github.com/XCharts-Team/XCharts/blob/master/Documentation/res/alipay.png']
|
||||
custom: ['https://www.paypal.me/monitor1394','https://github.com/XCharts-Team/XCharts/blob/master/Documentation/res/alipay.png','https://github.com/XCharts-Team/XCharts/blob/master/Documentation/res/wechat.png']
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
|
||||
## master
|
||||
|
||||
* (2022.05.06) 修复代码动态创建图表异常的问题
|
||||
|
||||
## v3.0.0-preivew9
|
||||
|
||||
* (2022.05.06) 发布`v3.0.0-preivew9`版本
|
||||
|
||||
@@ -1,40 +1,74 @@
|
||||
## 技术支持
|
||||
# 技术支持
|
||||
|
||||
如需技术支持,可订阅VIP服务。扫后面的支付宝二维码后可加VIP群(`867291970`,验证信息请输入支付宝账号)。企业VIP可加官方群私聊群主了解详情。
|
||||
如需技术支持,可订阅`个人VIP`服务。扫后面的二维码后可加VIP群`867291970`,验证信息请输入付费的账号。 企业商务合作可联系QQ:3525422251(XCharts技术支持)。
|
||||
|
||||
## 订阅服务
|
||||
|
||||
| |免费用户|付费咨询|个人`1`年`VIP`|个人`2`年`VIP` | 个人长期`VIP` |
|
||||
| ----- |--|--|--|--|--|
|
||||
| 订阅费用 | -- | `98`¥ | `298`¥ | `498`¥ | `888`¥ |
|
||||
| 席位时长 | -- | `1`个席位<br>`7`天,`7`小时* | `1`个席位<br>`1`年 | `1`个席位<br>`2`年 | `1`个席位<br>`长期` |
|
||||
| <b>`服务方式:`</b>|
|
||||
| 官方QQ群交流 | √ | √ | √ | √ | √ |
|
||||
| 即时一对一交流 | | √ | √ | √ | √ |
|
||||
| 专属VIP群交流 | | | √ | √ | √ |
|
||||
| <b>`服务内容:`</b>|
|
||||
| 可商用 | √ | √ | √ | √ | √ |
|
||||
| 可二次开发 | √ | √ | √ | √ | √ |
|
||||
| 有问必答 | | √ | √ | √ | √ |
|
||||
| 即时回应 | | √ | √ | √ | √ |
|
||||
| 新手指导 | | √ | √ | √ | √ |
|
||||
| 开发指导 | | √ | √ | √ | √ |
|
||||
| 优化指导 | | √ | √ | √ | √ |
|
||||
| 其他技术支持 | | | √ | √ | √ |
|
||||
| 问题及时处理 | | | √ | √ | √ |
|
||||
| 需求优先考虑 | | | √ | √ | √ |
|
||||
| 可另付费定制 | | | √ | √ | √ |
|
||||
| 可另付费加急 | | | √ | √ | √ |
|
||||
| 付费图表优惠 | | | 95折 | 95折 | 85折 |
|
||||
订阅服务分个人订阅和企业订阅:
|
||||
|
||||
- 个人订阅:个人VIP属于个人,不可转让,XCharts只服务于订阅当事人。
|
||||
- 企业订阅:企业VIP属于企业,席位内可安排固定职员,职员离职可重新安排,XCharts通过专属企业群为企业服务。
|
||||
|
||||
订阅服务的优势?
|
||||
|
||||
- 提高工作效率,节省时间成本。一方面,XCharts功能强大,相关配置项非常多,VIP服务可快速帮您定位,节省去查找和核对的时间;另一方面,VIP的即时回答服务可快速为您答疑解惑,避免中断开发流程。总之,订阅VIP可让您能快速上手,快速处理问题,至少能提高`10`倍以上的工作效率。
|
||||
- 更多技术交流,更多经验交流。XCharts团队从业多年,有丰富的技术和工作经验。VIP服务不仅可以交流XCharts相关的内容,也可以咨询其他方面的技术。VIP群也有更多的交流。
|
||||
- 订阅VIP后可享受更多其他增值服务。
|
||||
|
||||
| |免费用户|付费咨询|个人`1`年`VIP`|个人`2`年`VIP` | 个人长期`VIP` | 个人长期`SVIP` | 企业`1`年`VIP` |
|
||||
| ----- |--|--|--|--|--|--|--|
|
||||
| 订阅费用 | -- | `98`¥ | `298`¥ | `498`¥ | `898`¥ | `1998`¥ | `联系我们` |
|
||||
| 订阅时长 | -- | `7`天 | `1`年 | `2`年 | `长期` | `长期` | `1`年
|
||||
| 订阅席位 | -- | `1`个席位 | `1`个席位 | `1`个席位 | `1`个席位|`1`个席位|`5`个以上席位|
|
||||
| __`服务方式:`__|
|
||||
| 官方QQ群交流 | √ | √ | √ | √ | √ | √ | √ |
|
||||
| 即时一对一交流 | | √ | √ | √ | √ | √ | √ |
|
||||
| 专属VIP群交流 | | | √ | √ | √ | √ | √(专属企业群) |
|
||||
| __`服务内容:`__|
|
||||
| 可商用 | √ | √ | √ | √ | √ | √ | √ |
|
||||
| 可二次开发 | √ | √ | √ | √ | √ | √ | √ |
|
||||
| 有问必答 | | √ | √ | √ | √ | √ | √ |
|
||||
| 即时回答 | | √ | √ | √ | √ | √ | √ |
|
||||
| 新手指导 | | √ | √ | √ | √ | √ | √ |
|
||||
| 开发指导 | | √ | √ | √ | √ | √ | √ |
|
||||
| 优化指导 | | √ | √ | √ | √ | √ | √ |
|
||||
| 其他技术支持 | | | √ | √ | √ | √ | √ |
|
||||
| 问题及时处理 | | | √ | √ | √ | √ | √ |
|
||||
| 需求优先考虑 | | | √ | √ | √ | √ | √ |
|
||||
| 可另付费定制 | | | √ | √ | √ | √ | √ |
|
||||
| 可另付费加急 | | | √ | √ | √ | √ | √ |
|
||||
| 扩展图表购买 | | | √ | √ | √ | √ | √ |
|
||||
| 扩展图表优惠 | | | | | 85折 | 全部免费 | |
|
||||
|
||||
## 扩展图表
|
||||
|
||||
扩展图表为另付费购买图表,目前只对订阅了VIP服务的用户开放购买。对于`个人长期SVIP`的用户,后续新增的所有扩展图表都可以免费使用。
|
||||
|
||||
扩展图表购买后可访问和下载源码,长期有效,并可获得持续的更新支持。
|
||||
|
||||
|编号|扩展图表|价格|备注|
|
||||
|--|--|--|--|
|
||||
| 101 | PictorialBarChart | 98¥ | 象形柱图 |
|
||||
| 102 | FunnelChart | 98¥ | 漏斗图 |
|
||||
| 103 | PyramidChart | 98¥ | 3D金字塔 |
|
||||
| 104 | TreemapChart | 98¥ | 树形矩图 |
|
||||
| 201 | Bar3DChart | 198¥ | 3D柱图 |
|
||||
| 202 | Pie3DChart | 198¥ | 3D饼图 |
|
||||
| 203 | GanttChart | 198¥ | 甘特图 |
|
||||
| 204 | GaugeChart | 198¥ | 仪表盘 |
|
||||
| 205 | LiquidChart | 198¥ | 水位图 |
|
||||
|
||||
|
||||
## 备注说明
|
||||
|
||||
1. __`付费定制`__ 是指用户可根据自己的需求定制不同的图表或新功能,只有`VIP`用户才享有`付费定制`权利。
|
||||
2. __`付费加急`__ 是指用户可对自己非常紧急的需求进行付费,将开发优先级提到最高,并可要求在`Deadline`内交付,只有`VIP`用户才享有`付费加急`权利。
|
||||
3. __`付费咨询`__ 付费咨询有效期`7`天,且总咨询时长不超过`7`个小时。
|
||||
4. __`扩展图表`__ 扩展图表需要另付费购买,目前只有VIP用户才享有购买`扩展图表`权利。购买后可访问和下载源码,长期有效,并可获得持续的更新支持。
|
||||
|
||||
## 捐助支持
|
||||
|
||||
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎任何金额的赞助,非常感谢!
|
||||
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎任意金额的捐助,非常感谢!
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
- [SerieContext](#SerieContext)
|
||||
- [SerieConvertAttribute](#SerieConvertAttribute)
|
||||
- [SerieDataContext](#SerieDataContext)
|
||||
- [SerieDataExtraComponentAttribute](#SerieDataExtraComponentAttribute)
|
||||
- [SerieDataExtraFieldAttribute](#SerieDataExtraFieldAttribute)
|
||||
- [SerieExtraComponentAttribute](#SerieExtraComponentAttribute)
|
||||
- [SerieHandler](#SerieHandler)
|
||||
- [SerieHandler<T>](#SerieHandler<T>)
|
||||
@@ -144,10 +146,12 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `AddChartComponent()` |public MainComponent AddChartComponent(Type type)</br> |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, DateTime time, double yValue, string dataName = null, string dataId = null)</br>Add a (time,y) data to serie. |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, double data, string dataName = null, string dataId = null)</br>Add a data to serie. |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, double xValue, double yValue, string dataName = null, string dataId = null)</br>Add a (x,y) data to serie. |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, List<double> multidimensionalData, string dataName = null, string dataId = null)</br>Add an arbitray dimension data to serie,such as (x,y,z,...). |
|
||||
| `AddData()` |public SerieData AddData(string serieName, DateTime time, double yValue, string dataName = null, string dataId = null)</br>Add a (time,y) data to serie. |
|
||||
| `AddData()` |public SerieData AddData(string serieName, double data, string dataName = null, string dataId = null)</br>Add a data to serie. |
|
||||
| `AddData()` |public SerieData AddData(string serieName, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
|
||||
| `AddData()` |public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)</br>Add a (x,y) data to serie. |
|
||||
@@ -338,7 +342,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
|
||||
| `GetMaxDivisibleValue()` |public static double GetMaxDivisibleValue(double max, int ceilRate)</br> |
|
||||
| `GetMaxLogValue()` |public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
|
||||
| `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, int ceilRate)</br> |
|
||||
| `GetMinLogValue()` |public static float GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
|
||||
| `GetMinLogValue()` |public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
|
||||
| `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> |
|
||||
| `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> |
|
||||
| `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> |
|
||||
@@ -483,6 +487,7 @@ Inherits or Implemented: [Attribute](#Attribute)
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `NeedFormat()` |public static bool NeedFormat(string content)</br> |
|
||||
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string numericFormatter, double value)</br> |
|
||||
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string value)</br> |
|
||||
| `TrimAndReplaceLine()` |public static string TrimAndReplaceLine(string content)</br> |
|
||||
@@ -721,6 +726,38 @@ Inherits or Implemented: [Attribute](#Attribute)
|
||||
|--|--|
|
||||
| `Reset()` |public void Reset()</br> |
|
||||
|
||||
## `SerieDataExtraComponentAttribute`
|
||||
|
||||
Inherits or Implemented: [Attribute](#Attribute)
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `Contains()` |public bool Contains(Type type)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute()</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)</br> |
|
||||
|
||||
## `SerieDataExtraFieldAttribute`
|
||||
|
||||
Inherits or Implemented: [Attribute](#Attribute)
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `Contains()` |public bool Contains(string field)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute()</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)</br> |
|
||||
|
||||
## `SerieExtraComponentAttribute`
|
||||
|
||||
Inherits or Implemented: [Attribute](#Attribute)
|
||||
@@ -745,6 +782,7 @@ Inherits or Implemented: [SerieHandler where T](#SerieHandler where T),[Serie](#
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `GetSerieDataAutoColor()` |public virtual Color GetSerieDataAutoColor(SerieData serieData)</br> |
|
||||
| `GetSerieDataLabelOffset()` |public virtual Vector3 GetSerieDataLabelOffset(SerieData serieData, LabelStyle label)</br> |
|
||||
| `GetSerieDataLabelPosition()` |public virtual Vector3 GetSerieDataLabelPosition(SerieData serieData, LabelStyle label)</br> |
|
||||
| `GetSerieDataTitlePosition()` |public virtual Vector3 GetSerieDataTitlePosition(SerieData serieData, TitleStyle titleStyle)</br> |
|
||||
@@ -777,13 +815,13 @@ Inherits or Implemented: [Attribute](#Attribute)
|
||||
| `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> |
|
||||
| `GetAreaToColor()` |public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
|
||||
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
|
||||
| `GetItemColor0()` |public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)</br> |
|
||||
| `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
|
||||
| `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> |
|
||||
| `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false)</br> |
|
||||
| `GetItemStyleEmphasis()` |public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)</br> |
|
||||
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
|
||||
| `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> |
|
||||
| `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
- [SerieContext](#SerieContext)
|
||||
- [SerieConvertAttribute](#SerieConvertAttribute)
|
||||
- [SerieDataContext](#SerieDataContext)
|
||||
- [SerieDataExtraComponentAttribute](#SerieDataExtraComponentAttribute)
|
||||
- [SerieDataExtraFieldAttribute](#SerieDataExtraFieldAttribute)
|
||||
- [SerieExtraComponentAttribute](#SerieExtraComponentAttribute)
|
||||
- [SerieHandler](#SerieHandler)
|
||||
- [SerieHandler<T>](#SerieHandler<T>)
|
||||
@@ -144,10 +146,12 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `AddChartComponent()` |public MainComponent AddChartComponent(Type type)</br> |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, DateTime time, double yValue, string dataName = null, string dataId = null)</br>添加(time,y)数据到指定的系列中。 |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, double data, string dataName = null, string dataId = null)</br>添加一个数据到指定的系列中。 |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, double xValue, double yValue, string dataName = null, string dataId = null)</br>添加(x,y)数据到指定系列中。 |
|
||||
| `AddData()` |public SerieData AddData(int serieIndex, List<double> multidimensionalData, string dataName = null, string dataId = null)</br>添加多维数据(x,y,z...)到指定的系列中。 |
|
||||
| `AddData()` |public SerieData AddData(string serieName, DateTime time, double yValue, string dataName = null, string dataId = null)</br>添加(time,y)数据到指定的系列中。 |
|
||||
| `AddData()` |public SerieData AddData(string serieName, double data, string dataName = null, string dataId = null)</br>If serieName doesn't exist in legend,will be add to legend. |
|
||||
| `AddData()` |public SerieData AddData(string serieName, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
|
||||
| `AddData()` |public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)</br>添加(x,y)数据到指定系列中。 |
|
||||
@@ -338,7 +342,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
|
||||
| `GetMaxDivisibleValue()` |public static double GetMaxDivisibleValue(double max, int ceilRate)</br> |
|
||||
| `GetMaxLogValue()` |public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
|
||||
| `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, int ceilRate)</br> |
|
||||
| `GetMinLogValue()` |public static float GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
|
||||
| `GetMinLogValue()` |public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
|
||||
| `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> |
|
||||
| `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> |
|
||||
| `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> |
|
||||
@@ -483,6 +487,7 @@ Inherits or Implemented: [Attribute](#Attribute)
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `NeedFormat()` |public static bool NeedFormat(string content)</br> |
|
||||
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string numericFormatter, double value)</br> |
|
||||
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string value)</br> |
|
||||
| `TrimAndReplaceLine()` |public static string TrimAndReplaceLine(string content)</br> |
|
||||
@@ -721,6 +726,38 @@ Inherits or Implemented: [Attribute](#Attribute)
|
||||
|--|--|
|
||||
| `Reset()` |public void Reset()</br> |
|
||||
|
||||
## `SerieDataExtraComponentAttribute`
|
||||
|
||||
Inherits or Implemented: [Attribute](#Attribute)
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `Contains()` |public bool Contains(Type type)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute()</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)</br> |
|
||||
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)</br> |
|
||||
|
||||
## `SerieDataExtraFieldAttribute`
|
||||
|
||||
Inherits or Implemented: [Attribute](#Attribute)
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `Contains()` |public bool Contains(string field)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute()</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)</br> |
|
||||
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)</br> |
|
||||
|
||||
## `SerieExtraComponentAttribute`
|
||||
|
||||
Inherits or Implemented: [Attribute](#Attribute)
|
||||
@@ -745,6 +782,7 @@ Inherits or Implemented: [SerieHandler where T](#SerieHandler where T),[Serie](#
|
||||
|
||||
|public method|description|
|
||||
|--|--|
|
||||
| `GetSerieDataAutoColor()` |public virtual Color GetSerieDataAutoColor(SerieData serieData)</br> |
|
||||
| `GetSerieDataLabelOffset()` |public virtual Vector3 GetSerieDataLabelOffset(SerieData serieData, LabelStyle label)</br> |
|
||||
| `GetSerieDataLabelPosition()` |public virtual Vector3 GetSerieDataLabelPosition(SerieData serieData, LabelStyle label)</br> |
|
||||
| `GetSerieDataTitlePosition()` |public virtual Vector3 GetSerieDataTitlePosition(SerieData serieData, TitleStyle titleStyle)</br> |
|
||||
@@ -777,13 +815,13 @@ Inherits or Implemented: [Attribute](#Attribute)
|
||||
| `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> |
|
||||
| `GetAreaToColor()` |public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
|
||||
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
|
||||
| `GetItemColor0()` |public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)</br> |
|
||||
| `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
|
||||
| `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> |
|
||||
| `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false)</br> |
|
||||
| `GetItemStyleEmphasis()` |public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)</br> |
|
||||
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
|
||||
| `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
|
||||
| `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> |
|
||||
| `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
- [Axis](#Axis)
|
||||
- [Background](#Background)
|
||||
- [CalendarCoord](#CalendarCoord)
|
||||
- [Comment](#Comment)
|
||||
- [CoordSystem](#CoordSystem)
|
||||
- [DataZoom](#DataZoom)
|
||||
- [GridCoord](#GridCoord)
|
||||
@@ -82,9 +83,14 @@
|
||||
- [AxisTick](#AxisTick)
|
||||
- [BaseAxisTheme](#BaseAxisTheme)
|
||||
- [BaseLine](#BaseLine)
|
||||
- [CommentItem](#CommentItem)
|
||||
- [CommentMarkStyle](#CommentMarkStyle)
|
||||
- [ComponentTheme](#ComponentTheme)
|
||||
- [DataZoomTheme](#DataZoomTheme)
|
||||
- [Emphasis](#Emphasis)
|
||||
- [EmphasisItemStyle](#EmphasisItemStyle)
|
||||
- [EmphasisLabelLine](#EmphasisLabelLine)
|
||||
- [EmphasisLabelStyle](#EmphasisLabelStyle)
|
||||
- [EndLabelStyle](#EndLabelStyle)
|
||||
- [IconStyle](#IconStyle)
|
||||
- [ImageStyle](#ImageStyle)
|
||||
@@ -103,7 +109,6 @@
|
||||
- [RadarAxisTheme](#RadarAxisTheme)
|
||||
- [RadiusAxisTheme](#RadiusAxisTheme)
|
||||
- [SerieData](#SerieData)
|
||||
- [SerieDataBaseInfo](#SerieDataBaseInfo)
|
||||
- [SerieSymbol](#SerieSymbol)
|
||||
- [SerieTheme](#SerieTheme)
|
||||
- [StageColor](#StageColor)
|
||||
@@ -116,13 +121,16 @@
|
||||
- [TitleStyle](#TitleStyle)
|
||||
- [TitleTheme](#TitleTheme)
|
||||
- [TooltipTheme](#TooltipTheme)
|
||||
- [VisualMapPieces](#VisualMapPieces)
|
||||
- [VisualMapRange](#VisualMapRange)
|
||||
- [VisualMapTheme](#VisualMapTheme)
|
||||
|
||||
## ISerieExtraComponent
|
||||
|
||||
- [AreaStyle](#AreaStyle)
|
||||
- [Emphasis](#Emphasis)
|
||||
- [EmphasisItemStyle](#EmphasisItemStyle)
|
||||
- [EmphasisLabelLine](#EmphasisLabelLine)
|
||||
- [EmphasisLabelStyle](#EmphasisLabelStyle)
|
||||
- [ImageStyle](#ImageStyle)
|
||||
- [LabelLine](#LabelLine)
|
||||
- [LabelStyle](#LabelStyle)
|
||||
@@ -133,12 +141,14 @@
|
||||
|
||||
- [AreaStyle](#AreaStyle)
|
||||
- [Emphasis](#Emphasis)
|
||||
- [EmphasisItemStyle](#EmphasisItemStyle)
|
||||
- [EmphasisLabelLine](#EmphasisLabelLine)
|
||||
- [EmphasisLabelStyle](#EmphasisLabelStyle)
|
||||
- [ImageStyle](#ImageStyle)
|
||||
- [ItemStyle](#ItemStyle)
|
||||
- [LabelLine](#LabelLine)
|
||||
- [LabelStyle](#LabelStyle)
|
||||
- [LineStyle](#LineStyle)
|
||||
- [SerieDataBaseInfo](#SerieDataBaseInfo)
|
||||
- [SerieSymbol](#SerieSymbol)
|
||||
- [TitleStyle](#TitleStyle)
|
||||
|
||||
@@ -414,6 +424,45 @@ Inherits or Implemented: [Serie](#Serie),[INeedSerieContainer](#INeedSerieContai
|
||||
## `ChildComponent`
|
||||
|
||||
|
||||
## `Comment`
|
||||
|
||||
Inherits or Implemented: [MainComponent](#MainComponent)
|
||||
|
||||
comment of chart.
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` |true | Set this to false to prevent the comment from showing. |
|
||||
| `labelStyle` | | The text style of all comments. [LabelStyle](LabelStyle)|
|
||||
| `markStyle` | | The text style of all comments. [CommentMarkStyle](CommentMarkStyle)|
|
||||
| `items` | | |
|
||||
|
||||
## `CommentItem`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
|
||||
comment of chart.
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` |true | Set this to false to prevent this comment item from showing. |
|
||||
| `content` | | content of comment. |
|
||||
| `position` | | position of comment. |
|
||||
| `markRect` | | |
|
||||
| `markStyle` | | [CommentMarkStyle](CommentMarkStyle)|
|
||||
| `labelStyle` | | The text style of all comments. [LabelStyle](LabelStyle)|
|
||||
|
||||
## `CommentMarkStyle`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
|
||||
comment of chart.
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` |true | Set this to false to prevent this comment item from showing. |
|
||||
| `lineStyle` | | [LineStyle](LineStyle)|
|
||||
|
||||
## `ComponentTheme`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
@@ -516,6 +565,27 @@ Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent
|
||||
| `labelLine` | | [LabelLine](LabelLine)|
|
||||
| `itemStyle` | | 图形样式。 [ItemStyle](ItemStyle)|
|
||||
|
||||
## `EmphasisItemStyle`
|
||||
|
||||
Inherits or Implemented: [ItemStyle](#ItemStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
高亮的图形样式
|
||||
|
||||
|
||||
## `EmphasisLabelLine`
|
||||
|
||||
Inherits or Implemented: [LabelLine](#LabelLine),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
高亮的标签引导线样式
|
||||
|
||||
|
||||
## `EmphasisLabelStyle`
|
||||
|
||||
Inherits or Implemented: [LabelStyle](#LabelStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
高亮的标签样式
|
||||
|
||||
|
||||
## `EndLabelStyle`
|
||||
|
||||
Inherits or Implemented: [LabelStyle](#LabelStyle)
|
||||
@@ -704,11 +774,13 @@ Legend component.The legend component shows different sets of tags, colors, and
|
||||
| `itemHeight` |12.0f | Image height of legend symbol. |
|
||||
| `itemGap` |10f | The distance between each legend, horizontal distance in horizontal layout, and vertical distance in vertical layout. |
|
||||
| `itemAutoColor` |true | Whether the legend symbol matches the color automatically. |
|
||||
| `textAutoColor` |false | Whether the legend text matches the color automatically. |
|
||||
| `itemOpacity` |1 | the opacity of item color. |
|
||||
| `formatter` | | |
|
||||
| `numericFormatter` | | Standard numeric format strings. |
|
||||
| `labelStyle` | | the style of text. [LabelStyle](LabelStyle)|
|
||||
| `data` | | Data array of legend. An array item is usually a name representing string. (If it is a pie chart, it could also be the name of a single data in the pie chart) of a series. |
|
||||
| `icons` | | 自定义的图例标记图形。 |
|
||||
| `colors` | | |
|
||||
|
||||
## `LegendTheme`
|
||||
|
||||
@@ -749,7 +821,7 @@ Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` | | Whether to show the arrow. |
|
||||
| `position` | | The position of arrow.</br>`LineArrow.Position`:</br>- `End`: 末端箭头</br>- `Start`: 头端箭头</br>|
|
||||
| `position` | | The position of arrow.</br>`LabelStyle.Position`:</br>- `Default`: The position of label.</br>- `Outside`: Outside of sectors of pie chart, which relates to corresponding sector through visual guide line.</br>- `Inside`: Inside the sectors of pie chart.</br>- `Center`: In the center of pie chart.</br>- `Top`: top of symbol.</br>- `Bottom`: the bottom of symbol.</br>- `Left`: the left of symbol.</br>- `Right`: the right of symbol.</br>- `Start`: the start of line.</br>- `Middle`: the middle of line.</br>- `End`: the end of line.</br>|
|
||||
| `arrow` | | the arrow of line. [ArrowStyle](ArrowStyle)|
|
||||
|
||||
## `LineStyle`
|
||||
@@ -954,7 +1026,9 @@ Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
|
||||
| `lineArrows` | | |
|
||||
| `areaStyles` | | |
|
||||
| `titleStyles` | | |
|
||||
| `emphases` | | |
|
||||
| `emphasisItemStyles` | | |
|
||||
| `emphasisLabels` | | |
|
||||
| `emphasisLabelLines` | | |
|
||||
| `index` | | The index of serie. |
|
||||
| `show` |true | Whether to show serie in chart. |
|
||||
| `coordSystem` | | the chart coord system of serie. |
|
||||
@@ -977,8 +1051,8 @@ Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
|
||||
| `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>|
|
||||
| `barType` | | 柱形图类型。</br>`BarType`:</br>- `Normal`: 普通柱形图</br>- `Zebra`: 斑马柱形图</br>- `Capsule`: 胶囊柱形图</br>|
|
||||
| `barPercentStack` |false | 柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。 |
|
||||
| `barWidth` |0.6f | The width of the bar. Adaptive when default 0. |
|
||||
| `barGap` |0.3f; // 30 | The gap between bars between different series, is a percent value like '0.3f' , which means 30% of the bar width, can be set as a fixed value. |
|
||||
| `barWidth` |0 | The width of the bar. Adaptive when default 0. |
|
||||
| `barGap` |0.1f | The gap between bars between different series, is a percent value like '0.3f' , which means 30% of the bar width, can be set as a fixed value. |
|
||||
| `barZebraWidth` |4f | 斑马线的粗细。 |
|
||||
| `barZebraGap` |2f | 斑马线的间距。 |
|
||||
| `min` | | 最小值。 |
|
||||
@@ -1035,29 +1109,21 @@ A data item of serie.
|
||||
| `name` | | the name of data item. |
|
||||
| `id` | | 数据项的唯一id。唯一id不是必须设置的。 |
|
||||
| `parentId` | | |
|
||||
| `baseInfos` | | |
|
||||
| `ignore` | | 是否忽略数据。当为 true 时,数据不进行绘制。 |
|
||||
| `selected` | | Whether the data item is selected. |
|
||||
| `radius` | | 自定义半径。可用在饼图中自定义某个数据项的半径。 |
|
||||
| `itemStyles` | | |
|
||||
| `labels` | | |
|
||||
| `labelLines` | | |
|
||||
| `emphases` | | |
|
||||
| `symbols` | | |
|
||||
| `lineStyles` | | |
|
||||
| `areaStyles` | | |
|
||||
| `titleStyles` | | |
|
||||
| `emphasisItemStyles` | | |
|
||||
| `emphasisLabels` | | |
|
||||
| `emphasisLabelLines` | | |
|
||||
| `data` | | An arbitrary dimension data list of data item. |
|
||||
|
||||
## `SerieDataBaseInfo`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
数据项的其他基础数据。
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `ignore` |false | 是否忽略数据。当为 true 时,数据不进行绘制。 |
|
||||
| `selected` | | Whether the data item is selected. |
|
||||
| `radius` | | 自定义半径。可用在饼图中自定义某个数据项的半径。 |
|
||||
|
||||
## `SerieSymbol`
|
||||
|
||||
Inherits or Implemented: [SymbolStyle](#SymbolStyle),[ISerieDataComponent](#ISerieDataComponent)
|
||||
@@ -1392,11 +1458,10 @@ VisualMap component. Mapping data to visual elements such as colors.
|
||||
| `location` | | The location of component. [Location](Location)|
|
||||
| `workOnLine` |true | Whether the visualmap is work on linestyle of linechart. |
|
||||
| `workOnArea` |false | Whether the visualmap is work on areaStyle of linechart. |
|
||||
| `inRange` | | Defines the visual color in the selected range. |
|
||||
| `outOfRange` | | Defines a visual color outside of the selected range. |
|
||||
| `pieces` | | 分段式每一段的相关配置。 |
|
||||
| `inRange` | | 分段式每一段的相关配置。 |
|
||||
|
||||
## `VisualMapPieces`
|
||||
## `VisualMapRange`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
- [Axis](#Axis)
|
||||
- [Background](#Background)
|
||||
- [CalendarCoord](#CalendarCoord)
|
||||
- [Comment](#Comment)
|
||||
- [CoordSystem](#CoordSystem)
|
||||
- [DataZoom](#DataZoom)
|
||||
- [GridCoord](#GridCoord)
|
||||
@@ -82,9 +83,14 @@
|
||||
- [AxisTick](#AxisTick)
|
||||
- [BaseAxisTheme](#BaseAxisTheme)
|
||||
- [BaseLine](#BaseLine)
|
||||
- [CommentItem](#CommentItem)
|
||||
- [CommentMarkStyle](#CommentMarkStyle)
|
||||
- [ComponentTheme](#ComponentTheme)
|
||||
- [DataZoomTheme](#DataZoomTheme)
|
||||
- [Emphasis](#Emphasis)
|
||||
- [EmphasisItemStyle](#EmphasisItemStyle)
|
||||
- [EmphasisLabelLine](#EmphasisLabelLine)
|
||||
- [EmphasisLabelStyle](#EmphasisLabelStyle)
|
||||
- [EndLabelStyle](#EndLabelStyle)
|
||||
- [IconStyle](#IconStyle)
|
||||
- [ImageStyle](#ImageStyle)
|
||||
@@ -103,7 +109,6 @@
|
||||
- [RadarAxisTheme](#RadarAxisTheme)
|
||||
- [RadiusAxisTheme](#RadiusAxisTheme)
|
||||
- [SerieData](#SerieData)
|
||||
- [SerieDataBaseInfo](#SerieDataBaseInfo)
|
||||
- [SerieSymbol](#SerieSymbol)
|
||||
- [SerieTheme](#SerieTheme)
|
||||
- [StageColor](#StageColor)
|
||||
@@ -116,13 +121,16 @@
|
||||
- [TitleStyle](#TitleStyle)
|
||||
- [TitleTheme](#TitleTheme)
|
||||
- [TooltipTheme](#TooltipTheme)
|
||||
- [VisualMapPieces](#VisualMapPieces)
|
||||
- [VisualMapRange](#VisualMapRange)
|
||||
- [VisualMapTheme](#VisualMapTheme)
|
||||
|
||||
## ISerieExtraComponent Serie额外组件
|
||||
|
||||
- [AreaStyle](#AreaStyle)
|
||||
- [Emphasis](#Emphasis)
|
||||
- [EmphasisItemStyle](#EmphasisItemStyle)
|
||||
- [EmphasisLabelLine](#EmphasisLabelLine)
|
||||
- [EmphasisLabelStyle](#EmphasisLabelStyle)
|
||||
- [ImageStyle](#ImageStyle)
|
||||
- [LabelLine](#LabelLine)
|
||||
- [LabelStyle](#LabelStyle)
|
||||
@@ -133,12 +141,14 @@
|
||||
|
||||
- [AreaStyle](#AreaStyle)
|
||||
- [Emphasis](#Emphasis)
|
||||
- [EmphasisItemStyle](#EmphasisItemStyle)
|
||||
- [EmphasisLabelLine](#EmphasisLabelLine)
|
||||
- [EmphasisLabelStyle](#EmphasisLabelStyle)
|
||||
- [ImageStyle](#ImageStyle)
|
||||
- [ItemStyle](#ItemStyle)
|
||||
- [LabelLine](#LabelLine)
|
||||
- [LabelStyle](#LabelStyle)
|
||||
- [LineStyle](#LineStyle)
|
||||
- [SerieDataBaseInfo](#SerieDataBaseInfo)
|
||||
- [SerieSymbol](#SerieSymbol)
|
||||
- [TitleStyle](#TitleStyle)
|
||||
|
||||
@@ -414,6 +424,45 @@ Inherits or Implemented: [Serie](#Serie),[INeedSerieContainer](#INeedSerieContai
|
||||
## `ChildComponent`
|
||||
|
||||
|
||||
## `Comment`
|
||||
|
||||
Inherits or Implemented: [MainComponent](#MainComponent)
|
||||
|
||||
图表注解组件。
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` |true | 是否显示注解组件。 |
|
||||
| `labelStyle` | | 所有组件的文本样式。 [LabelStyle](LabelStyle)|
|
||||
| `markStyle` | | 所有组件的文本样式。 [CommentMarkStyle](CommentMarkStyle)|
|
||||
| `items` | | |
|
||||
|
||||
## `CommentItem`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
|
||||
注解项。
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` |true | 是否显示当前注解项。 |
|
||||
| `content` | | 注解的文本内容。 |
|
||||
| `position` | | 注解项的位置坐标。 |
|
||||
| `markRect` | | |
|
||||
| `markStyle` | | [CommentMarkStyle](CommentMarkStyle)|
|
||||
| `labelStyle` | | 注解项的文本样式。 [LabelStyle](LabelStyle)|
|
||||
|
||||
## `CommentMarkStyle`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
|
||||
注解项。
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` |true | 是否显示当前注解项。 |
|
||||
| `lineStyle` | | [LineStyle](LineStyle)|
|
||||
|
||||
## `ComponentTheme`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
@@ -516,6 +565,27 @@ Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent
|
||||
| `labelLine` | | [LabelLine](LabelLine)|
|
||||
| `itemStyle` | | 图形样式。 [ItemStyle](ItemStyle)|
|
||||
|
||||
## `EmphasisItemStyle`
|
||||
|
||||
Inherits or Implemented: [ItemStyle](#ItemStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
高亮的图形样式
|
||||
|
||||
|
||||
## `EmphasisLabelLine`
|
||||
|
||||
Inherits or Implemented: [LabelLine](#LabelLine),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
高亮的标签引导线样式
|
||||
|
||||
|
||||
## `EmphasisLabelStyle`
|
||||
|
||||
Inherits or Implemented: [LabelStyle](#LabelStyle),[ISerieExtraComponent](#ISerieExtraComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
高亮的标签样式
|
||||
|
||||
|
||||
## `EndLabelStyle`
|
||||
|
||||
Inherits or Implemented: [LabelStyle](#LabelStyle)
|
||||
@@ -704,11 +774,13 @@ Inherits or Implemented: [MainComponent](#MainComponent),[IPropertyChanged](#IPr
|
||||
| `itemHeight` |12.0f | 图例标记的图形高度。 [default:12f] |
|
||||
| `itemGap` |10f | 图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。 [default:10f] |
|
||||
| `itemAutoColor` |true | 图例标记的图形是否自动匹配颜色。 [default:true] |
|
||||
| `textAutoColor` |false | 图例标记的文本是否自动匹配颜色。 [default:false] |
|
||||
| `itemOpacity` |1 | 图例标记的图形的颜色透明度。 |
|
||||
| `formatter` | | |
|
||||
| `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 |
|
||||
| `labelStyle` | | 文本样式。 [LabelStyle](LabelStyle)|
|
||||
| `data` | | If data is not specified, it will be auto collected from series. |
|
||||
| `icons` | | 自定义的图例标记图形。 |
|
||||
| `colors` | | |
|
||||
|
||||
## `LegendTheme`
|
||||
|
||||
@@ -749,7 +821,7 @@ Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieExtraComponent
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `show` | | 是否显示箭头。 |
|
||||
| `position` | | 箭头位置。</br>`LineArrow.Position`:</br>- `End`: 末端箭头</br>- `Start`: 头端箭头</br>|
|
||||
| `position` | | 箭头位置。</br>`LabelStyle.Position`:</br>- `Default`: 标签的位置。</br>- `Outside`: 饼图扇区外侧,通过视觉引导线连到相应的扇区。</br>- `Inside`: 饼图扇区内部。</br>- `Center`: 在饼图中心位置。</br>- `Top`: 图形标志的顶部。</br>- `Bottom`: 图形标志的底部。</br>- `Left`: 图形标志的左边。</br>- `Right`: 图形标志的右边。</br>- `Start`: 线的起始点。</br>- `Middle`: 线的中点。</br>- `End`: 线的结束点。</br>|
|
||||
| `arrow` | | 箭头。 [ArrowStyle](ArrowStyle)|
|
||||
|
||||
## `LineStyle`
|
||||
@@ -954,7 +1026,9 @@ Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
|
||||
| `lineArrows` | | |
|
||||
| `areaStyles` | | |
|
||||
| `titleStyles` | | |
|
||||
| `emphases` | | |
|
||||
| `emphasisItemStyles` | | |
|
||||
| `emphasisLabels` | | |
|
||||
| `emphasisLabelLines` | | |
|
||||
| `index` | | 系列索引。 |
|
||||
| `show` |true | 系列是否显示在图表上。 |
|
||||
| `coordSystem` | | 使用的坐标系。 |
|
||||
@@ -977,8 +1051,8 @@ Inherits or Implemented: [BaseSerie](#BaseSerie),[IComparable](#IComparable)
|
||||
| `lineType` | | 折线图样式类型。</br>`LineType`:</br>- `Normal`: the normal line chart, 普通折线图。</br>- `Smooth`: the smooth line chart, 平滑曲线。</br>- `StepStart`: 阶梯线图:当前点。</br>- `StepMiddle`: 阶梯线图:当前点和下一个点的中间。</br>- `StepEnd`: 阶梯线图:下一个拐点。</br>|
|
||||
| `barType` | | 柱形图类型。</br>`BarType`:</br>- `Normal`: 普通柱形图</br>- `Zebra`: 斑马柱形图</br>- `Capsule`: 胶囊柱形图</br>|
|
||||
| `barPercentStack` |false | 柱形图是否为百分比堆积。相同stack的serie只要有一个barPercentStack为true,则就显示成百分比堆叠柱状图。 |
|
||||
| `barWidth` |0.6f | 柱条的宽度,不设时自适应。支持设置成相对于类目宽度的百分比。 |
|
||||
| `barGap` |0.3f; // 30 | <para>Set barGap as '-1' can overlap bars that belong to different series, which is useful when making a series of bar be background. |
|
||||
| `barWidth` |0 | 柱条的宽度,不设时自适应。支持设置成相对于类目宽度的百分比。 |
|
||||
| `barGap` |0.1f | <para>Set barGap as '-1' can overlap bars that belong to different series, which is useful when making a series of bar be background. |
|
||||
| `barZebraWidth` |4f | 斑马线的粗细。 |
|
||||
| `barZebraGap` |2f | 斑马线的间距。 |
|
||||
| `min` | | 最小值。 |
|
||||
@@ -1035,29 +1109,21 @@ Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
| `name` | | 数据项名称。 |
|
||||
| `id` | | 数据项的唯一id。唯一id不是必须设置的。 |
|
||||
| `parentId` | | |
|
||||
| `baseInfos` | | |
|
||||
| `ignore` | | 是否忽略数据。当为 true 时,数据不进行绘制。 |
|
||||
| `selected` | | 该数据项是否被选中。 |
|
||||
| `radius` | | 自定义半径。可用在饼图中自定义某个数据项的半径。 |
|
||||
| `itemStyles` | | |
|
||||
| `labels` | | |
|
||||
| `labelLines` | | |
|
||||
| `emphases` | | |
|
||||
| `symbols` | | |
|
||||
| `lineStyles` | | |
|
||||
| `areaStyles` | | |
|
||||
| `titleStyles` | | |
|
||||
| `emphasisItemStyles` | | |
|
||||
| `emphasisLabels` | | |
|
||||
| `emphasisLabelLines` | | |
|
||||
| `data` | | 可指定任意维数的数值列表。 |
|
||||
|
||||
## `SerieDataBaseInfo`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent),[ISerieDataComponent](#ISerieDataComponent)
|
||||
|
||||
数据项的其他基础数据。
|
||||
|
||||
|field|default|comment|
|
||||
|--|--|--|
|
||||
| `ignore` |false | 是否忽略数据。当为 true 时,数据不进行绘制。 |
|
||||
| `selected` | | 该数据项是否被选中。 |
|
||||
| `radius` | | 自定义半径。可用在饼图中自定义某个数据项的半径。 |
|
||||
|
||||
## `SerieSymbol`
|
||||
|
||||
Inherits or Implemented: [SymbolStyle](#SymbolStyle),[ISerieDataComponent](#ISerieDataComponent)
|
||||
@@ -1392,11 +1458,10 @@ Inherits or Implemented: [MainComponent](#MainComponent)
|
||||
| `location` | | 组件显示的位置。 [Location](Location)|
|
||||
| `workOnLine` |true | 组件是否对LineChart的LineStyle有效。 |
|
||||
| `workOnArea` |false | 组件是否对LineChart的AreaStyle有效。 |
|
||||
| `inRange` | | 定义 在选中范围中 的视觉颜色。 |
|
||||
| `outOfRange` | | 定义 在选中范围外 的视觉颜色。 |
|
||||
| `pieces` | | 分段式每一段的相关配置。 |
|
||||
| `inRange` | | 分段式每一段的相关配置。 |
|
||||
|
||||
## `VisualMapPieces`
|
||||
## `VisualMapRange`
|
||||
|
||||
Inherits or Implemented: [ChildComponent](#ChildComponent)
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
[QA 26: How do I use the background component? What are the conditions?](#How-do-I-use-the-background-component-What-are-the-conditions)
|
||||
[QA 27: Mesh can not have more than 65000 vertices?](#Mesh-cannot-have-more-than-65000-vertices)
|
||||
[QA 28: Why are the parameters set in Serie reset after they run?](#Why-are-the-parameters-set-in-Serie-reset-after-they-run)
|
||||
[QA 29: Why are many custom colors lost after upgrading to 1.6.0? How should I upgrade?](#Why_are_many_custom_colors_lost_after_upgrading_to_1_6_0_How_should_I_upgrade)
|
||||
|
||||
## How-to-adjust-the-margin-between-the-axis-and-the=-background
|
||||
|
||||
@@ -146,16 +145,6 @@ A: This is the limit of `UGUI` on the number of vertices for a single `Graphic`.
|
||||
|
||||
A: Check whether `RemoveData()` and add new `Serie` in the code. If you want to keep the configuration of `Serie`, you can only `ClearData()` which just clear data and then readd the data to the old serie.
|
||||
|
||||
## Why_are_many_custom_colors_lost_after_upgrading_to_1_6_0_How_should_I_upgrade
|
||||
|
||||
A: In version `1.6.0`, in order to reduce implicit conversion, all drawing related `Color` was changed to `Color32`, so some custom colors were lost. The main components affected are: `ItemStyle`, `LineStyle`, `AreaStyle`, `Vessel`, `VisualMap`, `AxisSplitArea`, `AxisSplitLine`, `GaugeAxis`,`SerieLabel`, etc. Can use the script [UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) to upgrade.
|
||||
The upgrade steps are as follows:
|
||||
1. Back up the project.
|
||||
2. Download or copy the script [UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) in the old project `Editor`, Change the `color` field inside to `color.clear` (because some fields may not exist in the old version).
|
||||
3. After compilation, the old version of color configuration file is exported through `menu bar -> XCharts-> ExportColorConfig` (the configuration file is saved by default to `color.config` under `Assets`).
|
||||
4. Upgrade `XCharts` to the latest version.
|
||||
5. The custom color can be restored by importing `color.config` through `menu bar -> XCharts-> ImportColorConfig` (if `color.config` is not under `Assets` of the upgraded project, copy it to this directory).
|
||||
|
||||
[XCharts Homepage](https://github.com/XCharts-Team/XCharts)</br>
|
||||
[XCharts API](XChartsAPI-EN.md)</br>
|
||||
[XCharts Configuration](XChartsConfiguration-EN.md)
|
||||
@@ -32,7 +32,6 @@
|
||||
[QA 26:如何使用背景组件?有什么条件限制?](#如何使用背景组件_有什么条件限制)
|
||||
[QA 27:Mesh can not have more than 65000 vertices?](#Mesh_cannot_have_more_than_65000_vertices)
|
||||
[QA 28:为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了)
|
||||
[QA 29:为什么升级到1.6.0版本后很多自定义颜色丢失了?应该如何升级?](#为什么升级到1_6_0版本后很多自定义颜色丢失了_应该如何升级)
|
||||
|
||||
## 如何调整坐标轴与背景的边距
|
||||
|
||||
@@ -150,18 +149,6 @@
|
||||
|
||||
答:检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。
|
||||
|
||||
## 为什么升级到1_6_0版本后很多自定义颜色丢失了_应该如何升级
|
||||
|
||||
答:1.6.0版本为了减少隐式转换,将所有的绘制相关的`Color`都改为了`Color32`,所以会导致一些自定义的颜色的丢失。影响到的主要组件有:`ItemStyle`,`LineStyle`,`AreaStyle`,`Vessel`,`VisualMap`,`AxisSplitArea`,`AxisSplitLine`,`GaugeAxis`,`SerieLabel`等。可以用脚本[UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)进行升级。
|
||||
升级步骤如下:
|
||||
1. 备份好你的项目。
|
||||
2. 先不升级`XCharts`,只下载或拷贝脚本[UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)放到旧项目的`Editor`下,由于旧版本可能不存在某些新版本才有的图表或者属性配置,可能会编译错误,需要处理按3,4步骤处理一下。
|
||||
3. 若是由`itemStyle.toColor2`引起的编译报错,可将导出地方的`itemStyle.toColor2`改为`Color.clear`;导入的地方注释掉即可。
|
||||
4. 若是由`LiquidChart`引起的编译报错,将所有涉及`LiquidChart`的地方都注释掉即可。
|
||||
5. 编译通过后,通过`菜单栏->XCharts->ExportColorConfig`导出旧版本的颜色配置文件(配置文件默认保存到`Assets`下的`color.config`)。
|
||||
6. 升级`XCharts`到最新版本。
|
||||
7. 通过`菜单栏->XCharts->ImportColorConfig`将`color.config`导入即可恢复自定义的颜色(如果`color.config`不在升级后的项目的`Assets`下的话需要拷贝到此目录下)。
|
||||
|
||||
[XCharts主页](https://github.com/XCharts-Team/XCharts)
|
||||
[XChartsAPI](XChartsAPI-ZH.md)
|
||||
[XCharts配置项手册](XChartsConfiguration-ZH.md)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
## 获取和导入 XCharts
|
||||
|
||||
1. 直接放入XCharts源码到项目
|
||||
1. 直接将XCharts源码到项目
|
||||
|
||||
下载好XCharts源码后,直接将XCharts目录拷贝到Unity项目工程的Assets目录下。
|
||||
|
||||
@@ -17,46 +17,46 @@
|
||||
|
||||
3. 通过`Package Manager`导入XCharts
|
||||
|
||||
对于Unity 2018.3以上版本,可通过 Package Manager来导入XCharts,打开Package Manager后,通过 `Add package form git URL...`,输入XCharts的github URL: https://github.com/XCharts-Team/XCharts.git#master 稍等片刻后即可使用XCharts。
|
||||
对于Unity 2018.3以上版本,可通过 Package Manager来导入XCharts,打开Package Manager后,通过 `Add package form git URL...`,输入XCharts3.0的GitHub URL: `https://github.com/XCharts-Team/XCharts.git#3.0` 稍等片刻后即可使用XCharts。
|
||||
|
||||
也可以直接将package加入到`manifest.json`文件:打开`Packages`目录下的`manifest.json`文件,在`dependencies`下加入:
|
||||
|
||||
``` json
|
||||
"com.monitor1394.xcharts": "https://github.com/XCharts-Team/XCharts.git#master",
|
||||
"com.monitor1394.xcharts": "https://github.com/XCharts-Team/XCharts.git#3.0",
|
||||
```
|
||||
|
||||
如需更新`XCharts`,删除`manifest.json`文件(部分Unity版本可能是packages-lock.json文件)的`lock`下的`com.monitor1394.xcharts`相关内容即会重新下载编译。
|
||||
|
||||
## 添加一个简单图表
|
||||
|
||||
在`Hierarchy`试图下右键或菜单栏`GameObject`下拉:`XCharts->LineChart`:
|
||||
|
||||

|
||||
|
||||
即可快速创建一个简单的折线图出来:
|
||||
在`Hierarchy`视图下右键或菜单栏`GameObject`下拉选择`XCharts->LineChart`,即可快速创建一个默认的折线图出来:
|
||||
|
||||

|
||||
|
||||
## 添加多个Seire
|
||||
|
||||
如何在上图的基础上添加两条折线呢,只需`Add Serie`按钮,选择对应的`Serie`类型即可:
|
||||
在`Inspector`视图,找到`LineChart`的面板,通过`Add Serie`按钮,可以添加第二条`Line`折线:
|
||||
|
||||

|
||||

|
||||
|
||||
## 添加其他组件
|
||||
|
||||
默认图表没有`Legend`,需要`Legend`组件可通过`Add Component`按钮添加:
|
||||
|
||||

|
||||
|
||||
## 添加Serie组件
|
||||
|
||||
如果需要给折线图区域填充颜色,可单独给`Serie`添加`Component`:
|
||||
Serie只自带了几个常见的组件,其他组件按需额外添加。比如,需要给折线图区域填充颜色,可单独给`Serie`添加`AreaStyle`组件:
|
||||
|
||||

|
||||

|
||||
|
||||
## 添加SerieData组件
|
||||
|
||||
如果需要个性化定制每个数据项的配置,可以单独给每个`SerieData`添加`Component`。比如我们给第一个折线图的第二个数据单独显示`Label`:
|
||||
如果需要个性化定制每个数据项的配置,可以单独给每个`SerieData`添加`Component`。比如我们给折线图的第二个数据单独显示`Label`:
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -68,11 +68,17 @@
|
||||
|
||||
## 如何快速调整参数
|
||||
|
||||
`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`试图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的。你改了也会变还原。
|
||||
`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`视图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的,即使改了也会在刷新时被还原回来。
|
||||
|
||||
快速定位你想要改的效果对应的组件。这就需要对组件有一定的了解。比如我们想要让X轴的轴线末端显示箭头,如何定位?第一步,X轴定位到`XAxis0`;第二步,轴线定位到`AxisLine`;最后,再去看`AxisLine`组件下有没有这样的参数可以实现这个效果。
|
||||
|
||||
`XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色例,如果`SerieData`的`ItemStyle`配置有颜色值,则优先用这个颜色值。
|
||||
`XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色为例:
|
||||
|
||||
1. 如果`SerieData`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
|
||||
2. 如果`Serie`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
|
||||
3. 否则颜色值取自主题`Theme`的`Color Palette`。
|
||||
|
||||
通常颜色值为0000时表示用主题默认颜色,配置为0或null时表示用主题默认配置。
|
||||
|
||||
## 用代码添加折线图
|
||||
|
||||
@@ -140,6 +146,7 @@ for (int i = 0; i < 10; i++)
|
||||
```
|
||||
|
||||
这样一个简单的折线图就出来了:
|
||||
|
||||

|
||||
|
||||
如果一个Chart里面有多个系列时,则Axis的data只需要加一次,不要多个循环加重复了。记住:Axis的数据个数要和Serie的数据个数一致。
|
||||
@@ -148,16 +155,38 @@ for (int i = 0; i < 10; i++)
|
||||
|
||||
你还可以用代码控制更多的参数,`Examples`下还有更多的其他例子,凡是`Inspector`上看到的可配置的参数,都可以通过代码来设置。[XCharts配置项手册](XChartsConfiguration-ZH.md)里面的所有参数都是可以通过代码控制的。
|
||||
|
||||
另外,除非定制,建议调用[XChartsAPI接口](https://github.com/XCharts-Team/XCharts/master/Documentation/XChartsAPI-ZH.md) 里面的接口,这些接口内部会做一些关联处理,比如刷新图表等。如果自己调用了内部组件的接口,需要自己处理刷新等其他问题。
|
||||
另外,除非定制,建议调用`Chart`下提供的`public`接口,特别是数据相关操作部分。这些接口内部会做一些关联处理,比如刷新图表等。常见的接口有:
|
||||
|
||||
1. `chart.ClearData()`:清空图表数据(不移除Series)
|
||||
2. `chart.RemoveData()`:清除图表数据(会移除所有Serie)
|
||||
3. `chart.AddSerie()`:添加Serie
|
||||
4. `chart.AddXAxisData()`:添加X轴数据
|
||||
5. `chart.AddData()`:添加Serie数据
|
||||
6. `chart.UpdateData()`:更新Serie数据
|
||||
7. `chart.UpdateXAxisData()`:更新X轴数据
|
||||
8. `chart.UpdateDataName()`:更新Serie数据的名字
|
||||
|
||||
XCharts内部有自动刷新机制,但也是在一定条件下。如果自己调用了内部组件的接口,碰到组件没有刷新,确实找不到原因的话,可以用以下两个接口强制刷新:
|
||||
|
||||
1. `chart.RefreshAllComponent()`:刷新图表组件,会重新初始化所有组件,不建议频繁待用。
|
||||
2. `chart.RefreshChart()`:刷新图表绘制,只刷新绘制部分,不会刷新组件文本,位置等部分。
|
||||
|
||||
## 使用TextMeshPro
|
||||
|
||||
XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换。可通过一下两种方式开启和关闭:
|
||||
XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换。可通过以下方式开启和关闭:
|
||||
|
||||

|
||||

|
||||
|
||||
开启后需要设置好TextMeshPro要用的全局字体,也可以在主题Theme里单独设置:
|
||||
|
||||

|
||||
建议在项目初就规划好是否使用TextMeshPro,在有很多图表的情况下再切换,可能导致某些图表无法正常初始化,这时可能需要每个图表单独的使用`Remove All Chart Object`来清理让图表重新初始化。
|
||||
|
||||
建议在项目初就规划好是否使用TextMeshPro,并设置好字体。在已有很多图表的情况下切换TMP时,可能某些图表无法自动刷新,可以手动点击`Rebuild Chart Object`按钮来重建图表,即可正常初始化。
|
||||
|
||||
开启了TMP项目在更新XCharts时,可能会碰到丢失了TMP引用而无法编译通过的问题,可通过以下两种方式解决:
|
||||
|
||||
1. 找到`XCharts.Runtime.asmdef`和`XCharts.Editor.asmdef`,手动加上 `TextMeshPro`的引用
|
||||
2. 移除`PlayerSetting`中`Scripting Define Symbols`的`dUI_TextMeshPro`宏
|
||||
|
||||
## 用代码改图表参数
|
||||
|
||||
@@ -180,7 +209,7 @@ xAxis.type = Axis.AxisType.Category;
|
||||
|
||||
### 改Serie的参数
|
||||
|
||||
新添加Serie:
|
||||
新添加的Serie:
|
||||
|
||||
```C#
|
||||
var serie = chart.AddSerie<Pie>();
|
||||
@@ -220,7 +249,7 @@ var serieData = chart.AddData(0, 20);
|
||||
//var serieData = serie.GetSerieData(0); //从已有数据中获取
|
||||
serieData.radius = 10;
|
||||
|
||||
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //启用SerieData的Component
|
||||
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件
|
||||
itemStyle.color = Color.blue;
|
||||
|
||||
```
|
||||
|
||||
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 42 KiB |
@@ -1,76 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b533c6dca4e643c0a3cf0152ea053c3
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 30 KiB |
BIN
Documentation/res/wechat.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33ca1e807bf9b44daa62fa68040f7a17
|
||||
guid: c62c735b2989c4367b8c97b8ca75c216
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace XCharts.Editor
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace XCharts.Editor
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -45,7 +44,7 @@ namespace XCharts.Editor
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
if (target == null) return;
|
||||
m_Chart = (BaseChart)target;
|
||||
m_Chart = (BaseChart) target;
|
||||
m_Script = serializedObject.FindProperty("m_Script");
|
||||
m_EnableTextMeshPro = serializedObject.FindProperty("m_EnableTextMeshPro");
|
||||
m_ChartName = serializedObject.FindProperty("m_ChartName");
|
||||
@@ -172,7 +171,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
m_Series.Add(prop.GetArrayElementAtIndex(i));
|
||||
}
|
||||
m_Series.Sort(delegate (SerializedProperty a, SerializedProperty b)
|
||||
m_Series.Sort(delegate(SerializedProperty a, SerializedProperty b)
|
||||
{
|
||||
var index1 = a.FindPropertyRelative("m_Index").intValue;
|
||||
var index2 = b.FindPropertyRelative("m_Index").intValue;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -110,7 +109,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
if (IngorePropertys.Contains(relativePropName)) return;
|
||||
if (!ChartEditorHelper.PropertyFieldWithMinValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
|
||||
relativePropName, minValue))
|
||||
relativePropName, minValue))
|
||||
{
|
||||
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
|
||||
}
|
||||
@@ -119,7 +118,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
if (IngorePropertys.Contains(relativePropName)) return;
|
||||
if (!ChartEditorHelper.PropertyFieldWithMaxValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
|
||||
relativePropName, maxValue))
|
||||
relativePropName, maxValue))
|
||||
{
|
||||
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
|
||||
}
|
||||
@@ -163,25 +162,40 @@ namespace XCharts.Editor
|
||||
}
|
||||
}
|
||||
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, bool relativePropEnable,
|
||||
params HeaderMenuInfo[] menus)
|
||||
params HeaderMenuInfo[] menus)
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePropName))
|
||||
{
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, null, relativePropEnable, menus);
|
||||
m_DisplayName, null, null, relativePropEnable, menus);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
var relativeProp = prop.FindPropertyRelative(relativePropName);
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, relativeProp, relativePropEnable, menus);
|
||||
m_DisplayName, relativeProp, null, relativePropEnable, menus);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DrawExtendeds(SerializedProperty prop)
|
||||
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, string relativePropName2,
|
||||
bool relativePropEnable, params HeaderMenuInfo[] menus)
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePropName))
|
||||
{
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, null, null, relativePropEnable, menus);
|
||||
}
|
||||
else
|
||||
{
|
||||
var relativeProp = prop.FindPropertyRelative(relativePropName);
|
||||
var relativeProp2 = prop.FindPropertyRelative(relativePropName2);
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, relativeProp, relativeProp2, relativePropEnable, menus);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DrawExtendeds(SerializedProperty prop) { }
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
var key = GetKeyName(prop);
|
||||
|
||||
26
Editor/ChildComponents/CommentItemDrawer.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(CommentItem), true)]
|
||||
public class CommentItemDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "CommentItem"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", "m_Content", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Content");
|
||||
PropertyField(prop, "m_Position");
|
||||
//PropertyField(prop, "m_MarkRect");
|
||||
//PropertyField(prop, "m_MarkStyle");
|
||||
PropertyField(prop, "m_LabelStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 418b81a68e59a4572ab57787b5362d5a
|
||||
guid: d485d6a729a1449cdb5032f380fba70f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
22
Editor/ChildComponents/CommentMarkStyleDrawer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(CommentMarkStyle), true)]
|
||||
public class CommentMarkStyleDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "MarkStyle"; } }
|
||||
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_LineStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6d8757fbd847419aaed450e020e827c
|
||||
guid: d74ed458b24774b129611ed816b6b6cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -59,6 +58,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
public override string ClassName { get { return "Axis"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(RadiusAxisTheme), true)]
|
||||
public class RadiusAxisThemeDrawer : BaseAxisThemeDrawer
|
||||
{
|
||||
@@ -67,8 +67,9 @@ namespace XCharts.Editor
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<string> {
|
||||
"m_TextBackgroundColor" ,
|
||||
return new List<string>
|
||||
{
|
||||
"m_TextBackgroundColor",
|
||||
"m_LineLength",
|
||||
"m_SplitLineLength",
|
||||
};
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -23,4 +22,22 @@ namespace XCharts.Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisItemStyle), true)]
|
||||
public class EmphasisItemStyleDrawer : ItemStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisItemStyle"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisLabelStyle), true)]
|
||||
public class EmphasisLabelStyleDrawer : LabelStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisLabel"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisLabelLine), true)]
|
||||
public class EmphasisLabelLineDrawer : LabelLineDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisLabelLine"; } }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -28,6 +27,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_Background");
|
||||
PropertyField(prop, "m_TextStyle");
|
||||
PropertyField(prop, "m_TextPadding");
|
||||
PropertyField(prop, "m_TextLimit");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -24,7 +23,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[CustomPropertyDrawer(typeof(LineArrow), true)]
|
||||
public class LineArrowStyleDrawer : BasePropertyDrawer
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -47,6 +46,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_AutoColor");
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(AxisTick), true)]
|
||||
public class AxisTickDrawer : BaseLineDrawer
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(SerieDataBaseInfo), true)]
|
||||
public class SerieDataBaseInfoDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "BaseInfo"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", false))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Ignore");
|
||||
PropertyField(prop, "m_Selected");
|
||||
PropertyField(prop, "m_Radius");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -16,7 +15,7 @@ namespace XCharts.Editor
|
||||
if (MakeComponentFoldout(prop, "m_Show", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
PropertyField(prop, "m_Type");
|
||||
if (type == SymbolType.Custom)
|
||||
{
|
||||
@@ -28,7 +27,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
PropertyField(prop, "m_Gap");
|
||||
PropertyField(prop, "m_SizeType");
|
||||
switch ((SymbolSizeType)prop.FindPropertyRelative("m_SizeType").enumValueIndex)
|
||||
switch ((SymbolSizeType) prop.FindPropertyRelative("m_SizeType").enumValueIndex)
|
||||
{
|
||||
case SymbolSizeType.Custom:
|
||||
PropertyField(prop, "m_Size");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -13,10 +12,10 @@ namespace XCharts.Editor
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset", () =>
|
||||
{
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
chart.settings.Reset();
|
||||
})))
|
||||
{
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
chart.settings.Reset();
|
||||
})))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_ReversePainter");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -16,7 +15,7 @@ namespace XCharts.Editor
|
||||
if (MakeComponentFoldout(prop, "m_Show", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
PropertyField(prop, "m_Type");
|
||||
if (type == SymbolType.Custom)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
#if dUI_TextMeshPro
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -20,17 +19,17 @@ namespace XCharts.Editor
|
||||
var defaultX = pos.x;
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset|Reset to theme default color", () =>
|
||||
{
|
||||
chart.theme.sharedTheme.ResetTheme();
|
||||
chart.RefreshAllComponent();
|
||||
}), new HeaderMenuInfo("Export|Export theme to asset for a new theme", () =>
|
||||
{
|
||||
ExportThemeWindow.target = chart;
|
||||
EditorWindow.GetWindow(typeof(ExportThemeWindow));
|
||||
}), new HeaderMenuInfo("Sync color to custom|Sync shared theme color to custom color", () =>
|
||||
{
|
||||
chart.theme.SyncSharedThemeColorToCustom();
|
||||
})))
|
||||
{
|
||||
chart.theme.sharedTheme.ResetTheme();
|
||||
chart.RefreshAllComponent();
|
||||
}), new HeaderMenuInfo("Export|Export theme to asset for a new theme", () =>
|
||||
{
|
||||
ExportThemeWindow.target = chart;
|
||||
EditorWindow.GetWindow(typeof(ExportThemeWindow));
|
||||
}), new HeaderMenuInfo("Sync color to custom|Sync shared theme color to custom color", () =>
|
||||
{
|
||||
chart.theme.SyncSharedThemeColorToCustom();
|
||||
})))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var chartNameList = XCThemeMgr.GetAllThemeNames();
|
||||
@@ -46,12 +45,12 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_SharedTheme");
|
||||
PropertyField(prop, "m_TransparentBackground");
|
||||
PropertyField(prop, "m_EnableCustomTheme");
|
||||
using (new EditorGUI.DisabledScope(!prop.FindPropertyRelative("m_EnableCustomTheme").boolValue))
|
||||
{
|
||||
PropertyField(prop, "m_CustomBackgroundColor");
|
||||
PropertyField(prop, "m_CustomColorPalette");
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
using(new EditorGUI.DisabledScope(!prop.FindPropertyRelative("m_EnableCustomTheme").boolValue))
|
||||
{
|
||||
PropertyField(prop, "m_CustomBackgroundColor");
|
||||
PropertyField(prop, "m_CustomColorPalette");
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ namespace XCharts.Editor
|
||||
private string m_ChartName;
|
||||
static void Init()
|
||||
{
|
||||
window = (ExportThemeWindow)EditorWindow.GetWindow(typeof(ExportThemeWindow), false, "Export Theme", true);
|
||||
window = (ExportThemeWindow) EditorWindow.GetWindow(typeof(ExportThemeWindow), false, "Export Theme", true);
|
||||
window.minSize = new Vector2(600, 50);
|
||||
window.maxSize = new Vector2(600, 50);
|
||||
window.Show();
|
||||
@@ -117,14 +116,14 @@ namespace XCharts.Editor
|
||||
}
|
||||
else if (IsAssetsExist(XCThemeMgr.GetThemeAssetPath(m_ChartName)))
|
||||
{
|
||||
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath="
|
||||
+ XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath=" +
|
||||
XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
}
|
||||
else
|
||||
{
|
||||
XCThemeMgr.ExportTheme(target.theme.sharedTheme, m_ChartName);
|
||||
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath="
|
||||
+ XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath=" +
|
||||
XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -13,7 +12,7 @@ namespace XCharts.Editor
|
||||
var m_Type = baseProperty.FindPropertyRelative("m_Type");
|
||||
var m_LogBase = baseProperty.FindPropertyRelative("m_LogBase");
|
||||
var m_MinMaxType = baseProperty.FindPropertyRelative("m_MinMaxType");
|
||||
var type = (Axis.AxisType)m_Type.enumValueIndex;
|
||||
var type = (Axis.AxisType) m_Type.enumValueIndex;
|
||||
EditorGUI.indentLevel++;
|
||||
if (component is ParallelAxis)
|
||||
{
|
||||
@@ -41,7 +40,7 @@ namespace XCharts.Editor
|
||||
if (type == Axis.AxisType.Value || type == Axis.AxisType.Time)
|
||||
{
|
||||
PropertyField("m_MinMaxType");
|
||||
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType)m_MinMaxType.enumValueIndex;
|
||||
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType) m_MinMaxType.enumValueIndex;
|
||||
switch (minMaxType)
|
||||
{
|
||||
case Axis.AxisMinMaxType.Default:
|
||||
@@ -95,13 +94,11 @@ namespace XCharts.Editor
|
||||
|
||||
[ComponentEditor(typeof(XAxis))]
|
||||
public class XAxisEditor : AxisEditor
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
[ComponentEditor(typeof(YAxis))]
|
||||
public class YAxisEditor : AxisEditor
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
[ComponentEditor(typeof(SingleAxis))]
|
||||
public class SingleAxisEditor : AxisEditor
|
||||
@@ -132,13 +129,11 @@ namespace XCharts.Editor
|
||||
|
||||
[ComponentEditor(typeof(RadiusAxis))]
|
||||
public class RadiusAxisEditor : AxisEditor
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
[ComponentEditor(typeof(ParallelAxis))]
|
||||
public class ParallelAxisEditor : AxisEditor
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
[CustomPropertyDrawer(typeof(AxisLabel), true)]
|
||||
public class AxisLabelDrawer : BasePropertyDrawer
|
||||
@@ -159,6 +154,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_ShowEndLabel");
|
||||
|
||||
PropertyField(prop, "m_Rotate");
|
||||
PropertyField(prop, "m_Offset");
|
||||
PropertyField(prop, "m_Distance");
|
||||
PropertyField(prop, "m_Formatter");
|
||||
PropertyField(prop, "m_NumericFormatter");
|
||||
@@ -168,6 +164,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_Background");
|
||||
PropertyField(prop, "m_TextStyle");
|
||||
PropertyField(prop, "m_TextPadding");
|
||||
PropertyField(prop, "m_TextLimit");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
18
Editor/MainComponents/CommentEditor.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[ComponentEditor(typeof(Comment))]
|
||||
public class CommentEditor : MainComponentEditor<Comment>
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField("m_LabelStyle");
|
||||
//PropertyField("m_MarkStyle");
|
||||
PropertyListField("m_Items", true);
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/MainComponents/CommentEditor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2364066bf3174aa39b79020266ce72d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -15,12 +14,14 @@ namespace XCharts.Editor
|
||||
PropertyField("m_ItemHeight");
|
||||
PropertyField("m_ItemGap");
|
||||
PropertyField("m_ItemAutoColor");
|
||||
PropertyField("m_ItemOpacity");
|
||||
PropertyField("m_SelectedMode");
|
||||
PropertyField("m_Orient");
|
||||
PropertyField("m_Formatter");
|
||||
PropertyField("m_Location");
|
||||
PropertyField("m_LabelStyle");
|
||||
PropertyListField("m_Icons");
|
||||
PropertyListField("m_Colors");
|
||||
PropertyListField("m_Data");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
@@ -28,12 +27,10 @@ namespace XCharts.Editor
|
||||
}
|
||||
|
||||
public virtual void OnEnable()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
public virtual void OnDisable()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
internal void OnInternalInspectorGUI()
|
||||
{
|
||||
@@ -42,12 +39,10 @@ namespace XCharts.Editor
|
||||
}
|
||||
|
||||
public virtual void OnInspectorGUI()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
protected virtual void DrawExtendeds()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
public virtual string GetDisplayTitle()
|
||||
{
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
public class MainComponentEditor<T> : MainComponentBaseEditor
|
||||
where T : MainComponent
|
||||
{
|
||||
}
|
||||
where T : MainComponent
|
||||
{ }
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Assertions;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine.Assertions;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
@@ -84,7 +83,7 @@ namespace XCharts.Editor
|
||||
editor.showProperty,
|
||||
() => { ResetComponentEditor(id); },
|
||||
() => { RemoveComponentEditor(id); }
|
||||
);
|
||||
);
|
||||
if (displayContent)
|
||||
{
|
||||
editor.OnInternalInspectorGUI();
|
||||
@@ -120,7 +119,7 @@ namespace XCharts.Editor
|
||||
|
||||
if (!m_EditorTypes.TryGetValue(settingsType, out editorType))
|
||||
editorType = typeof(MainComponentBaseEditor);
|
||||
var editor = (MainComponentBaseEditor)Activator.CreateInstance(editorType);
|
||||
var editor = (MainComponentBaseEditor) Activator.CreateInstance(editorType);
|
||||
editor.Init(chart, component, property, m_BaseEditor);
|
||||
|
||||
if (index < 0)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -31,7 +30,7 @@ namespace XCharts.Editor
|
||||
if (MakeComponentFoldout(prop, "", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (MarkAreaType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
|
||||
var type = (MarkAreaType) (prop.FindPropertyRelative("m_Type")).enumValueIndex;
|
||||
PropertyField(prop, "m_Type");
|
||||
PropertyField(prop, "m_Name");
|
||||
switch (type)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -28,7 +27,7 @@ namespace XCharts.Editor
|
||||
if (MakeComponentFoldout(prop, "", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (MarkLineType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
|
||||
var type = (MarkLineType) (prop.FindPropertyRelative("m_Type")).enumValueIndex;
|
||||
var group = prop.FindPropertyRelative("m_Group").intValue;
|
||||
PropertyField(prop, "m_Type");
|
||||
PropertyField(prop, "m_Name");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -12,7 +10,14 @@ namespace XCharts.Editor
|
||||
[CustomEditor(typeof(Theme))]
|
||||
public class ThemeEditor : UnityEditor.Editor
|
||||
{
|
||||
static class Styles
|
||||
{
|
||||
internal static GUIContent btnReset = new GUIContent("Reset", "Reset to default theme");
|
||||
internal static GUIContent btnSync = new GUIContent("Sync Font", "Sync main theme font to sub theme font");
|
||||
}
|
||||
|
||||
private Theme m_Theme;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
m_Theme = target as Theme;
|
||||
@@ -20,15 +25,15 @@ namespace XCharts.Editor
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
// serializedObject.Update();
|
||||
// EditorGUILayout.PropertyField(m_BackgroundColor);
|
||||
// EditorGUILayout.PropertyField(m_ColorPalette);
|
||||
// serializedObject.ApplyModifiedProperties();
|
||||
base.OnInspectorGUI();
|
||||
if (GUILayout.Button(new GUIContent("Reset", "Reset to default theme")))
|
||||
if (GUILayout.Button(Styles.btnReset))
|
||||
{
|
||||
m_Theme.ResetTheme();
|
||||
}
|
||||
if (GUILayout.Button(Styles.btnSync))
|
||||
{
|
||||
m_Theme.SyncFontToSubComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -11,7 +10,7 @@ namespace XCharts.Editor
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (VisualMap.Type)baseProperty.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
var type = (VisualMap.Type) baseProperty.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
var isPiece = type == VisualMap.Type.Piecewise;
|
||||
PropertyField("m_Type");
|
||||
PropertyField("m_SerieIndex");
|
||||
@@ -39,19 +38,19 @@ namespace XCharts.Editor
|
||||
PropertyField("m_Location");
|
||||
}
|
||||
PropertyListField("m_OutOfRange");
|
||||
PropertyListField(isPiece ? "m_Pieces" : "m_InRange");
|
||||
PropertyListField("m_InRange");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(VisualMapPieces), true)]
|
||||
public class PiecesDrawer : BasePropertyDrawer
|
||||
[CustomPropertyDrawer(typeof(VisualMapRange), true)]
|
||||
public class VisualMapRangeDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "Pieces"; } }
|
||||
public override string ClassName { get { return "Range"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeFoldout(prop, ""))
|
||||
if (MakeFoldout(prop, "m_Color"))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Min");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
PropertyField("m_RadarType");
|
||||
PropertyField("m_RadarIndex");
|
||||
|
||||
|
||||
PropertyField("m_Symbol");
|
||||
PropertyField("m_LineStyle");
|
||||
PropertyField("m_ItemStyle");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
@@ -17,6 +16,7 @@ namespace XCharts.Editor
|
||||
internal SerializedProperty baseProperty;
|
||||
internal SerializedProperty showProperty;
|
||||
internal List<HeaderMenuInfo> menus = new List<HeaderMenuInfo>();
|
||||
internal List<HeaderMenuInfo> serieDataMenus = new List<HeaderMenuInfo>();
|
||||
protected Dictionary<string, Type> m_CoordOptionsDic;
|
||||
protected List<string> m_CoordOptionsNames;
|
||||
private string m_DisplayName;
|
||||
@@ -62,12 +62,10 @@ namespace XCharts.Editor
|
||||
}
|
||||
|
||||
public virtual void OnEnable()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
public virtual void OnDisable()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
internal void OnInternalInspectorGUI()
|
||||
{
|
||||
@@ -76,12 +74,10 @@ namespace XCharts.Editor
|
||||
}
|
||||
|
||||
public virtual void OnInspectorGUI()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
protected virtual void DrawExtendeds()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
public virtual string GetDisplayTitle()
|
||||
{
|
||||
@@ -136,11 +132,11 @@ namespace XCharts.Editor
|
||||
{
|
||||
case SerializedPropertyType.Float:
|
||||
if (prop.floatValue < min)
|
||||
prop.floatValue = (float)min;
|
||||
prop.floatValue = (float) min;
|
||||
break;
|
||||
case SerializedPropertyType.Integer:
|
||||
if (prop.intValue < min)
|
||||
prop.intValue = (int)min;
|
||||
prop.intValue = (int) min;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -152,11 +148,11 @@ namespace XCharts.Editor
|
||||
{
|
||||
case SerializedPropertyType.Float:
|
||||
if (prop.floatValue > max)
|
||||
prop.floatValue = (float)max;
|
||||
prop.floatValue = (float) max;
|
||||
break;
|
||||
case SerializedPropertyType.Integer:
|
||||
if (prop.intValue > max)
|
||||
prop.intValue = (int)max;
|
||||
prop.intValue = (int) max;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -36,12 +35,11 @@ namespace XCharts.Editor
|
||||
}
|
||||
|
||||
public virtual void OnCustomInspectorGUI()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
private void OnExtraInspectorGUI()
|
||||
{
|
||||
foreach (var kv in Serie.extraComponentFieldNameDict)
|
||||
foreach (var kv in Serie.extraComponentMap)
|
||||
{
|
||||
var prop = FindProperty(kv.Value);
|
||||
if (prop.arraySize > 0)
|
||||
@@ -52,11 +50,11 @@ namespace XCharts.Editor
|
||||
private void PropertyFieldData()
|
||||
{
|
||||
m_DataFoldout = ChartEditorHelper.DrawHeader("Data", m_DataFoldout, false, null, null,
|
||||
new HeaderMenuInfo("Import ECharts Data", () =>
|
||||
{
|
||||
PraseExternalDataEditor.UpdateData(chart, serie, null);
|
||||
PraseExternalDataEditor.ShowWindow();
|
||||
}));
|
||||
new HeaderMenuInfo("Import ECharts Data", () =>
|
||||
{
|
||||
PraseExternalDataEditor.UpdateData(chart, serie, null);
|
||||
PraseExternalDataEditor.ShowWindow();
|
||||
}));
|
||||
if (!m_DataFoldout) return;
|
||||
EditorGUI.indentLevel++;
|
||||
var m_Datas = FindProperty("m_Data");
|
||||
@@ -75,7 +73,7 @@ namespace XCharts.Editor
|
||||
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
|
||||
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
|
||||
}
|
||||
if (listSize > 30)// && !XCSettings.editorShowAllListData)
|
||||
if (listSize > 30) // && !XCSettings.editorShowAllListData)
|
||||
{
|
||||
int num = listSize > 10 ? 10 : listSize;
|
||||
for (int i = 0; i < num; i++)
|
||||
@@ -117,69 +115,69 @@ namespace XCharts.Editor
|
||||
}
|
||||
var fieldCount = dimension + (showName ? 1 : 0);
|
||||
m_DataElementFoldout[index] = ChartEditorHelper.DrawHeader("SerieData " + index, flag, false, null,
|
||||
delegate (Rect drawRect)
|
||||
{
|
||||
//drawRect.width -= 2f;
|
||||
var maxX = drawRect.xMax;
|
||||
var currentWidth = drawRect.width;
|
||||
var lastX = drawRect.x;
|
||||
var lastWid = drawRect.width;
|
||||
var lastFieldWid = EditorGUIUtility.fieldWidth;
|
||||
var lastLabelWid = EditorGUIUtility.labelWidth;
|
||||
var serieData = m_Datas.GetArrayElementAtIndex(index);
|
||||
var sereName = serieData.FindPropertyRelative("m_Name");
|
||||
var data = serieData.FindPropertyRelative("m_Data");
|
||||
delegate(Rect drawRect)
|
||||
{
|
||||
//drawRect.width -= 2f;
|
||||
var maxX = drawRect.xMax;
|
||||
var currentWidth = drawRect.width;
|
||||
var lastX = drawRect.x;
|
||||
var lastWid = drawRect.width;
|
||||
var lastFieldWid = EditorGUIUtility.fieldWidth;
|
||||
var lastLabelWid = EditorGUIUtility.labelWidth;
|
||||
var serieData = m_Datas.GetArrayElementAtIndex(index);
|
||||
var sereName = serieData.FindPropertyRelative("m_Name");
|
||||
var data = serieData.FindPropertyRelative("m_Data");
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
var gap = 2;
|
||||
var namegap = 3;
|
||||
var gap = 2;
|
||||
var namegap = 3;
|
||||
#else
|
||||
var gap = 0;
|
||||
var namegap = 0;
|
||||
var gap = 0;
|
||||
var namegap = 0;
|
||||
#endif
|
||||
if (fieldCount <= 1)
|
||||
{
|
||||
while (2 > data.arraySize)
|
||||
if (fieldCount <= 1)
|
||||
{
|
||||
var value = data.arraySize == 0 ? index : 0;
|
||||
data.arraySize++;
|
||||
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
|
||||
}
|
||||
SerializedProperty element = data.GetArrayElementAtIndex(1);
|
||||
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
|
||||
drawRect.x = startX;
|
||||
drawRect.xMax = maxX;
|
||||
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
|
||||
}
|
||||
else
|
||||
{
|
||||
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
|
||||
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
|
||||
var dataWid = dataWidTotal / fieldCount;
|
||||
var xWid = dataWid - 2;
|
||||
for (int i = 0; i < dimension; i++)
|
||||
{
|
||||
var dataCount = i < 1 ? 2 : i + 1;
|
||||
while (dataCount > data.arraySize)
|
||||
while (2 > data.arraySize)
|
||||
{
|
||||
var value = data.arraySize == 0 ? index : 0;
|
||||
data.arraySize++;
|
||||
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
|
||||
}
|
||||
drawRect.x = startX + i * xWid;
|
||||
drawRect.width = dataWid + 25;
|
||||
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
|
||||
SerializedProperty element = data.GetArrayElementAtIndex(1);
|
||||
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
|
||||
drawRect.x = startX;
|
||||
drawRect.xMax = maxX;
|
||||
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
|
||||
}
|
||||
if (showName)
|
||||
else
|
||||
{
|
||||
drawRect.x = startX + (fieldCount - 1) * xWid;
|
||||
drawRect.width = dataWid + 40 + dimension * namegap - 2.5f;
|
||||
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
|
||||
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
|
||||
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
|
||||
var dataWid = dataWidTotal / fieldCount;
|
||||
var xWid = dataWid - 2;
|
||||
for (int i = 0; i < dimension; i++)
|
||||
{
|
||||
var dataCount = i < 1 ? 2 : i + 1;
|
||||
while (dataCount > data.arraySize)
|
||||
{
|
||||
var value = data.arraySize == 0 ? index : 0;
|
||||
data.arraySize++;
|
||||
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
|
||||
}
|
||||
drawRect.x = startX + i * xWid;
|
||||
drawRect.width = dataWid + 25;
|
||||
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
|
||||
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
|
||||
}
|
||||
if (showName)
|
||||
{
|
||||
drawRect.x = startX + (fieldCount - 1) * xWid;
|
||||
drawRect.width = dataWid + 40 + dimension * namegap - 2.5f;
|
||||
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
|
||||
}
|
||||
EditorGUIUtility.fieldWidth = lastFieldWid;
|
||||
EditorGUIUtility.labelWidth = lastLabelWid;
|
||||
}
|
||||
EditorGUIUtility.fieldWidth = lastFieldWid;
|
||||
EditorGUIUtility.labelWidth = lastLabelWid;
|
||||
}
|
||||
});
|
||||
});
|
||||
if (m_DataElementFoldout[index])
|
||||
{
|
||||
if (!(serie is ISimplifiedSerie))
|
||||
@@ -192,113 +190,53 @@ namespace XCharts.Editor
|
||||
EditorGUI.indentLevel++;
|
||||
var serieData = m_Datas.GetArrayElementAtIndex(index);
|
||||
var m_Name = serieData.FindPropertyRelative("m_Name");
|
||||
var m_Id = serieData.FindPropertyRelative("m_Id");
|
||||
var m_ParentId = serieData.FindPropertyRelative("m_ParentId");
|
||||
|
||||
var m_BaseInfo = serieData.FindPropertyRelative("m_BaseInfos");
|
||||
var m_Label = serieData.FindPropertyRelative("m_Labels");
|
||||
var m_ItemStyle = serieData.FindPropertyRelative("m_ItemStyles");
|
||||
var m_Emphasis = serieData.FindPropertyRelative("m_Emphases");
|
||||
var m_Symbol = serieData.FindPropertyRelative("m_Symbols");
|
||||
var m_LineStyle = serieData.FindPropertyRelative("m_LineStyles");
|
||||
var m_AreaStyle = serieData.FindPropertyRelative("m_AreaStyles");
|
||||
var m_TitleStyle = serieData.FindPropertyRelative("m_TitleStyles");
|
||||
|
||||
PropertyField(m_Name);
|
||||
PropertyField(m_Id);
|
||||
PropertyField(m_ParentId);
|
||||
if (serie.GetType().IsDefined(typeof(SerieDataExtraFieldAttribute), false))
|
||||
{
|
||||
var attribute = serie.GetType().GetAttribute<SerieDataExtraFieldAttribute>();
|
||||
foreach (var field in attribute.fields)
|
||||
{
|
||||
PropertyField(serieData.FindPropertyRelative(field));
|
||||
}
|
||||
}
|
||||
|
||||
var componentNum = m_BaseInfo.arraySize + m_Label.arraySize + m_ItemStyle.arraySize + m_Emphasis.arraySize
|
||||
+ m_Symbol.arraySize + m_LineStyle.arraySize + m_AreaStyle.arraySize;
|
||||
var title = "Component";
|
||||
if (componentNum == 0) title += " (None)";
|
||||
m_DataComponentFoldout = ChartEditorHelper.DrawHeader(title, m_DataComponentFoldout, false, null, null,
|
||||
new HeaderMenuInfo("Add BaseInfo", () =>
|
||||
serieDataMenus.Clear();
|
||||
if (serie.GetType().IsDefined(typeof(SerieDataExtraComponentAttribute), false))
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<SerieDataBaseInfo>();
|
||||
}, m_BaseInfo.arraySize == 0),
|
||||
new HeaderMenuInfo("Add ItemStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<ItemStyle>();
|
||||
}, m_ItemStyle.arraySize == 0),
|
||||
new HeaderMenuInfo("Add Label", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<LabelStyle>();
|
||||
}, m_Label.arraySize == 0),
|
||||
new HeaderMenuInfo("Add Emphasis", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<Emphasis>();
|
||||
}, m_Emphasis.arraySize == 0),
|
||||
new HeaderMenuInfo("Add Symbol", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<SerieSymbol>();
|
||||
}, m_Symbol.arraySize == 0),
|
||||
new HeaderMenuInfo("Add LineStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<LineStyle>();
|
||||
}, m_LineStyle.arraySize == 0),
|
||||
new HeaderMenuInfo("Add AreaStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<AreaStyle>();
|
||||
}, m_AreaStyle.arraySize == 0),
|
||||
new HeaderMenuInfo("Add TitleStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent<TitleStyle>();
|
||||
}, m_TitleStyle.arraySize == 0),
|
||||
new HeaderMenuInfo("Remove BaseInfo", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<SerieDataBaseInfo>();
|
||||
}, m_BaseInfo.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove ItemStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<ItemStyle>();
|
||||
}, m_ItemStyle.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove Label", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<LabelStyle>();
|
||||
}, m_Label.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove Emphasis", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<Emphasis>();
|
||||
}, m_Emphasis.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove Symbol", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<SerieSymbol>();
|
||||
}, m_Symbol.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove LineStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<LineStyle>();
|
||||
}, m_LineStyle.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove AreaStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<AreaStyle>();
|
||||
}, m_AreaStyle.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove TitleStyle", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent<TitleStyle>();
|
||||
}, m_TitleStyle.arraySize > 0),
|
||||
new HeaderMenuInfo("Remove All", () =>
|
||||
var attribute = serie.GetType().GetAttribute<SerieDataExtraComponentAttribute>();
|
||||
foreach (var type in attribute.types)
|
||||
{
|
||||
var size = serieData.FindPropertyRelative(SerieData.extraComponentMap[type]).arraySize;
|
||||
serieDataMenus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
|
||||
{
|
||||
serie.GetSerieData(index).GetOrAddComponent(type);
|
||||
EditorUtility.SetDirty(chart);
|
||||
}, size == 0));
|
||||
}
|
||||
foreach (var type in attribute.types)
|
||||
{
|
||||
var size = serieData.FindPropertyRelative(SerieData.extraComponentMap[type]).arraySize;
|
||||
serieDataMenus.Add(new HeaderMenuInfo("Remove " + type.Name, () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveComponent(type);
|
||||
EditorUtility.SetDirty(chart);
|
||||
}, size > 0));
|
||||
}
|
||||
}
|
||||
serieDataMenus.Add(new HeaderMenuInfo("Remove All", () =>
|
||||
{
|
||||
serie.GetSerieData(index).RemoveAllComponent();
|
||||
}, componentNum > 0));
|
||||
}, true));
|
||||
m_DataComponentFoldout = ChartEditorHelper.DrawHeader("Component", m_DataComponentFoldout, false, null, null, serieDataMenus);
|
||||
if (m_DataComponentFoldout)
|
||||
{
|
||||
if (m_BaseInfo.arraySize > 0)
|
||||
PropertyField(m_BaseInfo.GetArrayElementAtIndex(0));
|
||||
if (m_Label.arraySize > 0)
|
||||
PropertyField(m_Label.GetArrayElementAtIndex(0));
|
||||
if (m_ItemStyle.arraySize > 0)
|
||||
PropertyField(m_ItemStyle.GetArrayElementAtIndex(0));
|
||||
if (m_Emphasis.arraySize > 0)
|
||||
PropertyField(m_Emphasis.GetArrayElementAtIndex(0));
|
||||
if (m_Symbol.arraySize > 0)
|
||||
PropertyField(m_Symbol.GetArrayElementAtIndex(0));
|
||||
if (m_LineStyle.arraySize > 0)
|
||||
PropertyField(m_LineStyle.GetArrayElementAtIndex(0));
|
||||
if (m_AreaStyle.arraySize > 0)
|
||||
PropertyField(m_AreaStyle.GetArrayElementAtIndex(0));
|
||||
if (m_TitleStyle.arraySize > 0)
|
||||
PropertyField(m_TitleStyle.GetArrayElementAtIndex(0));
|
||||
foreach (var kv in SerieData.extraComponentMap)
|
||||
{
|
||||
var prop = serieData.FindPropertyRelative(kv.Value);
|
||||
if (prop.arraySize > 0)
|
||||
PropertyField(prop.GetArrayElementAtIndex(0));
|
||||
}
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Assertions;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine.Assertions;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
@@ -22,7 +21,6 @@ namespace XCharts.Editor
|
||||
List<SerieBaseEditor> m_Editors;
|
||||
private bool m_SerieFoldout;
|
||||
|
||||
|
||||
public SerieListEditor(BaseChartEditor editor)
|
||||
{
|
||||
Assert.IsNotNull(editor);
|
||||
@@ -136,7 +134,7 @@ namespace XCharts.Editor
|
||||
|
||||
if (!m_EditorTypes.TryGetValue(settingsType, out editorType))
|
||||
editorType = typeof(SerieBaseEditor);
|
||||
var editor = (SerieBaseEditor)Activator.CreateInstance(editorType);
|
||||
var editor = (SerieBaseEditor) Activator.CreateInstance(editorType);
|
||||
editor.Init(chart, serie, property, m_BaseEditor);
|
||||
editor.menus.Clear();
|
||||
editor.menus.Add(new HeaderMenuInfo("Clone", () =>
|
||||
@@ -176,7 +174,7 @@ namespace XCharts.Editor
|
||||
var attribute = editor.serie.GetType().GetAttribute<SerieExtraComponentAttribute>();
|
||||
foreach (var type in attribute.types)
|
||||
{
|
||||
var size = editor.FindProperty(Serie.extraComponentFieldNameDict[type]).arraySize;
|
||||
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
|
||||
editor.menus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
|
||||
{
|
||||
editor.serie.AddExtraComponent(type);
|
||||
@@ -187,7 +185,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
foreach (var type in attribute.types)
|
||||
{
|
||||
var size = editor.FindProperty(Serie.extraComponentFieldNameDict[type]).arraySize;
|
||||
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
|
||||
editor.menus.Add(new HeaderMenuInfo("Remove " + type.Name, () =>
|
||||
{
|
||||
editor.serie.RemoveExtraComponent(type);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
@@ -53,7 +52,7 @@ namespace XCharts.Editor
|
||||
|
||||
public static void SecondField(Rect drawRect, SerializedProperty prop)
|
||||
{
|
||||
RectOffset offset = new RectOffset(-(int)EditorGUIUtility.labelWidth, 0, 0, 0);
|
||||
RectOffset offset = new RectOffset(-(int) EditorGUIUtility.labelWidth, 0, 0, 0);
|
||||
drawRect = offset.Add(drawRect);
|
||||
EditorGUI.PropertyField(drawRect, prop, GUIContent.none);
|
||||
drawRect = offset.Remove(drawRect);
|
||||
@@ -166,7 +165,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
public static bool MakeComponentFoldout(ref Rect drawRect, Dictionary<string, float> heights,
|
||||
Dictionary<string, bool> moduleToggle, string key, string content, SerializedProperty prop,
|
||||
bool propEnable, params HeaderMenuInfo[] menus)
|
||||
SerializedProperty prop2, bool propEnable, params HeaderMenuInfo[] menus)
|
||||
{
|
||||
var sourRect = drawRect;
|
||||
float defaultWidth = drawRect.width;
|
||||
@@ -181,10 +180,16 @@ namespace XCharts.Editor
|
||||
if (prop.propertyType == SerializedPropertyType.Boolean)
|
||||
{
|
||||
if (!propEnable)
|
||||
using (new EditorGUI.DisabledScope(true))
|
||||
MakeBool(drawRect, prop);
|
||||
using(new EditorGUI.DisabledScope(true))
|
||||
MakeBool(drawRect, prop);
|
||||
else
|
||||
MakeBool(drawRect, prop);
|
||||
if (prop2 != null && !moduleToggle[key])
|
||||
{
|
||||
drawRect.x = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + ARROW_WIDTH + BOOL_WIDTH;
|
||||
drawRect.width = defaultWidth - drawRect.x + ARROW_WIDTH;
|
||||
EditorGUI.PropertyField(drawRect, prop2, GUIContent.none);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -201,8 +206,6 @@ namespace XCharts.Editor
|
||||
return moduleToggle[key];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void MakeBool(Rect drawRect, SerializedProperty boolProp, int index = 0, string name = null)
|
||||
{
|
||||
float defaultWidth = drawRect.width;
|
||||
@@ -378,9 +381,9 @@ namespace XCharts.Editor
|
||||
{
|
||||
var temp = INDENT_WIDTH + GAP_WIDTH + iconGap;
|
||||
var isSerie = "Serie".Equals(element.type);
|
||||
var elementRect = isSerie
|
||||
? new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH - 2 * iconGap, drawRect.height)
|
||||
: new Rect(drawRect.x, drawRect.y, drawRect.width - 3 * iconWidth, drawRect.height);
|
||||
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 - 3 * iconWidth, drawRect.height);
|
||||
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
|
||||
var iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
||||
var oldColor = GUI.contentColor;
|
||||
@@ -436,7 +439,7 @@ namespace XCharts.Editor
|
||||
if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue < minValue)
|
||||
prop.floatValue = minValue;
|
||||
if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue < minValue)
|
||||
prop.intValue = (int)minValue;
|
||||
prop.intValue = (int) minValue;
|
||||
var hig = EditorGUI.GetPropertyHeight(prop);
|
||||
drawRect.y += hig;
|
||||
heights[key] += hig;
|
||||
@@ -451,7 +454,7 @@ namespace XCharts.Editor
|
||||
if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue > maxValue)
|
||||
prop.floatValue = maxValue;
|
||||
if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue > maxValue)
|
||||
prop.intValue = (int)maxValue;
|
||||
prop.intValue = (int) maxValue;
|
||||
var hig = EditorGUI.GetPropertyHeight(prop);
|
||||
drawRect.y += hig;
|
||||
heights[key] += hig;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -9,12 +7,11 @@ namespace XCharts.Editor
|
||||
{
|
||||
static readonly Color splitterDark = new Color(0.12f, 0.12f, 0.12f, 0.5f);
|
||||
static readonly Color splitterLight = new Color(0.6f, 0.6f, 0.6f, 0.5f);
|
||||
static readonly Texture2D paneOptionsIconDark = (Texture2D)EditorGUIUtility.Load("Builtin Skins/DarkSkin/Images/pane options.png");
|
||||
static readonly Texture2D paneOptionsIconLight = (Texture2D)EditorGUIUtility.Load("Builtin Skins/LightSkin/Images/pane options.png");
|
||||
static readonly Texture2D paneOptionsIconDark = (Texture2D) EditorGUIUtility.Load("Builtin Skins/DarkSkin/Images/pane options.png");
|
||||
static readonly Texture2D paneOptionsIconLight = (Texture2D) EditorGUIUtility.Load("Builtin Skins/LightSkin/Images/pane options.png");
|
||||
static readonly Color headerBackgroundDark = new Color(0.1f, 0.1f, 0.1f, 0.2f);
|
||||
static readonly Color headerBackgroundLight = new Color(1f, 1f, 1f, 0.2f);
|
||||
|
||||
|
||||
public static readonly GUIStyle headerStyle = UnityEditor.EditorStyles.boldLabel;
|
||||
public static readonly GUIStyle foldoutStyle = new GUIStyle(UnityEditor.EditorStyles.foldout)
|
||||
{
|
||||
@@ -28,7 +25,6 @@ namespace XCharts.Editor
|
||||
public static readonly GUIStyle invisibleButton = "InvisibleButton";
|
||||
public static readonly GUIStyle smallTickbox = new GUIStyle("ShurikenToggle");
|
||||
|
||||
|
||||
public static Color splitter { get { return EditorGUIUtility.isProSkin ? splitterDark : splitterLight; } }
|
||||
public static Texture2D paneOptionsIcon { get { return EditorGUIUtility.isProSkin ? paneOptionsIconDark : paneOptionsIconLight; } }
|
||||
public static Color headerBackground { get { return EditorGUIUtility.isProSkin ? headerBackgroundDark : headerBackgroundLight; } }
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
@@ -194,8 +193,7 @@ namespace XCharts.Editor
|
||||
else if (a.StartsWith("selected:"))
|
||||
{
|
||||
string selected = a.Substring(9, a.Length - 9);
|
||||
var baseInfo = serieData.GetOrAddComponent<SerieDataBaseInfo>();
|
||||
baseInfo.selected = bool.Parse(selected);
|
||||
serieData.selected = bool.Parse(selected);
|
||||
}
|
||||
}
|
||||
serie.AddSerieData(serieData);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -20,10 +19,8 @@ namespace XCharts.Editor
|
||||
{
|
||||
XCResourcesImporter m_ResourceImporter;
|
||||
|
||||
public XCResourceImporterProvider()
|
||||
: base("Project/XCharts", SettingsScope.Project)
|
||||
{
|
||||
}
|
||||
public XCResourceImporterProvider() : base("Project/XCharts", SettingsScope.Project)
|
||||
{ }
|
||||
|
||||
public override void OnGUI(string searchContext)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
@@ -134,6 +133,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
AddChart<CandlestickChart>("CandlestickChart");
|
||||
}
|
||||
|
||||
[MenuItem("XCharts/PolarChart", priority = 54)]
|
||||
[MenuItem("GameObject/XCharts/PolarChart", priority = 54)]
|
||||
public static void PolarChart()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -278,13 +277,21 @@ namespace XCharts.Example
|
||||
visualMap.range[0] = 0;
|
||||
visualMap.range[1] = 100;
|
||||
|
||||
var colors = new List<string>{"#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf",
|
||||
"#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026"};
|
||||
visualMap.inRange.Clear();
|
||||
foreach (var str in colors)
|
||||
var colors = new List<string>
|
||||
{
|
||||
visualMap.inRange.Add(ThemeStyle.GetColor(str));
|
||||
}
|
||||
"#313695",
|
||||
"#4575b4",
|
||||
"#74add1",
|
||||
"#abd9e9",
|
||||
"#e0f3f8",
|
||||
"#ffffbf",
|
||||
"#fee090",
|
||||
"#fdae61",
|
||||
"#f46d43",
|
||||
"#d73027",
|
||||
"#a50026"
|
||||
};
|
||||
visualMap.AddColors(colors);
|
||||
var grid = chart.GetChartComponent<GridCoord>();
|
||||
grid.left = 80;
|
||||
grid.bottom = 100;
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using XCharts.Runtime;
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||