TAChart: Draw color map series at design time. Minor demo update

git-svn-id: trunk@29324 -
This commit is contained in:
ask 2011-02-02 08:13:05 +00:00
parent cc9a3993f7
commit e0eacbebbd
3 changed files with 4 additions and 5 deletions

View File

@ -55,7 +55,7 @@
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="9"/> <Version Value="10"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<SearchPaths> <SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/> <IncludeFiles Value="$(ProjOutDir)"/>

View File

@ -65,13 +65,11 @@ object Form1: TForm1
object Chart1XAxis: TConstantLine object Chart1XAxis: TConstantLine
Legend.Visible = False Legend.Visible = False
Position = 0 Position = 0
SeriesColor = clBlack
end end
object Chart1YAxis: TConstantLine object Chart1YAxis: TConstantLine
Legend.Visible = False Legend.Visible = False
LineStyle = lsVertical LineStyle = lsVertical
Position = 0 Position = 0
SeriesColor = clBlack
end end
object Chart1BarSeries1: TBarSeries object Chart1BarSeries1: TBarSeries
Title = 'Cos(x)' Title = 'Cos(x)'

View File

@ -427,7 +427,7 @@ var
gp: TDoublePoint; gp: TDoublePoint;
v: Double; v: Double;
begin begin
if IsEmpty then exit; if not (csDesigning in ComponentState) and IsEmpty then exit;
ext := ParentChart.CurrentExtent; ext := ParentChart.CurrentExtent;
bounds := EmptyExtent; bounds := EmptyExtent;
@ -458,7 +458,8 @@ begin
continue; continue;
end; end;
gp := GraphToAxis(ParentChart.ImageToGraph((pt + next) div 2)); gp := GraphToAxis(ParentChart.ImageToGraph((pt + next) div 2));
OnCalculate(gp.X, gp.Y, v); if not (csDesigning in ComponentState) then
OnCalculate(gp.X, gp.Y, v);
if ColorSource <> nil then if ColorSource <> nil then
ACanvas.Brush.Color := ColorByValue(v); ACanvas.Brush.Color := ColorByValue(v);
ACanvas.Rectangle( ACanvas.Rectangle(