mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-18 06:20:15 +00:00
调整Tooltip的Corss重命名为Cross
This commit is contained in:
@@ -2339,7 +2339,7 @@ Tooltip component.
|
||||
|field|default|since|comment|
|
||||
|--|--|--|--|
|
||||
|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/>- `Auto`: Auto select indicator according to serie type.<br/>|
|
||||
|type|||Indicator type.<br/>`Tooltip.Type`:<br/>- `Line`: line indicator.<br/>- `Shadow`: shadow crosshair indicator.<br/>- `None`: no indicator displayed.<br/>- `Cross`: crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.<br/>- `Auto`: Auto select indicator according to serie type.<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/>- `Auto`: Auto select trigger according to serie type.<br/>|
|
||||
|triggerOn||v3.11.0|Condition of trigger tooltip.<br/>`Tooltip.TriggerOn`:<br/>- `MouseMove`: Trigger when mouse move.<br/>- `Click`: Trigger when mouse click.<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/>|
|
||||
|
||||
@@ -73,7 +73,8 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2024.06.09) 增加`Axis`的`m_MinCategorySpacing`设置类目轴默认的最小类目间距
|
||||
* (2024.06.09) 调整`Tooltip`的`Corss`重命名为`Cross`
|
||||
* (2024.06.09) 增加`Axis`的`minCategorySpacing`设置类目轴默认的最小类目间距
|
||||
* (2024.06.09) 修复`Tooltip`的`Cross`在`Axis`是类目轴并且开启`DataZoom`的情况下指示位置不准确的问题
|
||||
* (2024.06.06) 修复`Serie`在`Clone`时动画异常问题 (#320)
|
||||
* (2024.06.04) 修复`Serie`的`state`在代码动态设置时不刷新的问题
|
||||
|
||||
@@ -2267,7 +2267,7 @@ Serie的状态样式。Serie的状态有正常,高亮,淡出,选中四种
|
||||
|参数|默认|版本|描述|
|
||||
|--|--|--|--|
|
||||
|show|true||是否显示提示框组件。
|
||||
|type|||提示框指示器类型。<br/>`Tooltip.Type`:<br/>- `Line`: 直线指示器<br/>- `Shadow`: 阴影指示器<br/>- `None`: 无指示器<br/>- `Corss`: 十字准星指示器。坐标轴显示Label和交叉线。<br/>- `Auto`: 根据serie的类型自动选择显示指示器。<br/>|
|
||||
|type|||提示框指示器类型。<br/>`Tooltip.Type`:<br/>- `Line`: 直线指示器<br/>- `Shadow`: 阴影指示器<br/>- `None`: 无指示器<br/>- `Cross`: 十字准星指示器。坐标轴显示Label和交叉线。<br/>- `Auto`: 根据serie的类型自动选择显示指示器。<br/>|
|
||||
|trigger|||触发类型。<br/>`Tooltip.Trigger`:<br/>- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。<br/>- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。<br/>- `None`: 什么都不触发。<br/>- `Auto`: 根据serie的类型自动选择触发类型。<br/>|
|
||||
|triggerOn||v3.11.0|触发条件。<br/>`Tooltip.TriggerOn`:<br/>- `MouseMove`: 鼠标移动时触发。<br/>- `Click`: 鼠标点击时触发。<br/>|
|
||||
|position||v3.3.0|显示位置类型。<br/>`Tooltip.Position`:<br/>- `Auto`: 自适应。移动平台靠顶部显示,非移动平台跟随鼠标位置。<br/>- `Custom`: 自定义。完全自定义显示位置(x,y)。<br/>- `FixedX`: 只固定坐标X。Y跟随鼠标位置。<br/>- `FixedY`: <br/>|
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace XCharts.Example
|
||||
void AddData()
|
||||
{
|
||||
chart.RemoveData();
|
||||
chart.GetChartComponent<Tooltip>().type = Tooltip.Type.Corss;
|
||||
chart.GetChartComponent<Tooltip>().type = Tooltip.Type.Cross;
|
||||
var angleAxis = chart.GetChartComponent<AngleAxis>();
|
||||
angleAxis.type = Axis.AxisType.Value;
|
||||
angleAxis.minMaxType = Axis.AxisMinMaxType.Custom;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace XCharts.Runtime
|
||||
radiusAxis.axisLabel.show = false;
|
||||
|
||||
var tooltip = EnsureChartComponent<Tooltip>();
|
||||
tooltip.type = Tooltip.Type.Corss;
|
||||
tooltip.type = Tooltip.Type.Cross;
|
||||
tooltip.trigger = Tooltip.Trigger.Axis;
|
||||
|
||||
RemoveData();
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace XCharts.Runtime
|
||||
/// crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.
|
||||
/// ||十字准星指示器。坐标轴显示Label和交叉线。
|
||||
/// </summary>
|
||||
Corss,
|
||||
Cross,
|
||||
/// <summary>
|
||||
/// Auto select indicator according to serie type.
|
||||
/// ||根据serie的类型自动选择显示指示器。
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
if (!m_ShowTooltip || !anyTrigger)
|
||||
{
|
||||
if (tooltip.context.type == Tooltip.Type.Corss && m_PointerContainer != null && m_PointerContainer.IsPointerEnter())
|
||||
if (tooltip.context.type == Tooltip.Type.Cross && m_PointerContainer != null && m_PointerContainer.IsPointerEnter())
|
||||
{
|
||||
m_ShowTooltip = true;
|
||||
tooltip.SetActive(true);
|
||||
@@ -210,7 +210,7 @@ namespace XCharts.Runtime
|
||||
if (tooltip.context.type == Tooltip.Type.None) return;
|
||||
if (m_PointerContainer != null)
|
||||
{
|
||||
if (tooltip.context.type == Tooltip.Type.Corss)
|
||||
if (tooltip.context.type == Tooltip.Type.Cross)
|
||||
{
|
||||
if (m_PointerContainer is GridCoord)
|
||||
{
|
||||
@@ -517,7 +517,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
axis.context.axisTooltipValue = serie.GetSerieData(serie.context.pointerItemDataIndex).GetData(dimension);
|
||||
}
|
||||
else if (component.type == Tooltip.Type.Corss)
|
||||
else if (component.type == Tooltip.Type.Cross)
|
||||
{
|
||||
axis.context.axisTooltipValue = axis.context.pointerValue;
|
||||
}
|
||||
@@ -697,7 +697,7 @@ namespace XCharts.Runtime
|
||||
float splitWidth = AxisHelper.GetDataWidth(xAxis, grid.context.width, dataCount, dataZoom);
|
||||
switch (tooltip.context.type)
|
||||
{
|
||||
case Tooltip.Type.Corss:
|
||||
case Tooltip.Type.Cross:
|
||||
case Tooltip.Type.Line:
|
||||
float pX = grid.context.x;
|
||||
pX += xAxis.IsCategory() ?
|
||||
@@ -709,7 +709,7 @@ namespace XCharts.Runtime
|
||||
Vector2 ep = new Vector2(pX, grid.context.y + grid.context.height);
|
||||
var lineColor = TooltipHelper.GetLineColor(tooltip, chart.theme.tooltip.lineColor);
|
||||
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
||||
if (tooltip.context.type == Tooltip.Type.Corss)
|
||||
if (tooltip.context.type == Tooltip.Type.Cross)
|
||||
{
|
||||
sp = new Vector2(grid.context.x, chart.pointerPos.y);
|
||||
ep = new Vector2(grid.context.x + grid.context.width, chart.pointerPos.y);
|
||||
@@ -763,7 +763,7 @@ namespace XCharts.Runtime
|
||||
float splitWidth = AxisHelper.GetDataWidth(yAxis, grid.context.height, dataCount, dataZoom);
|
||||
switch (tooltip.context.type)
|
||||
{
|
||||
case Tooltip.Type.Corss:
|
||||
case Tooltip.Type.Cross:
|
||||
case Tooltip.Type.Line:
|
||||
float pY = (float)(grid.context.y + yAxis.context.pointerValue * splitWidth +
|
||||
(yAxis.boundaryGap ? splitWidth / 2 : 0));
|
||||
@@ -773,7 +773,7 @@ namespace XCharts.Runtime
|
||||
Vector2 ep = new Vector2(grid.context.x + grid.context.width, pY);
|
||||
var lineColor = TooltipHelper.GetLineColor(tooltip, chart.theme.tooltip.lineColor);
|
||||
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
||||
if (tooltip.context.type == Tooltip.Type.Corss)
|
||||
if (tooltip.context.type == Tooltip.Type.Cross)
|
||||
{
|
||||
sp = new Vector2(chart.pointerPos.x, grid.context.y);
|
||||
ep = new Vector2(chart.pointerPos.x, grid.context.y + grid.context.height);
|
||||
@@ -818,7 +818,7 @@ namespace XCharts.Runtime
|
||||
|
||||
switch (tooltip.context.type)
|
||||
{
|
||||
case Tooltip.Type.Corss:
|
||||
case Tooltip.Type.Cross:
|
||||
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
||||
var dist = Vector2.Distance(chart.pointerPos, cenPos);
|
||||
if (dist > radius) dist = radius;
|
||||
|
||||
Reference in New Issue
Block a user