mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 17:30:10 +00:00
增加Bar的realtimeSort支持实时排序
This commit is contained in:
@@ -641,6 +641,7 @@ namespace XCharts.Runtime
|
||||
|
||||
private bool GetAxisCategory(int gridIndex, ref int dataIndex, ref string category, ref int timestamp, ref double axisRange)
|
||||
{
|
||||
var needSort = chart.HasRealtimeSortSerie();
|
||||
foreach (var component in chart.components)
|
||||
{
|
||||
if (component is Axis)
|
||||
@@ -653,7 +654,12 @@ namespace XCharts.Runtime
|
||||
dataIndex = double.IsNaN(axis.context.pointerValue)
|
||||
? axis.context.dataZoomStartIndex
|
||||
: (int)axis.context.axisTooltipValue;
|
||||
category = axis.GetData(dataIndex);
|
||||
int axisIndex = dataIndex;
|
||||
if (needSort && axisIndex < axis.context.sortedDataIndices.Count)
|
||||
{
|
||||
axisIndex = axis.context.sortedDataIndices[axisIndex];
|
||||
}
|
||||
category = axis.GetData(axisIndex);
|
||||
return true;
|
||||
}
|
||||
else if (axis.IsTime())
|
||||
|
||||
Reference in New Issue
Block a user