var str,s,s2:string; i:integer; t:TTime; heh, hah: real; begin series2.Clear; str:=label12.Caption; for i:=0 to listBox2.Count-1 do begin s:=floattostr(StrToFloat(listBox2.Items[i])-StrToFloat(str)); s2:= listBox3.Items[i]; Delete(s2, 9, 4); t:=StrToTime(s2); hah:=strtofloat(listBox2.Items[i] ); heh:=t ; if abs(strtofloat(s))<=strtofloat( edit3.Text) then Series2.addXY(heh,hah,'', clGreen) else if (abs(strtofloat(s))>strtofloat( edit3.Text)) and (abs(strtofloat(s)<=strtofloat( edit4.Text)) then Series2.addXY(heh,hah,'', clYellow) else if abs(strtofloat(s))>strtofloat( edit4.Text) then Series2.addXY(heh,hah,'', clred) end; end; There is such a code, its idea is to draw a graph with different colors depending on the magnitude of the difference in value from the mean value. But I get an error
"0.0001" is not a valid floating point value
0.0001 is the first border with which it should be compared. I have a question: why gives such an error?
Added.
To accurately obtain the desired colors, added another 3 series, in which the colors are pre-set. It seems the color gradation turned out, but not as desired. Due to the fact that now the graph is divided into 3 separate graphs, a gap appeared between the zones, and if 2 blocks of the same color are separated by a distance, they are connected by a straight line, which does not look very aesthetic. In principle, it works, but not in the way we would like it to be one continuous straight line, but with sections of different colors.