procedure TfrmAGraph.pGraphYear ; //
var
Serise1,Serise2,Serise3,Serise4,Serise5,Serise6,Serise7,Serise8 : TBarSeries ;
A_i : integer ;
begin
// 차트 시리즈 clear
for A_i:= Chart1.SeriesCount-1 downto 0 do
begin
Chart1.Series[A_i].free;
end ;
Serise1 := TBarSeries.Create(Self); // bar 생성
Serise2 := TBarSeries.Create(Self); // bar 생성
Serise3 := TBarSeries.Create(Self); // bar 생성
Serise4 := TBarSeries.Create(Self); // bar 생성
for A_i:= Chart2.SeriesCount-1 downto 0 do
begin
Chart2.Series[A_i].free;
end ;
Serise5 := TBarSeries.Create(Self); // bar 생성
Serise6 := TBarSeries.Create(Self); // bar 생성
Serise7 := TBarSeries.Create(Self); // bar 생성
Serise8 := TBarSeries.Create(Self); // bar 생성
procedure TfrmAGraph.pSeriseYearAdd(A_se : TchartSeries ; A_Row : integer ;A_Color : TColor) ;
var A_i : integer ;
begin
for A_i := 1 to 12 do
A_Se.Add(fdStrtoFloat(stgrid.Cells[A_i,A_Row]),inttostr(A_i)+'월',A_Color);
// fdStrtoFloat 는 strtofloat 로 표현가능
end ;
procedure TfrmAGraph.pChart1Setting(A_Title : string) ;
begin
Chart1.Title.Text.Clear;
Chart1.Title.text.Add(A_title) ;
procedure TfrmAGraph.pStGridComma(A_dev,A_1,A_2,A_3 : integer) ;
var A_Col,A_Row : integer ;
begin
for A_Col := 1 to Stgrid.Colcount - 1 do
begin
for A_Row := 1 to Stgrid.Rowcount - 1 do
begin
Stgrid.Cells[A_Col,A_row] := fsKumkDisp(Stgrid.Cells[A_Col,A_row], 11) ;
//fsKumkDisp = User Made function
차트1은 1~12월까지의 매출등 그래프.
차트2는 차트1의 합계.
일부 불합리한 루틴도 있으나 이걸 토대로 연구하심이...
procedure TfrmAGraph.pGraphYear ; //
var
Serise1,Serise2,Serise3,Serise4,Serise5,Serise6,Serise7,Serise8 : TBarSeries ;
A_i : integer ;
begin
// 차트 시리즈 clear
for A_i:= Chart1.SeriesCount-1 downto 0 do
begin
Chart1.Series[A_i].free;
end ;
Serise1 := TBarSeries.Create(Self); // bar 생성
Serise2 := TBarSeries.Create(Self); // bar 생성
Serise3 := TBarSeries.Create(Self); // bar 생성
Serise4 := TBarSeries.Create(Self); // bar 생성
serise1.marks.visible := false ;
serise2.marks.visible := false ;
serise3.marks.visible := false ;
serise4.marks.visible := false ;
pSeriseYearAdd(Serise1,1,clBlue) ;
pSeriseYearAdd(Serise2,2,clRed) ;
pSeriseYearAdd(Serise3,3,clGreen) ;
pSeriseYearAdd(Serise4,4,clFuchsia) ;
chart1.AddSeries(Serise1);
chart1.AddSeries(Serise2);
chart1.AddSeries(Serise3);
chart1.AddSeries(Serise4);
pChart1Setting('차트1 제목') ;
// 합계금액
for A_i:= Chart2.SeriesCount-1 downto 0 do
begin
Chart2.Series[A_i].free;
end ;
Serise5 := TBarSeries.Create(Self); // bar 생성
Serise6 := TBarSeries.Create(Self); // bar 생성
Serise7 := TBarSeries.Create(Self); // bar 생성
Serise8 := TBarSeries.Create(Self); // bar 생성
Serise5.Add(fdStrtoFloat(stgrid.Cells[13,1]),'매출',clBlue);
Serise6.Add(fdStrtoFloat(stgrid.Cells[13,2]),'수금',clRed);
Serise7.Add(fdStrtoFloat(stgrid.Cells[13,3]),'매입',clGreen);
Serise8.Add(fdStrtoFloat(stgrid.Cells[13,4]),'지급',clFuchsia);
chart2.AddSeries(Serise5);
chart2.AddSeries(Serise6);
chart2.AddSeries(Serise7);
chart2.AddSeries(Serise8);
pChart2Setting('차트2 제목') ;
end ;
procedure TfrmAGraph.pSeriseYearAdd(A_se : TchartSeries ; A_Row : integer ;A_Color : TColor) ;
var A_i : integer ;
begin
for A_i := 1 to 12 do
A_Se.Add(fdStrtoFloat(stgrid.Cells[A_i,A_Row]),inttostr(A_i)+'월',A_Color);
// fdStrtoFloat 는 strtofloat 로 표현가능
end ;
procedure TfrmAGraph.pChart1Setting(A_Title : string) ;
begin
Chart1.Title.Text.Clear;
Chart1.Title.text.Add(A_title) ;
Chart1.BottomAxis.LabelsFont.Size := 10 ;
Chart1.LeftAxis.LabelsFont.Size := 10 ;
Chart1.BottomAxis.labelsMultiline := true ;
end ;
procedure TfrmAGraph.pStGridComma(A_dev,A_1,A_2,A_3 : integer) ;
var A_Col,A_Row : integer ;
begin
for A_Col := 1 to Stgrid.Colcount - 1 do
begin
for A_Row := 1 to Stgrid.Rowcount - 1 do
begin
Stgrid.Cells[A_Col,A_row] := fsKumkDisp(Stgrid.Cells[A_Col,A_row], 11) ;
//fsKumkDisp = User Made function
end;
end ;
end ;