There is a property inside Teechart edit window named bar offset. Like the following picture. Inside .dfm file it's name is OffsetPercent.

Q: How to change it at runtime.

enter image description here

有帮助吗?

解决方案

The OffsetPercent property is published by the TCustomBarSeries class, so you can typecast the series which is this series type descendant to access the property, e.g.:

TCustomBarSeries(Chart1.Series[0]).OffsetPercent := 65;

Or, if you know the exact series type, e.g. in your case the THorizBarSeries:

THorizBarSeries(Chart1.Series[0]).OffsetPercent := 65;

I've intentionally missed a class type testing (with the is operator) since it's not relevant for the answer, but you should use it in your real code if you weren't sure about the series class type you're accessing.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top