优化BarChartTooltipTriggerItem时的表现

This commit is contained in:
monitor1394
2023-08-10 13:19:05 +08:00
parent 01a49de373
commit 9ed80d3b59
4 changed files with 7 additions and 6 deletions

View File

@@ -76,6 +76,7 @@ slug: /changelog
日志详情: 日志详情:
* (2023.08.10) 优化`BarChart``Tooltip``Trigger``Item`时的表现
* (2023.08.09) 增加`Axis`可通过设置`IconStyle``color``clear`来实现动态图标颜色的支持 * (2023.08.09) 增加`Axis`可通过设置`IconStyle``color``clear`来实现动态图标颜色的支持
* (2023.08.08) 增加`Pie``LabelLine``lineEndX`的支持 * (2023.08.08) 增加`Pie``LabelLine``lineEndX`的支持
* (2023.08.05) 整理`Examples`的代码,删除不必要的用例 * (2023.08.05) 整理`Examples`的代码,删除不必要的用例

View File

@@ -80,17 +80,17 @@ namespace XCharts.Example
void OnDraw(VertexHelper vh) void OnDraw(VertexHelper vh)
{ {
Debug.Log("OnDraw"); //Debug.Log("OnDraw");
} }
void OnDrawBeforeSerie(VertexHelper vh, Serie serie) void OnDrawBeforeSerie(VertexHelper vh, Serie serie)
{ {
Debug.Log("OnDrawBeforeSerie: " + serie.index); //Debug.Log("OnDrawBeforeSerie: " + serie.index);
} }
void OnDrawAfterSerie(VertexHelper vh, Serie serie) void OnDrawAfterSerie(VertexHelper vh, Serie serie)
{ {
Debug.Log("OnDrawAfterSerie: " + serie.index); //Debug.Log("OnDrawAfterSerie: " + serie.index);
if (serie.index != 0) return; if (serie.index != 0) return;
var dataPoints = serie.context.dataPoints; var dataPoints = serie.context.dataPoints;
if (dataPoints.Count > 0) if (dataPoints.Count > 0)
@@ -107,7 +107,7 @@ namespace XCharts.Example
void OnDrawTop(VertexHelper vh) void OnDrawTop(VertexHelper vh)
{ {
Debug.Log("OnDrawTop"); //Debug.Log("OnDrawTop");
} }
} }
} }

View File

@@ -454,10 +454,10 @@ namespace XCharts.Runtime
tooltip.context.pointer = chart.pointerPos; tooltip.context.pointer = chart.pointerPos;
if (m_PointerContainer is GridCoord) if (m_PointerContainer is GridCoord)
{ {
GetAxisCategory(m_PointerContainer.index, ref dataIndex, ref category);
if (tooltip.trigger == Tooltip.Trigger.Axis) if (tooltip.trigger == Tooltip.Trigger.Axis)
{ {
isTriggerByAxis = true; isTriggerByAxis = true;
GetAxisCategory(m_PointerContainer.index, ref dataIndex, ref category);
if (series.Count <= 1) if (series.Count <= 1)
{ {
showCategory = true; showCategory = true;

View File

@@ -25,7 +25,7 @@ namespace XCharts.Runtime
string marker, string itemFormatter, string numericFormatter, string ignoreDataDefaultContent, string marker, string itemFormatter, string numericFormatter, string ignoreDataDefaultContent,
ref List<SerieParams> paramList, ref string title) ref List<SerieParams> paramList, ref string title)
{ {
UpdateCoordSerieParams(ref paramList, ref title, dataIndex, showCategory, category, UpdateCoordSerieParams(ref paramList, ref title, dataIndex, true, category,
marker, itemFormatter, numericFormatter, ignoreDataDefaultContent); marker, itemFormatter, numericFormatter, ignoreDataDefaultContent);
} }