Annotation creation in code
Posted: Thu Sep 24, 2009 4:46 am
Version: 3.5.3498.27368
OS: Windows XP
Hi,
I am trying to create an annotation with a callout in code but are having trouble getting it to display.
I am after a annotation with no border, a gradient fill, and a shadow. The callout is to be red with no pointer. I have tried several variantions on the following code with no success (I get an white annotation with no callout or gradient fill).
Also, i have tried using the designer to create the code and whilst being displayed correctly in the design view, the property changes for the annotation and the callout are not being serialized, and not displayed at runtime.
TIA,
NojaPower
OS: Windows XP
Hi,
I am trying to create an annotation with a callout in code but are having trouble getting it to display.
I am after a annotation with no border, a gradient fill, and a shadow. The callout is to be red with no pointer. I have tried several variantions on the following code with no success (I get an white annotation with no callout or gradient fill).
Code: Select all
Steema.TeeChart.Tools.Annotation backgroundCurveLabel = new Steema.TeeChart.Tools.Annotation();
backgroundCurveLabel.Active = true;
backgroundCurveLabel.Text = tccManager.GetTCCName(backgroundCurveID);
backgroundCurveLabel.AutoSize = true;
backgroundCurveLabel.Callout.Visible = true;
backgroundCurveLabel.Callout.Style = PointerStyles.Nothing;
backgroundCurveLabel.Callout.XPosition = MainSeries.CalcXPos(this.MainSeries.Count / 2);
backgroundCurveLabel.Callout.YPosition = MainSeries.CalcYPos(this.MainSeries.Count / 2);
backgroundCurveLabel.Callout.Pen.Visible = true;
backgroundCurveLabel.Callout.Pen.Color = Color.Red;
backgroundCurveLabel.Callout.Pen.Width = 3;
backgroundCurveLabel.Left = this.MainSeries.CalcXPos(this.MainSeries.Count / 2) + 20;
backgroundCurveLabel.Top = this.MainSeries.CalcYPos(this.MainSeries.Count / 2) - 20;
backgroundCurveLabel.Shape.Brush.Gradient.StartColor = Color.Cornsilk;
backgroundCurveLabel.Shape.Brush.Gradient.Visible = true;
backgroundCurveLabel.Shape.Pen.Visible = false;
parentChart.Tools.Add(backgroundCurveLabel);
TIA,
NojaPower