增加Background背景组件

This commit is contained in:
monitor1394
2020-05-21 08:32:52 +08:00
parent 116d931e45
commit 920c4ea2a5
14 changed files with 387 additions and 19 deletions

View File

@@ -62,6 +62,7 @@
* `BaseChart.ClickLegendButton(int legendIndex, string legendName, bool show)`:点击图例按钮。
* `BaseChart.IsInChart(Vector2 local)`:坐标是否在图表范围内。
* `BaseChart.IsInChart(float x, float y)`:坐标是否在图表范围内。
* `BaseChart.EnableBackground(bool flag)`:开启背景组件。背景组件在`chart`受上层布局控制时无法开启。
## `CoordinateChart`

View File

@@ -7,6 +7,7 @@
主组件:
* [Axis 坐标轴](#XAxis)
* [Background 背景图](#Background)
* [DataZoom 区域缩放](#DataZoom)
* [Grid 网格](#Grid)
* [Legend 图例](#Legend)
@@ -342,6 +343,21 @@
* `IsValue()`:是否为数值轴。
* `AddData(string category, int maxDataNumber)`:添加一个类目到类目数据列表。
## `Background`
背景组件。
由于框架的局限性,背景组件在`chart`受上层布局控制时不适用。因为背景组件节点和`chart`节点是同一级的。
自动布局下的一种解决方案是,可以将`chart`节点再包一层`parent`
背景组件的开启需要通过接口来开启:`BaseChart.EnableBackground(bool flag)`
相关参数:
* `show`:是否显示启用背景组件。注意背景组件在`chart`受上层布局控制时不适用。
* `image`:背景图。
* `imageType`:背景图填充类型。
* `imageColor`背景图颜色。默认`white`
* `hideThemeBackgroundColor`:当背景组件启用时,是否隐藏主题中设置的背景色。
## `YAxis`
直角坐标系 `grid` 中的 `Y` 轴。单个 `grid` 组件最多只能放左右两个 `Y` 轴。两个 `Y` 轴存储在 `yAxises` 中。