mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
[feature][Tooltip] support position
This commit is contained in:
@@ -1422,6 +1422,7 @@ Tooltip component.
|
||||
|`show`|true||Whether to show the tooltip component.
|
||||
|`type`|||Indicator type.</br>`Tooltip.Type`:</br>- `Line`: line indicator.</br>- `Shadow`: shadow crosshair indicator.</br>- `None`: no indicator displayed.</br>- `Corss`: crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.</br>|
|
||||
|`trigger`|||Type of triggering.</br>`Tooltip.Trigger`:</br>- `Item`: Triggered by data item, which is mainly used for charts that don't have a category axis like scatter charts or pie charts.</br>- `Axis`: Triggered by axes, which is mainly used for charts that have category axes, like bar charts or line charts.</br>- `None`: Trigger nothing.</br>|
|
||||
|`position`||v3.3.0|Type of position.</br>`Tooltip.Position`:</br>- `Auto`: Auto. The mobile platform is displayed at the top, and the non-mobile platform follows the mouse position.</br>- `Custom`: Custom. Fully customize display position (x,y).</br>- `FixedX`: Just fix the coordinate X. Y follows the mouse position.</br>- `FixedY`: </br>|
|
||||
|`itemFormatter`|||a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. Template variables are {.}, {a}, {b}, {c}, {d}.</br> {.} is the dot of the corresponding color of a Serie that is currently indicated or whose index is 0.</br> {a} is the series name of the serie that is currently indicated or whose index is 0.</br> {b} is the name of the data item serieData that is currently indicated or whose index is 0, or a category value (such as the X-axis of a line chart).</br> {c} is the value of a Y-dimension (dimesion is 1) from a Serie that is currently indicated or whose index is 0.</br> {d} is the percentage value of Y-dimensions (dimesion is 1) from serie that is currently indicated or whose index is 0, with no % sign.</br> {e} is the name of the data item serieData that is currently indicated or whose index is 0.</br> {f} is sum of data.</br> {.1} represents a dot from serie corresponding color that specifies index as 1.</br> 1 in {a1}, {b1}, {c1} represents a serie that specifies an index of 1.</br> {c1:2} represents the third data from serie's current indication data item indexed to 1 (a data item has multiple data, index 2 represents the third data).</br> {c1:2-2} represents the third data item from serie's third data item indexed to 1 (i.e., which data item must be specified to specify).</br> {d1:2: F2} indicates that a formatted string with a value specified separately is F2 (numericFormatter is used when numericFormatter is not specified).</br> {d:0.##} indicates that a formatted string with a value specified separately is 0.## (used for percentage, reserved 2 valid digits while avoiding the situation similar to "100.00%" when using f2 ).</br> Example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1} : {c1:1-1: f1}"</br>
|
||||
|`titleFormatter`|||The string template formatter for the tooltip title content. Support for wrapping lines with \n. The placeholder {I} can be set separately to indicate that the title is ignored and not displayed. Template see itemFormatter.
|
||||
|`marker`|||the marker of serie.
|
||||
@@ -1441,10 +1442,8 @@ Tooltip component.
|
||||
|`backgroundType`|||The background type of tooltip.
|
||||
|`backgroundColor`|||The background color of tooltip.
|
||||
|`borderWidth`|2f||the width of tooltip border.
|
||||
|`fixedXEnable`|false||enable fixedX.
|
||||
|`fixedX`|0f||the x positionn of fixedX.
|
||||
|`fixedYEnable`|false||enable fixedY.
|
||||
|`fixedY`|0f||the y position of fixedY.
|
||||
|`fixedY`|0.7f||the y position of fixedY.
|
||||
|`titleHeight`|25f||height of title text.
|
||||
|`itemHeight`|25f||height of content text.
|
||||
|`borderColor`|Color32(230, 230, 230, 255)||the color of tooltip border.
|
||||
|
||||
@@ -1422,6 +1422,7 @@ Inherits or Implemented: [MainComponent](#MainComponent)
|
||||
|`show`|true||是否显示提示框组件。
|
||||
|`type`|||提示框指示器类型。</br>`Tooltip.Type`:</br>- `Line`: 直线指示器</br>- `Shadow`: 阴影指示器</br>- `None`: 无指示器</br>- `Corss`: 十字准星指示器。坐标轴显示Label和交叉线。</br>|
|
||||
|`trigger`|||触发类型。</br>`Tooltip.Trigger`:</br>- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。</br>- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。</br>- `None`: 什么都不触发。</br>|
|
||||
|`position`||v3.3.0|显示位置类型。</br>`Tooltip.Position`:</br>- `Auto`: 自适应。移动平台靠顶部显示,非移动平台跟随鼠标位置。</br>- `Custom`: 自定义。完全自定义显示位置(x,y)。</br>- `FixedX`: 只固定坐标X。Y跟随鼠标位置。</br>- `FixedY`: </br>|
|
||||
|`itemFormatter`|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用
|
||||
|`titleFormatter`|||提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。</br> {.}为当前所指示或index为0的serie的对应颜色的圆点。</br> {a}为当前所指示或index为0的serie的系列名name。</br> {b}为当前所指示或index为0的serie的数据项serieData的name,或者类目值(如折线图的X轴)。</br> {c}为当前所指示或index为0的serie的y维(dimesion为1)的数值。</br> {d}为当前所指示或index为0的serie的y维(dimesion为1)百分比值,注意不带%号。</br> {e}为当前所指示或index为0的serie的数据项serieData的name。</br> {f}为数据总和。</br> {g}为数据总个数。</br> {.1}表示指定index为1的serie对应颜色的圆点。</br> {a1}、{b1}、{c1}中的1表示指定index为1的serie。</br> {c1:2}表示索引为1的serie的当前指示数据项的第3个数据(一个数据项有多个数据,index为2表示第3个数据)。</br> {c1:2-2}表示索引为1的serie的第3个数据项的第3个数据(也就是要指定第几个数据项时必须要指定第几个数据)。</br> {d1:2:f2}表示单独指定了数值的格式化字符串为f2(不指定时用numericFormatter)。</br> {d:0.##} 表示单独指定了数值的格式化字符串为 0.## (用于百分比,保留2位有效数同时又能避免使用 f2 而出现的类似于"100.00%"的情况 )。</br> 示例:"{a}:{c}"、"{a1}:{c1:f1}"、"{a1}:{c1:0:f1}"、"{a1}:{c1:1-1:f1}"
|
||||
|`marker`|||serie的符号标志。
|
||||
@@ -1441,10 +1442,8 @@ Inherits or Implemented: [MainComponent](#MainComponent)
|
||||
|`backgroundType`|||提示框的背景图片显示类型。
|
||||
|`backgroundColor`|||提示框的背景颜色。
|
||||
|`borderWidth`|2f||边框线宽。
|
||||
|`fixedXEnable`|false||是否固定X位置。
|
||||
|`fixedX`|0f||固定X位置的坐标。
|
||||
|`fixedYEnable`|false||是否固定Y位置。
|
||||
|`fixedY`|0f||固定Y位置的坐标。
|
||||
|`fixedY`|0.7f||固定Y位置的坐标。
|
||||
|`titleHeight`|25f||标题文本的高。
|
||||
|`itemHeight`|25f||数据项文本的高。
|
||||
|`borderColor`|Color32(230, 230, 230, 255)||边框颜色。
|
||||
|
||||
Reference in New Issue
Block a user