[feature][animation] add UnscaledTime for animation #223

This commit is contained in:
monitor1394
2022-10-12 08:35:23 +08:00
parent ab8ced4aed
commit e1f20e0796
21 changed files with 88 additions and 56 deletions

View File

@@ -100,6 +100,7 @@ namespace XCharts.Runtime
bool dataChanging = false;
float dataChangeDuration = serie.animation.GetUpdateAnimationDuration();
var unscaledTime = serie.animation.unscaledTime;
double yMinValue = yAxis.context.minValue;
double yMaxValue = yAxis.context.maxValue;
var isYAxis = false;
@@ -117,10 +118,10 @@ namespace XCharts.Runtime
continue;
}
var startDataIndex = serieData.data.Count > 4 ? 1 : 0;
var open = serieData.GetCurrData(startDataIndex, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);
var close = serieData.GetCurrData(startDataIndex + 1, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);
var lowest = serieData.GetCurrData(startDataIndex + 2, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);
var heighest = serieData.GetCurrData(startDataIndex + 3, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue);
var open = serieData.GetCurrData(startDataIndex, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue, unscaledTime);
var close = serieData.GetCurrData(startDataIndex + 1, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue, unscaledTime);
var lowest = serieData.GetCurrData(startDataIndex + 2, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue, unscaledTime);
var heighest = serieData.GetCurrData(startDataIndex + 3, dataChangeDuration, yAxis.inverse, yMinValue, yMaxValue, unscaledTime);
var isRise = yAxis.inverse ? close<open : close> open;
var borderWidth = open == 0 ? 0f :
(itemStyle.runtimeBorderWidth == 0 ? theme.serie.candlestickBorderWidth :