|
Chart1->Series[0]->Clear();
Chart1->Series[1]->Clear();
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("select count(*) AS MNUM , MeasuresDate from Patients.db A , Measures.db B");
Query2->SQL->Add("where A.PatientsID=B.PatientsID");
Query2->SQL->Add("and ( MeasuresDate BETWEEN :from_date AND :to_time) ");
Query2->SQL->Add("group by MeasuresDate");
Query2->SQL->Add("order by MeasuresDate");
Query2->ParamByName("from_date")->AsDate = this->DateTimePicker_from->Date;
Query2->ParamByName("to_time")->AsDate = this->DateTimePicker_to->Date;
Query2->Prepare();
if(Query2->Prepared) Query2->Open();
Query2->First();
while(!Query2->Eof )
{
Chart1->Series[0]->AddXY( Query2->RecNo, Query2->FieldByName("MNUM")->AsInteger,"", clYellow);
Query2->Next();
}
Query2->Last();
문의 위의 코드에서
TChart Bottom Axis 에서 증가분으로 넗고 싶습니다.
문제는 날짜로 되어 있어서 MeasuresDate 값을 가져올때 AsDateTime 형식으로 가져오는데
2008-04-01 ~ 2008-05-06 사이를 x축에 넣고 카운트값을 y축에 넣고 싶은데..
최대값과 , 최소값을 기준으로 1일씩 간격으로 해서 그래프를 그리고 싶은데
TChart Bottom Axis 처리를 어떻게 해야되는지 모르겠습니다.
고수님 알려주세요..
Y축은 count 값
X축은 날짜 증분 값
|