Legend component.The legend component shows different sets of tags, colors, and names. You can control which series are not displayed by clicking on the legend. 图例组件。 图例组件展现了不同系列的标记,颜色和名字。可以通过点击图例控制哪些系列不显示。
More...
|
override void | ClearComponentDirty () |
|
void | ClearData () |
| Clear legend data. 清空。 More...
|
|
bool | ContainsData (string name) |
| Whether include in legend data by the specified name. 是否包括由指定名字的图例 More...
|
|
void | RemoveData (string name) |
| Removes the legend with the specified name. 移除指定名字的图例。 More...
|
|
void | AddData (string name) |
| Add legend data. 添加图例。 More...
|
|
string | GetData (int index) |
| Gets the legend for the specified index. 获得指定索引的图例。 More...
|
|
int | GetIndex (string legendName) |
| Gets the index of the specified legend. 获得指定图例的索引。 More...
|
|
void | RemoveButton () |
| Remove all legend buttons. 移除所有图例按钮。 More...
|
|
void | SetButton (string name, LegendItem item, int total) |
| Bind buttons to legends. 给图例绑定按钮。 More...
|
|
void | UpdateButtonColor (string name, Color color) |
| Update the legend button color. 更新图例按钮颜色。 More...
|
|
void | UpdateContentColor (string name, Color color) |
| Update the text color of legend. 更新图例文字颜色。 More...
|
|
Sprite | GetIcon (int index) |
| Gets the legend button for the specified index. 获得指定索引的图例按钮。 More...
|
|
void | OnChanged () |
| Callback handling when parameters change. 参数变更时的回调处理。 More...
|
|
string | GetFormatterContent (string category) |
| 获得图例格式化后的显示内容。 More...
|
|
virtual void | SetVerticesDirty () |
|
virtual void | ClearVerticesDirty () |
|
virtual void | SetComponentDirty () |
|
virtual void | ClearDirty () |
|
virtual void | SetAllDirty () |
|
|
bool | show [get, set] |
| Whether to show legend component. 是否显示图例组件。 More...
|
|
Type | iconType [get, set] |
| Type of legend. 图例类型。 [default:Type.Auto] More...
|
|
SelectedMode | selectedMode [get, set] |
| Selected mode of legend, which controls whether series can be toggled displaying by clicking legends. 选择模式。控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 None 关闭。 [default:SelectedMode.Multiple] More...
|
|
Orient | orient [get, set] |
| Specify whether the layout of legend component is horizontal or vertical. 布局方式是横还是竖。 [default:Orient.Horizonal] More...
|
|
Location | location [get, set] |
| The location of legend. 图例显示的位置。 [default:Location.defaultTop] More...
|
|
float | itemWidth [get, set] |
| Image width of legend symbol. 图例标记的图形宽度。 [default:24f] More...
|
|
float | itemHeight [get, set] |
| Image height of legend symbol. 图例标记的图形高度。 [default:12f] More...
|
|
float | itemGap [get, set] |
| The distance between each legend, horizontal distance in horizontal layout, and vertical distance in vertical layout. 图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。 [default:10f] More...
|
|
bool | itemAutoColor [get, set] |
| Whether the legend symbol matches the color automatically. 图例标记的图形是否自动匹配颜色。 [default:true] More...
|
|
bool | textAutoColor [get, set] |
| Whether the legend text matches the color automatically. 图例标记的文本是否自动匹配颜色。 [default:false] More...
|
|
string | formatter [get, set] |
| Legend content string template formatter. Support for wrapping lines with
. Template:{name}. 图例内容字符串模版格式器。支持用
换行。 模板变量为图例名称 {name}。 [default:null] More...
|
|
TextStyle | textStyle [get, set] |
| the style of text. 文本样式。 More...
|
|
List< string > | data [get, set] |
| Data array of legend. An array item is usually a name representing string. (If it is a pie chart, it could also be the name of a single data in the pie chart) of a series. If data is not specified, it will be auto collected from series. 图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 name(如果是饼图,也可以是饼图单个数据的 name)。 如果 data 没有被指定,会自动从当前系列中获取。指定data时里面的数据项和serie匹配时才会生效。 More...
|
|
List< Sprite > | icons [get, set] |
| 自定义的图例标记图形。 More...
|
|
int | index [get, set] |
|
override bool | vertsDirty [get] |
| 图表是否需要刷新(图例组件不需要刷新图表) More...
|
|
override bool | componentDirty [get] |
| 组件是否需要刷新 More...
|
|
Dictionary< string, LegendItem > | buttonList [get] |
| the button list of legend. 图例按钮列表。 More...
|
|
float | runtimeWidth [get, set] |
| 运行时图例的总宽度 More...
|
|
float | runtimeHeight [get, set] |
| 运行时图例的总高度 More...
|
|
Dictionary< int, float > | runtimeEachWidth [get] |
| 多列时每列的宽度 More...
|
|
float | runtimeEachHeight [get, set] |
| 单列高度 More...
|
|
static Legend | defaultLegend [get] |
| 一个在顶部居中显示的默认图例。 More...
|
|
virtual bool | vertsDirty [get] |
| 图表重绘标记。 More...
|
|
virtual bool | componentDirty [get] |
| 组件重新初始化标记。 More...
|
|
bool | anyDirty [get] |
| 需要重绘图表或重新初始化组件。 More...
|
|
Painter | painter [get, set] |
|
Action | refreshComponent [get, set] |
|
GameObject | gameObject [get, set] |
|
|
bool | m_VertsDirty |
|
bool | m_ComponentDirty |
|
Painter | m_Painter |
|
Legend component.The legend component shows different sets of tags, colors, and names. You can control which series are not displayed by clicking on the legend. 图例组件。 图例组件展现了不同系列的标记,颜色和名字。可以通过点击图例控制哪些系列不显示。
Definition at line 20 of file Legend.cs.
◆ SelectedMode
Selected mode of legend, which controls whether series can be toggled displaying by clicking legends. 图例选择的模式,控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 None 关闭。
Enumerator |
---|
Multiple | 多选。
|
Single | 单选。
|
None | 无法选择。
|
Definition at line 57 of file Legend.cs.
◆ Type
Enumerator |
---|
Auto | 自动匹配。
|
Custom | 自定义图标。
|
EmptyCircle | 空心圆。
|
Circle | 圆形。
|
Rect | 正方形。可通过Setting的legendIconCornerRadius参数调整圆角。
|
Triangle | 三角形。
|
Diamond | 菱形。
|
Definition at line 22 of file Legend.cs.
◆ AddData()
void XCharts.Legend.AddData |
( |
string |
name | ) |
|
|
inline |
Add legend data. 添加图例。
- Parameters
-
Definition at line 337 of file Legend.cs.
339 if (!m_Data.Contains(name) && !
string.IsNullOrEmpty(name))
◆ ClearData()
void XCharts.Legend.ClearData |
( |
| ) |
|
|
inline |
Clear legend data. 清空。
Definition at line 301 of file Legend.cs.
◆ ContainsData()
bool XCharts.Legend.ContainsData |
( |
string |
name | ) |
|
|
inline |
Whether include in legend data by the specified name. 是否包括由指定名字的图例
- Parameters
-
- Returns
Definition at line 313 of file Legend.cs.
315 return m_Data.Contains(name);
◆ GetData()
string XCharts.Legend.GetData |
( |
int |
index | ) |
|
|
inline |
Gets the legend for the specified index. 获得指定索引的图例。
- Parameters
-
- Returns
Definition at line 352 of file Legend.cs.
354 if (index >= 0 && index < m_Data.Count)
356 return m_Data[index];
◆ GetFormatterContent()
string XCharts.Legend.GetFormatterContent |
( |
string |
category | ) |
|
|
inline |
获得图例格式化后的显示内容。
- Parameters
-
- Returns
Definition at line 456 of file Legend.cs.
458 if (
string.IsNullOrEmpty(m_Formatter))
462 var content = m_Formatter.Replace(
"{name}", category);
463 content = content.Replace(
"\\n",
"\n");
464 content = content.Replace(
"<br/>",
"\n");
◆ GetIcon()
Sprite XCharts.Legend.GetIcon |
( |
int |
index | ) |
|
|
inline |
Gets the legend button for the specified index. 获得指定索引的图例按钮。
- Parameters
-
- Returns
Definition at line 430 of file Legend.cs.
432 if (index >= 0 && index < m_Icons.Count)
434 return m_Icons[index];
◆ GetIndex()
int XCharts.Legend.GetIndex |
( |
string |
legendName | ) |
|
|
inline |
Gets the index of the specified legend. 获得指定图例的索引。
- Parameters
-
- Returns
Definition at line 367 of file Legend.cs.
369 return m_Data.IndexOf(legendName);
◆ OnChanged()
void XCharts.Legend.OnChanged |
( |
| ) |
|
|
inline |
◆ RemoveButton()
void XCharts.Legend.RemoveButton |
( |
| ) |
|
|
inline |
Remove all legend buttons. 移除所有图例按钮。
Definition at line 376 of file Legend.cs.
378 m_DataBtnList.Clear();
◆ RemoveData()
void XCharts.Legend.RemoveData |
( |
string |
name | ) |
|
|
inline |
Removes the legend with the specified name. 移除指定名字的图例。
- Parameters
-
Definition at line 323 of file Legend.cs.
325 if (m_Data.Contains(name))
◆ SetButton()
void XCharts.Legend.SetButton |
( |
string |
name, |
|
|
LegendItem |
item, |
|
|
int |
total |
|
) |
| |
|
inline |
Bind buttons to legends. 给图例绑定按钮。
- Parameters
-
Definition at line 388 of file Legend.cs.
390 m_DataBtnList[name] = item;
391 int index = m_DataBtnList.Values.Count;
393 item.SetActive(
show);
◆ UpdateButtonColor()
void XCharts.Legend.UpdateButtonColor |
( |
string |
name, |
|
|
Color |
color |
|
) |
| |
|
inline |
Update the legend button color. 更新图例按钮颜色。
- Parameters
-
Definition at line 402 of file Legend.cs.
404 if (m_DataBtnList.ContainsKey(name))
406 m_DataBtnList[name].SetIconColor(color);
◆ UpdateContentColor()
void XCharts.Legend.UpdateContentColor |
( |
string |
name, |
|
|
Color |
color |
|
) |
| |
|
inline |
Update the text color of legend. 更新图例文字颜色。
- Parameters
-
Definition at line 416 of file Legend.cs.
418 if (m_DataBtnList.ContainsKey(name))
420 m_DataBtnList[name].SetContentColor(color);
◆ buttonList
Dictionary<string, LegendItem> XCharts.Legend.buttonList |
|
get |
the button list of legend. 图例按钮列表。
Definition at line 254 of file Legend.cs.
254 {
get {
return m_DataBtnList; } }
◆ componentDirty
override bool XCharts.Legend.componentDirty |
|
get |
◆ data
List<string> XCharts.Legend.data |
|
getset |
Data array of legend. An array item is usually a name representing string. (If it is a pie chart, it could also be the name of a single data in the pie chart) of a series. If data is not specified, it will be auto collected from series. 图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 name(如果是饼图,也可以是饼图单个数据的 name)。 如果 data 没有被指定,会自动从当前系列中获取。指定data时里面的数据项和serie匹配时才会生效。
Definition at line 217 of file Legend.cs.
218 get {
return m_Data; }
219 set {
if (value !=
null) { m_Data = value; SetComponentDirty(); } }
◆ defaultLegend
Legend XCharts.Legend.defaultLegend |
|
staticget |
一个在顶部居中显示的默认图例。
Definition at line 276 of file Legend.cs.
279 var legend =
new Legend
281 m_IconType =
Type.Auto,
284 m_Orient =
Orient.Horizonal,
285 m_Location = Location.defaultTop,
287 m_ItemHeight = 12.0f,
290 legend.location.top = 35;
291 legend.textStyle.offset =
new Vector2(2, 0);
292 legend.textStyle.fontSize = 0;
◆ formatter
string XCharts.Legend.formatter |
|
getset |
Legend content string template formatter. Support for wrapping lines with
. Template:{name}. 图例内容字符串模版格式器。支持用
换行。 模板变量为图例名称 {name}。 [default:null]
Definition at line 196 of file Legend.cs.
197 get {
return m_Formatter; }
198 set {
if (PropertyUtil.SetClass(ref m_Formatter, value)) SetComponentDirty(); }
◆ icons
List<Sprite> XCharts.Legend.icons |
|
getset |
自定义的图例标记图形。
Definition at line 225 of file Legend.cs.
226 get {
return m_Icons; }
227 set {
if (value !=
null) { m_Icons = value; SetComponentDirty(); } }
◆ iconType
Type XCharts.Legend.iconType |
|
getset |
Type of legend. 图例类型。 [default:Type.Auto]
Definition at line 105 of file Legend.cs.
106 get {
return m_IconType; }
107 set {
if (PropertyUtil.SetStruct(ref m_IconType, value)) SetAllDirty(); }
◆ itemAutoColor
bool XCharts.Legend.itemAutoColor |
|
getset |
Whether the legend symbol matches the color automatically. 图例标记的图形是否自动匹配颜色。 [default:true]
Definition at line 175 of file Legend.cs.
176 get {
return m_ItemAutoColor; }
177 set {
if (PropertyUtil.SetStruct(ref m_ItemAutoColor, value)) SetComponentDirty(); }
◆ itemGap
float XCharts.Legend.itemGap |
|
getset |
The distance between each legend, horizontal distance in horizontal layout, and vertical distance in vertical layout. 图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。 [default:10f]
Definition at line 165 of file Legend.cs.
166 get {
return m_ItemGap; }
167 set {
if (PropertyUtil.SetStruct(ref m_ItemGap, value)) SetComponentDirty(); }
◆ itemHeight
float XCharts.Legend.itemHeight |
|
getset |
Image height of legend symbol. 图例标记的图形高度。 [default:12f]
Definition at line 155 of file Legend.cs.
156 get {
return m_ItemHeight; }
157 set {
if (PropertyUtil.SetStruct(ref m_ItemHeight, value)) SetComponentDirty(); }
◆ itemWidth
float XCharts.Legend.itemWidth |
|
getset |
Image width of legend symbol. 图例标记的图形宽度。 [default:24f]
Definition at line 145 of file Legend.cs.
146 get {
return m_ItemWidth; }
147 set {
if (PropertyUtil.SetStruct(ref m_ItemWidth, value)) SetComponentDirty(); }
◆ location
The location of legend. 图例显示的位置。 [default:Location.defaultTop]
Definition at line 135 of file Legend.cs.
136 get {
return m_Location; }
137 set {
if (PropertyUtil.SetClass(ref m_Location, value)) SetComponentDirty(); }
◆ orient
Specify whether the layout of legend component is horizontal or vertical. 布局方式是横还是竖。 [default:Orient.Horizonal]
Definition at line 125 of file Legend.cs.
126 get {
return m_Orient; }
127 set {
if (PropertyUtil.SetStruct(ref m_Orient, value)) SetComponentDirty(); }
◆ runtimeEachHeight
float XCharts.Legend.runtimeEachHeight |
|
getset |
单列高度
Definition at line 270 of file Legend.cs.
270 {
get;
internal set; }
◆ runtimeEachWidth
Dictionary<int, float> XCharts.Legend.runtimeEachWidth |
|
get |
多列时每列的宽度
Definition at line 266 of file Legend.cs.
266 {
get {
return m_RuntimeEachWidth; } }
◆ runtimeHeight
float XCharts.Legend.runtimeHeight |
|
getset |
运行时图例的总高度
Definition at line 262 of file Legend.cs.
262 {
get;
internal set; }
◆ runtimeWidth
float XCharts.Legend.runtimeWidth |
|
getset |
运行时图例的总宽度
Definition at line 258 of file Legend.cs.
258 {
get;
internal set; }
◆ selectedMode
Selected mode of legend, which controls whether series can be toggled displaying by clicking legends. 选择模式。控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 None 关闭。 [default:SelectedMode.Multiple]
Definition at line 115 of file Legend.cs.
116 get {
return m_SelectedMode; }
117 set {
if (PropertyUtil.SetStruct(ref m_SelectedMode, value)) SetComponentDirty(); }
◆ show
Whether to show legend component. 是否显示图例组件。
Definition at line 95 of file Legend.cs.
96 get {
return m_Show; }
97 set {
if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); }
◆ textAutoColor
bool XCharts.Legend.textAutoColor |
|
getset |
Whether the legend text matches the color automatically. 图例标记的文本是否自动匹配颜色。 [default:false]
Definition at line 185 of file Legend.cs.
186 get {
return m_TextAutoColor; }
187 set {
if (PropertyUtil.SetStruct(ref m_TextAutoColor, value)) SetComponentDirty(); }
◆ textStyle
the style of text. 文本样式。
Definition at line 205 of file Legend.cs.
206 get {
return m_TextStyle; }
207 set {
if (PropertyUtil.SetClass(ref m_TextStyle, value)) SetComponentDirty(); }
◆ vertsDirty
override bool XCharts.Legend.vertsDirty |
|
get |
图表是否需要刷新(图例组件不需要刷新图表)
Definition at line 233 of file Legend.cs.
233 {
get {
return false; } }
The documentation for this class was generated from the following file: