mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 05:50:09 +00:00
修复Tooltip的titleFormatter设置为{b}后显示不准确的问题
This commit is contained in:
@@ -439,31 +439,17 @@ namespace XCharts.Runtime
|
||||
return false;
|
||||
}
|
||||
|
||||
internal string GetTooltipCategory(int dataIndex, DataZoom dataZoom = null)
|
||||
{
|
||||
var xAxis = GetChartComponent<XAxis>();
|
||||
var yAxis = GetChartComponent<YAxis>();
|
||||
if (yAxis.IsCategory())
|
||||
{
|
||||
return yAxis.GetData((int)yAxis.context.pointerValue, dataZoom);
|
||||
}
|
||||
else if (xAxis.IsCategory())
|
||||
{
|
||||
return xAxis.GetData((int)xAxis.context.pointerValue, dataZoom);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
internal string GetTooltipCategory(int dataIndex, Serie serie, DataZoom dataZoom = null)
|
||||
internal string GetTooltipCategory(Serie serie)
|
||||
{
|
||||
var xAxis = GetChartComponent<XAxis>(serie.xAxisIndex);
|
||||
var yAxis = GetChartComponent<YAxis>(serie.yAxisIndex);
|
||||
if (yAxis.IsCategory())
|
||||
{
|
||||
return yAxis.GetData((int)yAxis.context.pointerValue, dataZoom);
|
||||
return yAxis.GetData(serie.context.pointerItemDataIndex);
|
||||
}
|
||||
else if (xAxis.IsCategory())
|
||||
{
|
||||
return xAxis.GetData((int)xAxis.context.pointerValue, dataZoom);
|
||||
return xAxis.GetData(serie.context.pointerItemDataIndex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user