mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 07:02:50 +02:00
TAChart: Add Series.ZPosition property
git-svn-id: trunk@19541 -
This commit is contained in:
parent
2117d39cf8
commit
45d428b6e3
@ -35,11 +35,13 @@ object Form1: TForm1
|
||||
LeftAxis.Title.Angle = 90
|
||||
LeftAxis.Title.Font.Height = -11
|
||||
LeftAxis.Title.Font.Name = 'MS Sans Serif'
|
||||
LeftAxis.Visible = False
|
||||
BottomAxis.Grid.Color = clGray
|
||||
BottomAxis.Grid.Style = psDot
|
||||
BottomAxis.Grid.Visible = True
|
||||
BottomAxis.Title.Font.Height = -11
|
||||
BottomAxis.Title.Font.Name = 'MS Sans Serif'
|
||||
BottomAxis.Visible = False
|
||||
Frame.Visible = True
|
||||
Align = alClient
|
||||
ParentColor = False
|
||||
|
@ -14,73 +14,74 @@ LazarusResources.Add('TForm1','FORMDATA',[
|
||||
+'This a LeftAligned Footer'#0#19'LeftAxis.Grid.Color'#7#6'clGray'#19'LeftAxi'
|
||||
+'s.Grid.Style'#7#5'psDot'#21'LeftAxis.Grid.Visible'#9#20'LeftAxis.Title.Angl'
|
||||
+'e'#2'Z'#26'LeftAxis.Title.Font.Height'#2#245#24'LeftAxis.Title.Font.Name'#6
|
||||
+#13'MS Sans Serif'#21'BottomAxis.Grid.Color'#7#6'clGray'#21'BottomAxis.Grid.'
|
||||
+'Style'#7#5'psDot'#23'BottomAxis.Grid.Visible'#9#28'BottomAxis.Title.Font.He'
|
||||
+'ight'#2#245#26'BottomAxis.Title.Font.Name'#6#13'MS Sans Serif'#13'Frame.Vis'
|
||||
+'ible'#9#5'Align'#7#8'alClient'#11'ParentColor'#8#0#5'TLine'#13'Chart1LineHo'
|
||||
+'r'#12'ShowInLegend'#8#9'Pen.Style'#7#6'psDash'#11'SeriesColor'#7#7'clBlack'
|
||||
+#0#0#5'TLine'#14'Chart1LineVert'#12'ShowInLegend'#8#9'LineStyle'#7#10'lsVert'
|
||||
+'ical'#9'Pen.Style'#7#6'psDash'#11'SeriesColor'#7#7'clBlack'#0#0#0#6'TPanel'
|
||||
+#6'Panel1'#6'Height'#2'f'#3'Top'#3#136#1#5'Width'#3'I'#2#5'Align'#7#8'alBott'
|
||||
+'om'#12'ClientHeight'#2'f'#11'ClientWidth'#3'I'#2#8'TabOrder'#2#0#0#6'TLabel'
|
||||
+#6'lblAdd'#4'Left'#2#13#6'Height'#2#14#3'Top'#2#10#5'Width'#2#24#7'Caption'#6
|
||||
+#4'Add:'#11'ParentColor'#8#0#0#6'TLabel'#8'lblClear'#4'Left'#2#13#6'Height'#2
|
||||
+#14#3'Top'#2'('#5'Width'#2#30#7'Caption'#6#6'Clear:'#11'ParentColor'#8#0#0#6
|
||||
+'TLabel'#11'lblAddCount'#4'Left'#3' '#1#6'Height'#2#14#3'Top'#2#8#5'Width'#2
|
||||
+':'#7'Caption'#6#12'Multiple add'#11'ParentColor'#8#0#0#6'TLabel'#12'lblMark'
|
||||
+'Style'#4'Left'#2'0'#6'Height'#2#14#3'Top'#2'P'#5'Width'#2'N'#7'Caption'#6#15
|
||||
+'Add with marks:'#11'ParentColor'#8#0#0#6'TLabel'#11'lblReticule'#4'Left'#3
|
||||
+'h'#1#6'Height'#2#14#3'Top'#2'P'#5'Width'#2'+'#7'Caption'#6#9'Reticule:'#11
|
||||
+'ParentColor'#8#0#0#7'TButton'#9'btnAddPie'#4'Left'#2'0'#6'Height'#2#24#3'To'
|
||||
+'p'#2#8#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Pie'#7
|
||||
+'OnClick'#7#14'btnAddPieClick'#8'TabOrder'#2#0#0#0#7'TButton'#10'btnAddLine'
|
||||
+#4'Left'#3#216#0#6'Height'#2#24#3'Top'#2#8#5'Width'#2'4'#25'BorderSpacing.In'
|
||||
+'nerBorder'#2#4#7'Caption'#6#4'Line'#7'OnClick'#7#15'btnAddLineClick'#8'TabO'
|
||||
+'rder'#2#1#0#0#7'TButton'#10'btnAddArea'#4'Left'#2'h'#6'Height'#2#24#3'Top'#2
|
||||
+#8#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#4'Area'#7'On'
|
||||
+'Click'#7#15'btnAddAreaClick'#8'TabOrder'#2#2#0#0#7'TButton'#9'btnAddBar'#4
|
||||
+'Left'#3#160#0#6'Height'#2#24#3'Top'#2#8#5'Width'#2'4'#25'BorderSpacing.Inne'
|
||||
+'rBorder'#2#4#7'Caption'#6#3'Bar'#7'OnClick'#7#14'btnAddBarClick'#8'TabOrder'
|
||||
+#2#3#0#0#9'TCheckBox'#8'cbLegend'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2#8#5
|
||||
+'Width'#2'8'#7'Caption'#6#6'Legend'#8'OnChange'#7#14'cbLegendChange'#8'TabOr'
|
||||
+'der'#2#4#0#0#9'TCheckBox'#12'cbBottomAxis'#4'Left'#3#128#1#6'Height'#2#17#3
|
||||
+'Top'#2#24#5'Width'#2'K'#7'Caption'#6#11'Bottom Axis'#7'Checked'#9#8'OnChang'
|
||||
+'e'#7#18'cbBottomAxisChange'#5'State'#7#9'cbChecked'#8'TabOrder'#2#5#0#0#9'T'
|
||||
+'CheckBox'#10'cbLeftAxis'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2'('#5'Width'
|
||||
+#2'<'#7'Caption'#6#9'Left Axis'#7'Checked'#9#8'OnChange'#7#16'cbLeftAxisChan'
|
||||
+'ge'#5'State'#7#9'cbChecked'#8'TabOrder'#2#6#0#0#9'TCheckBox'#7'cbTitle'#4'L'
|
||||
+'eft'#3#240#1#6'Height'#2#17#3'Top'#2#8#5'Width'#2'('#7'Caption'#6#5'Title'#7
|
||||
+'Checked'#9#8'OnChange'#7#13'cbTitleChange'#5'State'#7#9'cbChecked'#8'TabOrd'
|
||||
+'er'#2#7#0#0#9'TCheckBox'#8'cbFooter'#4'Left'#3#240#1#6'Height'#2#17#3'Top'#2
|
||||
+#24#5'Width'#2'2'#7'Caption'#6#6'Footer'#8'OnChange'#7#14'cbFooterChange'#8
|
||||
+'TabOrder'#2#8#0#0#9'TCheckBox'#10'cbInverted'#4'Left'#3#240#1#6'Height'#2#17
|
||||
+#3'Top'#2'('#5'Width'#2';'#7'Caption'#6#8'Inverted'#8'OnChange'#7#16'cbInver'
|
||||
+'tedChange'#8'TabOrder'#2#9#0#0#7'TButton'#11'btnClearBar'#4'Left'#3#160#0#6
|
||||
+'Height'#2#24#3'Top'#2'&'#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7
|
||||
+'Caption'#6#3'Bar'#7'OnClick'#7#16'btnClearBarClick'#8'TabOrder'#2#10#0#0#7
|
||||
+'TButton'#12'btnClearArea'#4'Left'#2'h'#6'Height'#2#24#3'Top'#2'&'#5'Width'#2
|
||||
+'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#4'Area'#7'OnClick'#7#17'b'
|
||||
+'tnClearAreaClick'#8'TabOrder'#2#11#0#0#7'TButton'#12'btnClearLine'#4'Left'#3
|
||||
+#216#0#6'Height'#2#24#3'Top'#2'&'#5'Width'#2'4'#25'BorderSpacing.InnerBorder'
|
||||
+#2#4#7'Caption'#6#4'Line'#7'OnClick'#7#17'btnClearLineClick'#8'TabOrder'#2#12
|
||||
+#0#0#7'TButton'#11'btnClearPie'#4'Left'#2'0'#6'Height'#2#24#3'Top'#2'&'#5'Wi'
|
||||
+'dth'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Pie'#7'OnClick'#7
|
||||
,#16'btnClearPieClick'#8'TabOrder'#2#13#0#0#9'TSpinEdit'#10'edAddCount'#4'Lef'
|
||||
+'t'#3' '#1#6'Height'#2#21#3'Top'#2#24#5'Width'#2'Z'#8'MaxValue'#4'@B'#15#0#8
|
||||
+'MinValue'#2#1#8'TabOrder'#2#14#5'Value'#2#1#0#0#9'TCheckBox'#18'cbShowGridC'
|
||||
+'heckBox'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'F'#7'Caption'
|
||||
+#6#10'Show grid '#7'Checked'#9#8'OnChange'#7#24'cbShowGridCheckBoxChange'#5
|
||||
+'State'#7#9'cbChecked'#8'TabOrder'#2#15#0#0#9'TCheckBox'#16'cbShowAxisTitles'
|
||||
+#4'Left'#3#240#1#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'?'#7'Caption'#6#11'Ax'
|
||||
+'is titles'#8'OnChange'#7#22'cbShowAxisTitlesChange'#8'TabOrder'#2#16#0#0#9
|
||||
+'TComboBox'#11'cbMarkStyle'#4'Left'#3#132#0#6'Height'#2#21#3'Top'#2'L'#5'Wid'
|
||||
+'th'#3#136#0#10'ItemHeight'#2#13#9'ItemIndex'#2#5#13'Items.Strings'#1#6#9'sm'
|
||||
+'sCustom'#6#7'smsNone'#6#8'smsValue'#6#10'smsPercent'#6#8'smsLabel'#6#15'sms'
|
||||
+'LabelPercent'#6#13'smsLabelValue'#6#9'smsLegend'#6#15'smsPercentTotal'#6#20
|
||||
+'smsLabelPercentTotal'#6#9'smsXValue'#0#5'Style'#7#14'csDropDownList'#8'TabO'
|
||||
+'rder'#2#17#4'Text'#6#15'smsLabelPercent'#0#0#9'TComboBox'#10'cbReticule'#4
|
||||
+'Left'#3#160#1#6'Height'#2#21#3'Top'#2'L'#5'Width'#3#136#0#10'ItemHeight'#2
|
||||
+#13#9'ItemIndex'#2#0#13'Items.Strings'#1#6#6'rmNone'#6#10'rmVertical'#6#12'r'
|
||||
+'mHorizontal'#6#7'rmCross'#0#8'OnChange'#7#16'cbReticuleChange'#5'Style'#7#14
|
||||
+'csDropDownList'#8'TabOrder'#2#18#4'Text'#6#6'rmNone'#0#0#0#0
|
||||
+#13'MS Sans Serif'#16'LeftAxis.Visible'#8#21'BottomAxis.Grid.Color'#7#6'clGr'
|
||||
+'ay'#21'BottomAxis.Grid.Style'#7#5'psDot'#23'BottomAxis.Grid.Visible'#9#28'B'
|
||||
+'ottomAxis.Title.Font.Height'#2#245#26'BottomAxis.Title.Font.Name'#6#13'MS S'
|
||||
+'ans Serif'#18'BottomAxis.Visible'#8#13'Frame.Visible'#9#5'Align'#7#8'alClie'
|
||||
+'nt'#11'ParentColor'#8#0#5'TLine'#13'Chart1LineHor'#12'ShowInLegend'#8#9'Pen'
|
||||
+'.Style'#7#6'psDash'#11'SeriesColor'#7#7'clBlack'#0#0#5'TLine'#14'Chart1Line'
|
||||
+'Vert'#12'ShowInLegend'#8#9'LineStyle'#7#10'lsVertical'#9'Pen.Style'#7#6'psD'
|
||||
+'ash'#11'SeriesColor'#7#7'clBlack'#0#0#0#6'TPanel'#6'Panel1'#6'Height'#2'f'#3
|
||||
+'Top'#3#136#1#5'Width'#3'I'#2#5'Align'#7#8'alBottom'#12'ClientHeight'#2'f'#11
|
||||
+'ClientWidth'#3'I'#2#8'TabOrder'#2#0#0#6'TLabel'#6'lblAdd'#4'Left'#2#13#6'He'
|
||||
+'ight'#2#14#3'Top'#2#10#5'Width'#2#24#7'Caption'#6#4'Add:'#11'ParentColor'#8
|
||||
+#0#0#6'TLabel'#8'lblClear'#4'Left'#2#13#6'Height'#2#14#3'Top'#2'('#5'Width'#2
|
||||
+#30#7'Caption'#6#6'Clear:'#11'ParentColor'#8#0#0#6'TLabel'#11'lblAddCount'#4
|
||||
+'Left'#3' '#1#6'Height'#2#14#3'Top'#2#8#5'Width'#2':'#7'Caption'#6#12'Multip'
|
||||
+'le add'#11'ParentColor'#8#0#0#6'TLabel'#12'lblMarkStyle'#4'Left'#2'0'#6'Hei'
|
||||
+'ght'#2#14#3'Top'#2'P'#5'Width'#2'N'#7'Caption'#6#15'Add with marks:'#11'Par'
|
||||
+'entColor'#8#0#0#6'TLabel'#11'lblReticule'#4'Left'#3'h'#1#6'Height'#2#14#3'T'
|
||||
+'op'#2'P'#5'Width'#2'+'#7'Caption'#6#9'Reticule:'#11'ParentColor'#8#0#0#7'TB'
|
||||
+'utton'#9'btnAddPie'#4'Left'#2'0'#6'Height'#2#24#3'Top'#2#8#5'Width'#2'4'#25
|
||||
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Pie'#7'OnClick'#7#14'btnAddPi'
|
||||
+'eClick'#8'TabOrder'#2#0#0#0#7'TButton'#10'btnAddLine'#4'Left'#3#216#0#6'Hei'
|
||||
+'ght'#2#24#3'Top'#2#8#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Capt'
|
||||
+'ion'#6#4'Line'#7'OnClick'#7#15'btnAddLineClick'#8'TabOrder'#2#1#0#0#7'TButt'
|
||||
+'on'#10'btnAddArea'#4'Left'#2'h'#6'Height'#2#24#3'Top'#2#8#5'Width'#2'4'#25
|
||||
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#4'Area'#7'OnClick'#7#15'btnAddA'
|
||||
+'reaClick'#8'TabOrder'#2#2#0#0#7'TButton'#9'btnAddBar'#4'Left'#3#160#0#6'Hei'
|
||||
+'ght'#2#24#3'Top'#2#8#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Capt'
|
||||
+'ion'#6#3'Bar'#7'OnClick'#7#14'btnAddBarClick'#8'TabOrder'#2#3#0#0#9'TCheckB'
|
||||
+'ox'#8'cbLegend'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2#8#5'Width'#2'8'#7'C'
|
||||
+'aption'#6#6'Legend'#8'OnChange'#7#14'cbLegendChange'#8'TabOrder'#2#4#0#0#9
|
||||
+'TCheckBox'#12'cbBottomAxis'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2#24#5'Wi'
|
||||
+'dth'#2'K'#7'Caption'#6#11'Bottom Axis'#7'Checked'#9#8'OnChange'#7#18'cbBott'
|
||||
+'omAxisChange'#5'State'#7#9'cbChecked'#8'TabOrder'#2#5#0#0#9'TCheckBox'#10'c'
|
||||
+'bLeftAxis'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2'('#5'Width'#2'<'#7'Capti'
|
||||
+'on'#6#9'Left Axis'#7'Checked'#9#8'OnChange'#7#16'cbLeftAxisChange'#5'State'
|
||||
+#7#9'cbChecked'#8'TabOrder'#2#6#0#0#9'TCheckBox'#7'cbTitle'#4'Left'#3#240#1#6
|
||||
+'Height'#2#17#3'Top'#2#8#5'Width'#2'('#7'Caption'#6#5'Title'#7'Checked'#9#8
|
||||
+'OnChange'#7#13'cbTitleChange'#5'State'#7#9'cbChecked'#8'TabOrder'#2#7#0#0#9
|
||||
+'TCheckBox'#8'cbFooter'#4'Left'#3#240#1#6'Height'#2#17#3'Top'#2#24#5'Width'#2
|
||||
+'2'#7'Caption'#6#6'Footer'#8'OnChange'#7#14'cbFooterChange'#8'TabOrder'#2#8#0
|
||||
+#0#9'TCheckBox'#10'cbInverted'#4'Left'#3#240#1#6'Height'#2#17#3'Top'#2'('#5
|
||||
+'Width'#2';'#7'Caption'#6#8'Inverted'#8'OnChange'#7#16'cbInvertedChange'#8'T'
|
||||
+'abOrder'#2#9#0#0#7'TButton'#11'btnClearBar'#4'Left'#3#160#0#6'Height'#2#24#3
|
||||
+'Top'#2'&'#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Ba'
|
||||
+'r'#7'OnClick'#7#16'btnClearBarClick'#8'TabOrder'#2#10#0#0#7'TButton'#12'btn'
|
||||
+'ClearArea'#4'Left'#2'h'#6'Height'#2#24#3'Top'#2'&'#5'Width'#2'4'#25'BorderS'
|
||||
+'pacing.InnerBorder'#2#4#7'Caption'#6#4'Area'#7'OnClick'#7#17'btnClearAreaCl'
|
||||
+'ick'#8'TabOrder'#2#11#0#0#7'TButton'#12'btnClearLine'#4'Left'#3#216#0#6'Hei'
|
||||
+'ght'#2#24#3'Top'#2'&'#5'Width'#2'4'#25'BorderSpacing.InnerBorder'#2#4#7'Cap'
|
||||
+'tion'#6#4'Line'#7'OnClick'#7#17'btnClearLineClick'#8'TabOrder'#2#12#0#0#7'T'
|
||||
+'Button'#11'btnClearPie'#4'Left'#2'0'#6'Height'#2#24#3'Top'#2'&'#5'Width'#2
|
||||
,'4'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#3'Pie'#7'OnClick'#7#16'bt'
|
||||
+'nClearPieClick'#8'TabOrder'#2#13#0#0#9'TSpinEdit'#10'edAddCount'#4'Left'#3
|
||||
+' '#1#6'Height'#2#21#3'Top'#2#24#5'Width'#2'Z'#8'MaxValue'#4'@B'#15#0#8'MinV'
|
||||
+'alue'#2#1#8'TabOrder'#2#14#5'Value'#2#1#0#0#9'TCheckBox'#18'cbShowGridCheck'
|
||||
+'Box'#4'Left'#3#128#1#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'F'#7'Caption'#6
|
||||
+#10'Show grid '#7'Checked'#9#8'OnChange'#7#24'cbShowGridCheckBoxChange'#5'St'
|
||||
+'ate'#7#9'cbChecked'#8'TabOrder'#2#15#0#0#9'TCheckBox'#16'cbShowAxisTitles'#4
|
||||
+'Left'#3#240#1#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'?'#7'Caption'#6#11'Axis'
|
||||
+' titles'#8'OnChange'#7#22'cbShowAxisTitlesChange'#8'TabOrder'#2#16#0#0#9'TC'
|
||||
+'omboBox'#11'cbMarkStyle'#4'Left'#3#132#0#6'Height'#2#21#3'Top'#2'L'#5'Width'
|
||||
+#3#136#0#10'ItemHeight'#2#13#9'ItemIndex'#2#5#13'Items.Strings'#1#6#9'smsCus'
|
||||
+'tom'#6#7'smsNone'#6#8'smsValue'#6#10'smsPercent'#6#8'smsLabel'#6#15'smsLabe'
|
||||
+'lPercent'#6#13'smsLabelValue'#6#9'smsLegend'#6#15'smsPercentTotal'#6#20'sms'
|
||||
+'LabelPercentTotal'#6#9'smsXValue'#0#5'Style'#7#14'csDropDownList'#8'TabOrde'
|
||||
+'r'#2#17#4'Text'#6#15'smsLabelPercent'#0#0#9'TComboBox'#10'cbReticule'#4'Lef'
|
||||
+'t'#3#160#1#6'Height'#2#21#3'Top'#2'L'#5'Width'#3#136#0#10'ItemHeight'#2#13#9
|
||||
+'ItemIndex'#2#0#13'Items.Strings'#1#6#6'rmNone'#6#10'rmVertical'#6#12'rmHori'
|
||||
+'zontal'#6#7'rmCross'#0#8'OnChange'#7#16'cbReticuleChange'#5'Style'#7#14'csD'
|
||||
+'ropDownList'#8'TabOrder'#2#18#4'Text'#6#6'rmNone'#0#0#0#0
|
||||
]);
|
||||
|
@ -67,6 +67,7 @@ type
|
||||
procedure InitLine;
|
||||
procedure InitPie;
|
||||
procedure InitArea;
|
||||
procedure BringToFront(ASeries: TChartSeries);
|
||||
end;
|
||||
|
||||
var
|
||||
@ -79,11 +80,20 @@ uses
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.BringToFront(ASeries: TChartSeries);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Chart1.SeriesCount - 1 do
|
||||
Chart1.Series[i].ZPosition := Ord(Chart1.Series[i] <> ASeries);
|
||||
end;
|
||||
|
||||
procedure TForm1.btnAddAreaClick(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
if FArea = nil then InitArea;
|
||||
BringToFront(FArea);
|
||||
FArea.Marks.Style := TSeriesMarksStyle(cbMarkStyle.ItemIndex);
|
||||
for i := 1 to edAddCount.Value do begin
|
||||
X3 := X3 + 1;
|
||||
@ -99,6 +109,7 @@ var
|
||||
i: integer;
|
||||
begin
|
||||
if FBar = nil then InitBar;
|
||||
BringToFront(FBar);
|
||||
FBar.Marks.Style := TSeriesMarksStyle(cbMarkStyle.ItemIndex);
|
||||
for i := 1 to edAddCount.Value do begin
|
||||
FBar.AddXY(x, y, '', clRed);
|
||||
@ -114,6 +125,7 @@ var
|
||||
i: integer;
|
||||
begin
|
||||
if FLine = nil then InitLine;
|
||||
BringToFront(FLine);
|
||||
FLine.Marks.Style := TSeriesMarksStyle(cbMarkStyle.ItemIndex);
|
||||
for i := 1 to edAddCount.Value do begin
|
||||
FLine.AddXY(x1, y1, '', clGreen);
|
||||
@ -128,6 +140,7 @@ var
|
||||
i: integer;
|
||||
begin
|
||||
if FPie = nil then InitPie;
|
||||
BringToFront(FPie);
|
||||
FPie.Marks.Style := TSeriesMarksStyle(cbMarkStyle.ItemIndex);
|
||||
for i := 1 to edAddCount.Value do begin
|
||||
FPie.AddPie(3.4234235235, 'sde21312', clTAColor);
|
||||
|
@ -49,10 +49,11 @@ type
|
||||
|
||||
TBasicChartSeries = class(TComponent)
|
||||
protected
|
||||
FTitle: String;
|
||||
FChart: TChart;
|
||||
FActive: Boolean;
|
||||
FChart: TChart;
|
||||
FShowInLegend: Boolean;
|
||||
FTitle: String;
|
||||
FZPosition: Integer;
|
||||
|
||||
procedure AfterAdd; virtual;
|
||||
procedure DrawLegend(ACanvas: TCanvas; const ARect: TRect); virtual; abstract;
|
||||
@ -63,12 +64,13 @@ type
|
||||
out AIndex: Integer; out AImg: TPoint; out AValue: TDoublePoint): Boolean;
|
||||
virtual;
|
||||
function GetSeriesColor: TColor; virtual; abstract;
|
||||
procedure UpdateBounds(
|
||||
var AXMin, AYMin, AXMax, AYMax: Double); virtual; abstract;
|
||||
procedure UpdateMargins(ACanvas: TCanvas; var AMargins: TRect); virtual;
|
||||
procedure SetActive(AValue: Boolean); virtual; abstract;
|
||||
procedure SetSeriesColor(const AValue: TColor); virtual; abstract;
|
||||
procedure SetShowInLegend(AValue: Boolean); virtual; abstract;
|
||||
procedure SetZPosition(const AValue: Integer);
|
||||
procedure UpdateBounds(
|
||||
var AXMin, AYMin, AXMax, AYMax: Double); virtual; abstract;
|
||||
procedure UpdateMargins(ACanvas: TCanvas; var AMargins: TRect); virtual;
|
||||
|
||||
procedure ReadState(Reader: TReader); override;
|
||||
procedure SetParentComponent(AParent: TComponent); override;
|
||||
@ -88,6 +90,7 @@ type
|
||||
property ShowInLegend: Boolean
|
||||
read FShowInLegend write SetShowInLegend default true;
|
||||
property Title: String read FTitle write FTitle;
|
||||
property ZPosition: Integer read FZPosition write SetZPosition default 0;
|
||||
end;
|
||||
|
||||
TSeriesClass = class of TBasicChartSeries;
|
||||
@ -180,6 +183,7 @@ type
|
||||
function GetChartWidth: Integer;
|
||||
|
||||
function GetSeriesCount: Integer;
|
||||
function GetSeriesInZOrder: TFPList;
|
||||
|
||||
protected
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
|
||||
@ -309,6 +313,12 @@ const
|
||||
MinDouble = -1.7e308;
|
||||
MaxDouble = 1.7e308;
|
||||
|
||||
function CompareZPosition(AItem1, AItem2: Pointer): Integer;
|
||||
begin
|
||||
Result :=
|
||||
TBasicChartSeries(AItem2).ZPosition - TBasicChartSeries(AItem1).ZPosition;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
var
|
||||
i: Integer;
|
||||
@ -1093,6 +1103,7 @@ end;
|
||||
procedure TChart.DisplaySeries(ACanvas: TCanvas);
|
||||
var
|
||||
i: Integer;
|
||||
seriesInZOrder: TFPList;
|
||||
begin
|
||||
if SeriesCount = 0 then exit;
|
||||
|
||||
@ -1101,10 +1112,15 @@ begin
|
||||
IntersectClipRect(
|
||||
ACanvas.Handle, FClipRect.Left, FClipRect.Top, FClipRect.Right, FClipRect.Bottom);
|
||||
|
||||
// Update all series
|
||||
for i := 0 to SeriesCount - 1 do
|
||||
if Series[i].Active then
|
||||
Series[i].Draw(ACanvas);
|
||||
seriesInZOrder := GetSeriesInZOrder;
|
||||
try
|
||||
for i := 0 to SeriesCount - 1 do
|
||||
with TBasicChartSeries(seriesInZOrder[i]) do
|
||||
if Active then
|
||||
Draw(ACanvas);
|
||||
finally
|
||||
seriesInZOrder.Free;
|
||||
end;
|
||||
|
||||
// Now disable clipping.
|
||||
SelectClipRgn(ACanvas.Handle, 0);
|
||||
@ -1281,6 +1297,18 @@ begin
|
||||
Result := FSeries.FList.Count;
|
||||
end;
|
||||
|
||||
function TChart.GetSeriesInZOrder: TFPList;
|
||||
begin
|
||||
Result := TFPList.Create;
|
||||
try
|
||||
Result.Assign(FSeries.FList);
|
||||
Result.Sort(@CompareZPosition);
|
||||
except
|
||||
Result.Free;
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChart.UpdateExtent;
|
||||
var
|
||||
XMinSeries, YMinSeries, XMaxSeries, YMaxSeries, Valeur, Tolerance: Double;
|
||||
@ -1414,6 +1442,12 @@ begin
|
||||
(AParent as TChart).AddSeries(Self);
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.SetZPosition(const AValue: Integer);
|
||||
begin
|
||||
if FZPosition = AValue then exit;
|
||||
FZPosition := AValue;
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.UpdateMargins(
|
||||
ACanvas: TCanvas; var AMargins: TRect);
|
||||
begin
|
||||
|
@ -87,6 +87,7 @@ type
|
||||
property Marks: TChartMarks read FMarks write SetMarks;
|
||||
property ShowInLegend;
|
||||
property Title;
|
||||
property ZPosition;
|
||||
end;
|
||||
|
||||
{ TBasicPointSeries }
|
||||
|
Loading…
Reference in New Issue
Block a user