mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 07:50:16 +00:00
优化Candlestick对时间轴的支持
This commit is contained in:
@@ -473,13 +473,25 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var serieData = data[i];
|
||||
currValue = serieData.GetData(dimension);
|
||||
if (i == 0 && i + 1 < dataCount)
|
||||
if (i == 0)
|
||||
{
|
||||
nextValue = data[i + 1].GetData(dimension);
|
||||
if (axisValue <= currValue + (nextValue - currValue) / 2)
|
||||
if (i + 1 < dataCount)
|
||||
{
|
||||
serie.context.pointerAxisDataIndexs.Add(serieData.index);
|
||||
break;
|
||||
nextValue = data[i + 1].GetData(dimension);
|
||||
if (axisValue <= currValue + (nextValue - currValue) / 2)
|
||||
{
|
||||
serie.context.pointerAxisDataIndexs.Add(serieData.index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var diff = axis.context.tickValue * 0.5f;
|
||||
if (axisValue >= currValue - diff && axisValue <= currValue + diff)
|
||||
{
|
||||
serie.context.pointerAxisDataIndexs.Add(serieData.index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (i == dataCount - 1)
|
||||
|
||||
Reference in New Issue
Block a user