我使用了iplot,x轴的数据来自数据库,现在的问题是:显示的日期时间根本不对。
代码如下:
iPlot1.XAxis[0].Title:=Trim(XComboBox.Text); // X轴名称
iPlot1.XAxis[0].TitleFont.color:=myC;
iPlot1.XAxis[0].TitleShow:=True;
iPlot1.XAxis[0].LabelsFormatStyle := iptfDateTime;
iPlot1.XAxis[0].DateTimeFormat := 'yyyy/mm/dd hh:nn:ss';
//iPlot1.XAxis[Channel_Count].Span := 10; // X轴显示范围
iPlot1.Channel[0].XAxisName := Trim(XComboBox.Text);//iPlot1.XAxis[0].Name;
iPlot1.XAxis[0].LabelsFont.Color := myC; // 标签字体颜色
iPlot1.XAxis[0].TitleShow:=True; FreeAndNil(myTbl); mytbl:=DataMForm.CreatetmpSQLTable(Self.name+'my_wavetbl',
'SELECT * FROM EXPERIMDATA WHERE (RECDATE is not NULL) and (EXP_MC='''+DTUComboBox.text+''') and (EXP_LX='''+CMDComboBox.text+''') ORDER BY '+ X_field+' ASC');
mytbl.Active:=True; with mytbl do begin
First;
while not Eof do begin
iPlot1.Channel[Channel_Count].AddXY(FieldByName(X_field).Value,FieldbyName(Y_field).Value); // 跟随绘制0刻度线
Next;
end;
end;
还有一个问题,如何让 显示的曲线 就在采集的内容附近?谢谢
代码如下:
iPlot1.XAxis[0].Title:=Trim(XComboBox.Text); // X轴名称
iPlot1.XAxis[0].TitleFont.color:=myC;
iPlot1.XAxis[0].TitleShow:=True;
iPlot1.XAxis[0].LabelsFormatStyle := iptfDateTime;
iPlot1.XAxis[0].DateTimeFormat := 'yyyy/mm/dd hh:nn:ss';
//iPlot1.XAxis[Channel_Count].Span := 10; // X轴显示范围
iPlot1.Channel[0].XAxisName := Trim(XComboBox.Text);//iPlot1.XAxis[0].Name;
iPlot1.XAxis[0].LabelsFont.Color := myC; // 标签字体颜色
iPlot1.XAxis[0].TitleShow:=True; FreeAndNil(myTbl); mytbl:=DataMForm.CreatetmpSQLTable(Self.name+'my_wavetbl',
'SELECT * FROM EXPERIMDATA WHERE (RECDATE is not NULL) and (EXP_MC='''+DTUComboBox.text+''') and (EXP_LX='''+CMDComboBox.text+''') ORDER BY '+ X_field+' ASC');
mytbl.Active:=True; with mytbl do begin
First;
while not Eof do begin
iPlot1.Channel[Channel_Count].AddXY(FieldByName(X_field).Value,FieldbyName(Y_field).Value); // 跟随绘制0刻度线
Next;
end;
end;
还有一个问题,如何让 显示的曲线 就在采集的内容附近?谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货