I'm using TChart. My data y is from 0 to 5 but I want to see y axis from 0, to 10, so I use this Min:=0, Max=10, UseMin:=true, UsaMax:=true. This works, but if I have data that goes below zero, chart ignores Min:=0,UseMin:=true and increases y axis range to -1 fit the chart on screen. I don't want to modify data, I just want initial view to be from 0 to 10, not from -1 to 10.
var s : TLineSeries;
begin
s := TLineSeries.Create(Chart1);
s.AddXY(0,0);
s.AddXY(1,5);
s.AddXY(2,0);
s.AddXY(3,5);
s.AddXY(4,0);
s.AddXY(4.1,-1); // random noise in data I'm not interested in
s.AddXY(4.2,0);
s.AddXY(5,5);
s.AddXY(6,0);
Chart1.AddSeries(s);
Chart1.VertAxis.Range.Min := 0;
Chart1.VertAxis.Range.Max := 10;
Chart1.VertAxis.Range.UseMax := true;
Chart1.VertAxis.Range.UseMin := true;
end;
Lazarus 2.2.0+dfsg1-5ubuntu1 (rev Unversioned directory) FPC 3.2.2 x86_64-linux-gtk2 Ubuntu 22.04.5 LTS