using cAlgo.API;
namespace cAlgo
{
// このサンプルは、TextAlignment プロパティを使用してテキストを整列させる方法を示します
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TextAlignmentSample : Indicator
{
[Parameter("Text Alignment", DefaultValue = TextAlignment.Center)]
public TextAlignment TextAlignment { get; set; }
protected override void Initialize()
{
var stackPanel = new StackPanel
{
BackgroundColor = Color.Gold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Opacity = 0.6,
Width = 200
};
stackPanel.AddChild(new TextBlock { Text = "サンプルテキスト", TextAlignment = TextAlignment });
Chart.AddControl(stackPanel);
}
public override void Calculate(int index)
{
}
}
}