Source code change to TMarksTipTool
Posted: Mon Oct 01, 2007 6:32 pm
Hi,
I made a source code change to TMarksTipTool in order to work around a problem.
The problem is that when you add null values to a line or point series, that the null values act as zero values for the purpose of calculating plot limits. The result is a lower plot limit of zero. The solution that I read in a previous post is instead of adding null values, add values that have previously been added (so they don't affect the plot limits calculation), but add them with a color of clNone. The chart looks correct, but the "invisible" series points were popping up when I used the marks tip tool. I changed the source code to skip any series with a ValueColor of clNone. Now everything works correctly. I don't require it now, but a similar thing could be added for when a series is clicked.
Regards,
Bill
Here is the updated FindClickedSeries code:
Procedure FindClickedSeries;
var t : Integer;
tmpClickedSeries : TChartSeries;
begin
for t:=ParentChart.SeriesCount-1 downto 0 do // 6.01
begin
tmpClickedSeries:=ParentChart[t];
if tmpClickedSeries.Active then
begin
tmp:=tmpClickedSeries.Clicked(x,y);
if tmp<>-1 then
if tmpClickedSeries.ValueColor[tmp]<>Graphics.clNone then
begin
tmpSeries:=tmpClickedSeries;
break;
end
else
tmp:=-1;
end;
end;
end;
I made a source code change to TMarksTipTool in order to work around a problem.
The problem is that when you add null values to a line or point series, that the null values act as zero values for the purpose of calculating plot limits. The result is a lower plot limit of zero. The solution that I read in a previous post is instead of adding null values, add values that have previously been added (so they don't affect the plot limits calculation), but add them with a color of clNone. The chart looks correct, but the "invisible" series points were popping up when I used the marks tip tool. I changed the source code to skip any series with a ValueColor of clNone. Now everything works correctly. I don't require it now, but a similar thing could be added for when a series is clicked.
Regards,
Bill
Here is the updated FindClickedSeries code:
Procedure FindClickedSeries;
var t : Integer;
tmpClickedSeries : TChartSeries;
begin
for t:=ParentChart.SeriesCount-1 downto 0 do // 6.01
begin
tmpClickedSeries:=ParentChart[t];
if tmpClickedSeries.Active then
begin
tmp:=tmpClickedSeries.Clicked(x,y);
if tmp<>-1 then
if tmpClickedSeries.ValueColor[tmp]<>Graphics.clNone then
begin
tmpSeries:=tmpClickedSeries;
break;
end
else
tmp:=-1;
end;
end;
end;