Delphi-如何在运行时创建堆叠的钢筋系列? [英] Delphi - How to create a stacked bar series during runtime?

查看:103
本文介绍了Delphi-如何在运行时创建堆叠的钢筋系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建2个在运行时使用Delphi中的Teechart系列彼此叠加的系列。
本质上我想拥有2个系列,每个系列都有2个条目或数据点,并且相应的数据点iow series1 datapoint1和series 2数据点1应该相互堆叠以形成单个
条形图。

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 procedure or property to change to no avail.

推荐答案

最小示例:

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);

这篇关于Delphi-如何在运行时创建堆叠的钢筋系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆