Skip to content

Commit

Permalink
修复TooltipCross在开启DataZoom的情况下label位置不正确的问题 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Apr 14, 2024
1 parent a361e19 commit 3ef2e7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Runtime/Component/Tooltip/Tooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public Position position
/// {h}为当前所指示或index为0的serie的数据项serieData的十六进制颜色值。<br/>
/// {f}为数据总和。<br/>
/// {g}为数据总个数。<br/>
/// {f}为value所对应的y轴的类目值。<br/>
/// {y}为value所对应的y轴的类目值。<br/>
/// {.1}表示指定index为1的serie对应颜色的圆点。<br/>
/// {a1}、{b1}、{c1}中的1表示指定index为1的serie。<br/>
/// {c1:2}表示索引为1的serie的当前指示数据项的第3个数据(一个数据项有多个数据,index为2表示第3个数据)。<br/>
Expand Down
3 changes: 2 additions & 1 deletion Runtime/Component/Tooltip/TooltipHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ private void SetTooltipIndicatorLabel(Tooltip tooltip, Axis axis, ChartLabel lab
if (axis.IsCategory())
{
var index = (int)axis.context.pointerValue;
var category = axis.GetData(index);
var dataZoom = chart.GetDataZoomOfAxis(axis);
var category = axis.GetData(index, dataZoom);
label.SetText(axis.indicatorLabel.GetFormatterContent(index, category));
}
else if (axis.IsTime())
Expand Down

0 comments on commit 3ef2e7c

Please sign in to comment.