You guys introduced a few new bugs in TChart 8.04 in the TColorGridSeries.
Here is the new method in TeeSurfa.TColorGrid.DrawAllValues. I made 3 corrections.
1,2. You were not considering inverted Axes when drawn the Horiz and Vert Axis
3. You made a copy/paste error and are checking FXStartIndex for the VertAxis instead of FZStartIndex.
If you could confirm that I made the correct fixes, that would be helpful.
Code: Select all
Function CalcDestRectangle(const tmpBounds:TRect):TRect;
var
IAxisSizeRange,MaxMin:Double;
axisEndOffset: double;
begin
With GetHorizAxis do
begin
If (FXStartIndex=0) Then
Begin
if Maximum-Minimum = 0 then MaxMin:=1 else MaxMin := Maximum-Minimum;
IAxisSizeRange:=IAxisSize/MaxMin;
Result.Left:=CalcPosValue(MinXValue);
// begin modifications to handle inverted axes
axisEndOffset:=IAxisSizeRange*(MaxXValue-MinXValue);
if Inverted then
axisEndOffset := 0 - axisEndOffset;
Result.Right:=Round(Result.Left + axisEndOffset);
// end modifications
end
else
Begin
Result.Left:=CalcPosValue(Max(MinXValue,CalcMinValue(tmpBounds.Left)));
Result.Right:=CalcPosValue(Min(MaxXValue,CalcMaxValue(tmpBounds.Right))){$IFDEF CLX}+1{$ENDIF};
end;
end;
With GetVertAxis do
begin
If (FZStartIndex=0) Then // <----------------modified, used to say FXStartIndex
Begin
if Maximum-Minimum = 0 then MaxMin:=1 else MaxMin := Maximum-Minimum;
IAxisSizeRange:=IAxisSize/(MaxMin);
Result.Top:=CalcPosValue(MinZValue);
// begin modifications to handle inverted axes
axisEndOffset := IAxisSizeRange*(MaxZValue-MinZValue);
if Inverted then
axisEndOffset := 0 - axisEndOffset;
Result.Bottom:=Round(Result.Top - axisEndOffset);
// end modifications
end
else
Begin
Result.Top:=CalcPosValue(Max(MinZValue,CalcMinValue(tmpBounds.Top)));
Result.Bottom:=CalcPosValue(Min(MaxZValue,CalcMaxValue(tmpBounds.Bottom))){$IFDEF CLX}+1{$ENDIF};
end;
end;
end;