Listed below is the code I currently use. Remnants of my attempted code at the time has been commented out.
Thanks
Code: Select all
procedure TfmAnalyticalGraphs.FillSampleSeries;
Var
AnalyteSeries : TLineSeries;
NameNew, NameOld: String;
Begin
ChartTSByAnalyte.SeriesList.Clear;
ClientDSTimeSeriesByAnalyte.Filtered := False;
ClientDSTimeSeriesByAnalyte.Filter := 'ANALYTE = '+QuotedStr(AnalyteName);
ClientDSTimeSeriesByAnalyte.Filtered := True;
with ClientDSTimeSeriesByAnalyte do
begin
DisableControls;
try
First;
NameNew := ClientDSTimeSeriesByAnalyteSAMPLE_NAME.AsString;
while not(EOF) do
Begin
NameOld := NameNew;
AnalyteSeries := TLineSeries.Create(Self);
AnalyteSeries.ParentChart := chartTSByAnalyte;
AnalyteSeries.Title := NameNew;
AnalyteSeries.pointer.Style := psCircle;
AnalyteSeries.Pointer.Visible := True;
AnalyteSeries.XValues.DateTime := True;
chartTSByAnalyte.Axes.Bottom.DateTimeFormat := 'mm/dd/yy';
chartTSByAnalyte.Axes.Left.AxisValuesFormat := '0.00';
while NameOld = NameNew do
begin
AnalyteSeries.AddXY(FindField('SAMPLE_DATE').AsDateTime, FindField('RESULT').AsFloat);
// if FindField('DETECTED').AsString = 'No' then
// begin
// SampleSeries.OnGetPointerStyle;
// result := psStar;
// end
// else
// SampleSeries.OnGetPointerStyle()
// result := psCircle;
if Not (EOF) then
Begin
next;
NameNew := FindField('SAMPLE_NAME').AsString; //Get Sample Name
end
else
Break;
end
end
finally
EnableControls;
end
end
end;