改成这就可以了,要引用SERIES单元 var mychart : tchart; myseries:Tbarseries; begin mychart:=TChart.Create(self); mychart.parent:=form1; myseries:=Tbarseries.create(self); mychart.AddSeries(myseries); myseries.ParentChart:=mychart; with mychart.series[0] as Tbarseries do begin barstyle:=bsRectangle; end; end;
to:lxl(蚊蚊) 我少写了一句,myChart.Parent为一个Panel
To anglely168(我是天使!) tlinechar,tbartchart怎么用,我不知道,你能说详细一点吗,谢谢!
with mychart.series[0] as TBarchart do ~~~~~~~~~ 应该是TBarSeries,没有TBartChart类
var mychart : tchart;
myseries:Tbarseries;
begin
mychart:=TChart.Create(self);
mychart.parent:=form1;
myseries:=Tbarseries.create(self);
mychart.AddSeries(myseries);
myseries.ParentChart:=mychart;
with mychart.series[0] as Tbarseries do
begin
barstyle:=bsRectangle;
end;
end;
我少写了一句,myChart.Parent为一个Panel
tlinechar,tbartchart怎么用,我不知道,你能说详细一点吗,谢谢!
~~~~~~~~~
应该是TBarSeries,没有TBartChart类
你没试过我的代码?
不过这个代码运行时你是看不到有BAR的,
因为还没有调用TBARSERIES.ADDBAR。
你说的TBARSERIES.ADDBAR是什么意思,怎么调用啊
我知道你的代码是对的了,是我没看清