While working in the LiveView, I encountered a missing functionality.
@wp, could you please add this procedure as public to TAChartLiveView.pas?:
procedure TChartLiveView.StoreSingleAxisRange(const axis: TChartAxis);
{ procedure to store properties of a single axis }
var
axisNumber: integer = -1;
i: integer;
begin
for i := 0 to FChart.AxisList.Count-1 do
if FChart.AxisList[i] = axis then
axisNumber := i;
if axisNumber = -1 then
exit;
FAxisRanges[axisNumber].Max := axis.Range.Max;
FAxisRanges[axisNumber].Min := axis.Range.Min;
FAxisRanges[axisNumber].UseMax := axis.Range.UseMax;
FAxisRanges[axisNumber].UseMin := axis.Range.UseMin;
end;
This procedure is necessary in the following case:
- chart has 2 y-axes
- user started LiveView with both axes range at AUTO (no UseMin/Max for both axes)
- now he decides to set a custom range for the right axis
- LiveView must now be informed about this and the existing procedure TChartLiveView.StoreAxisRanges cannot be used, because while LiveView is running it changed the range of the left axis. The user only set a custom range for the right axis, the left one must be kept as is. So we need a procedure to update a single axis.