Delphi - How to create a stacked bar series during runtime?

南楼画角 提交于 2020-08-05 09:57:24

问题


I would like to create 2 series that stack upon each other using the Teechart series in Delphi during runtime. Essentially I want to have 2 series, each with 2 entries, or data points, and the corresponding data points, i.o.w series1 datapoint1 and series 2 datapoint 1, should stack upon each other to form a single bar.

I have tried to look for a precedure or property to change to no avail.

Thanks ahead of time!

Regards, Romans


回答1:


Minimal example:

var
  S1, S2: TBarSeries;
begin
  S1 := TBarSeries(Chart1.AddSeries(TBarSeries));
  S2 := TBarSeries(Chart1.AddSeries(TBarSeries));
  S1.MultiBar := mbStacked;
  S2.MultiBar := mbStacked;
  //S1.StackGroup := 0;
  //S2.StackGroup := 0;  //same group if few groups will be used
  S1.Add(3);
  S1.Add(1);
  S2.Add(2);
  S2.Add(4);


来源:https://stackoverflow.com/questions/63086596/delphi-how-to-create-a-stacked-bar-series-during-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!