using cAlgo.API;
namespace cAlgo
{
// このサンプルインジケーターは、TextTrimmingプロパティを使用してテキストのトリムを管理する方法を示します
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TextTrimmingSample : Indicator
{
[Parameter("Text", DefaultValue = "very long texttttttttttttttttttttt")]
public string Text { get; set; }
[Parameter("Trimming", DefaultValue = TextTrimming.CharacterEllipsis)]
public TextTrimming TextTrimming { get; set; }
protected override void Initialize()
{
var stackPanel = new StackPanel
{
BackgroundColor = Color.Gold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Opacity = 0.6,
Width = 100
};
stackPanel.AddChild(new TextBlock
{
Text = Text,
FontWeight = FontWeight.ExtraBold,
ForegroundColor = Color.Blue,
TextTrimming = TextTrimming
});
Chart.AddControl(stackPanel);
}
public override void Calculate(int index)
{
}
}
}