怎么使用DBChart 进行多种物品在一段时期内的价格分析浮动曲线图,一个物品一条曲线.(50分)

  • 主题发起人 主题发起人 todaysoft
  • 开始时间 开始时间
T

todaysoft

Unregistered / Unconfirmed
GUEST, unregistred user!
DBChart->Title->Text->Text = "物品价格分析图示" ;
QueryGS->First();
while(!QueryGS->Eof)
{
//DBChart->Series->add ;
Query->Filtered = False ;
Query->Filter = "GoodsName='物品名称' " ;
Query->Filtered = True;
WPLineSeries->Title = 物品名称 ;//显示标题
WPLineSeries->ParentChart = DBChart ;
WPLineSeries->DataSource = Query ;
WPLineSeries->XLabelsSource = "RKDate" ; // 确定X坐标数据
WPLineSeries->YValues->ValueSource = "Price" ; //确定Y 坐标数据
WPLineSeries->CheckDataSource() ;
DBChart->SeriesList->Add(WPLineSeries);
QueryGS->Next();
}

只有一条曲线.怎么能让每个物品的曲线都显示
 
delphi代码供参考:
procedure CreateSeries(typeid:integer);
var
CurSeries:TchartSeries;
OldTitle:string;
i:integer;
Isduoxl:Boolean;
Begin
i:=0;
curDataset.First;
oldtitle:=curDataset.FieldByName(TitleNm).AsString;
while not curDataset.Eof do Begin
if Ismul then
Isduoxl:=(curDataset.Bof) or (oldtitle<>curDataset.FieldByName(TitleNm).AsString)
else Isduoxl:=curDataset.Bof;

if Isduoxl then Begin
case typeid of
0:CurSeries:=TFastLineSeries.Create(ParChart); //曲线图
1:CurSeries:=TBarSeries.Create(ParChart); //柱状图
2:CurSeries:=TPieSeries.Create(ParChart); //饼图
end;
CurSeries.ParentChart:=ParChart;
CurSeries.Title:=curDataset.FieldByName(TitleNm).AsString;
CurSeries.Name:='Series'+inttostr(curDataset.RecNo);
CurSeries.ColorEachPoint:=true;
oldtitle:=curDataset.FieldByName(TitleNm).AsString;
End;
if templist.IndexOf(curDataset.FieldByName(Alable).AsString)<0 then
i:=i+1
else i:=templist.IndexOf(curDataset.FieldByName(Alable).AsString);
CurSeries.AddXY(i,curDataset.FieldByName(YFieldNm).AsInteger,curDataset.FieldByName(Alable).AsString);
curDataset.Next;
End;
End;
 
有 cbc 的例子吗?
 
后退
顶部