1. The .Compress property does not seem to "keep" the value, ie if we set it to ocWeek, it will not necessarily use ocWeek, it will be a "random" value (ocMonth, ocQuarter, etc).
2. There seems to be no way to make the series attached to this function immediately "recompute" after changing the .Compress property, ie when changing at runtime from ocWeek to ocMonth.
Code: Select all
OutputDebugStringA(PChar(Format('start period %d first %d last %d', [ord(period), v_derived.Series.FirstValueIndex, v_derived.Series.LastValueIndex])));
(Series.FunctionType as TCompressFunction).Compress := period;
OutputDebugStringA(PChar(Format('end period %d first %d last %d', [ord(period), v_derived.Series.FirstValueIndex, v_derived.Series.LastValueIndex])));
We have tried different combinations of function.ReCalculate(), chart.RefreshData(), etc.
The only event that seems to "synchronize" the derived series, is scrolling the chart.
This also seems to be an issue with using derived functions in general, which affects code that attempts to "rescale" the y-axis, based on the visible points, as denoted by series.FirstValueIndex and series.LastValueIndex.
Thanks in advance for any insight.