T
TDelphing
Unregistered / Unconfirmed
GUEST, unregistred user!
我是动态添加TBarSeries,在为他安排CustomerAxes,但是结果却发现显示的Bar成细条状,
通过Edit换成其他类型的Series如FastLine都可以!程序大致如下:
var
Series1:TLIneSeries;
VertAxis,HorizAxis:TChartAxis;
begin
Series1 := TLineSeries.Create(self);
Series1.ParentChart := DBChartAnalyse;
Series1.FillSampleValues(10);
DBChartAnalyse.CustomAxes.Add;
VertAxis := DBChartAnalyse.CustomAxes.Items[DBChartAnalyse.CustomAxes.Count-1];
VertAxis.Horizontal := false;
VertAxis.StartPosition := x*Step;
VertAxis.EndPosition := (x+1)*Step;
Series1.CustomVertAxis := VertAxis;
DBChartAnalyse.CustomAxes.Add;
HorizAxis := DBChartAnalyse.CustomAxes.Items[DBChartAnalyse.CustomAxes.Count-1];
HorizAxis.Horizontal := true;
HorizAxis.PositionPercent := 99-(x+1)*Step;
Series1.CustomHorizAxis := HorizAxis;
通过Edit换成其他类型的Series如FastLine都可以!程序大致如下:
var
Series1:TLIneSeries;
VertAxis,HorizAxis:TChartAxis;
begin
Series1 := TLineSeries.Create(self);
Series1.ParentChart := DBChartAnalyse;
Series1.FillSampleValues(10);
DBChartAnalyse.CustomAxes.Add;
VertAxis := DBChartAnalyse.CustomAxes.Items[DBChartAnalyse.CustomAxes.Count-1];
VertAxis.Horizontal := false;
VertAxis.StartPosition := x*Step;
VertAxis.EndPosition := (x+1)*Step;
Series1.CustomVertAxis := VertAxis;
DBChartAnalyse.CustomAxes.Add;
HorizAxis := DBChartAnalyse.CustomAxes.Items[DBChartAnalyse.CustomAxes.Count-1];
HorizAxis.Horizontal := true;
HorizAxis.PositionPercent := 99-(x+1)*Step;
Series1.CustomHorizAxis := HorizAxis;