Exemple #1
0
        /// <summary>
        /// 차트의 ToolTip을 설정하고 Annotation을 반환합니다.
        /// </summary>
        /// <param name="chart"></param>
        public static Annotation AddToolTip(BTChart chart)
        {
            Steema.TeeChart.Tools.Annotation ann = new Steema.TeeChart.Tools.Annotation();

            ann.Active = false;
            ann.Shape.CustomPosition = true;
            ann.Shape.Shadow.Visible = false;
            ann.Shape.Color          = Color.Yellow;
            //ann.Shape.Font.Name = "Tahoma";
            ann.Shape.Font.Name = "arial";
            //anno.Shape.Shadow.Visible = false;
            ann.Shape.Transparency = 50;
            ann.Shape.Pen.Color    = ChartDesign.GetColor(0);
            ann.Shape.ShapeStyle   = Steema.TeeChart.Drawing.TextShapeStyle.RoundRectangle;

            chart.Tools.Add(ann);
            return(ann);
        }
Exemple #2
0
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            tChart1.Header.Text   = "Canvas ICloneable Implementation";
            annotation1           = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
            annotation1.Text      = "Click on me!";
            annotation1.Position  = Steema.TeeChart.Tools.AnnotationPositions.LeftTop;
            line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line1.FillSampleValues();
            selector1           = new Steema.TeeChart.Tools.Selector(tChart1.Chart);
            selector1.AllowDrag = false;
            selector1.Selected += new Steema.TeeChart.Tools.SelectorSelectedEventHandler(selector1_Selected);

            tChart1.Axes.Left.Grid.Visible   = false;
            tChart1.Axes.Bottom.Grid.Visible = false;

            tChart1.KeyDown   += new KeyEventHandler(tChart1_KeyDown);
            tChart1.AfterDraw += new PaintChartEventHandler(tChart1_AfterDraw);
        }
Exemple #3
0
 private void Chart_MouseClick(object sender, MouseEventArgs e)
 {
     if (this.tChart.Series.Count > 0)
     {
         tChart.Tools.Clear();
         for (int i = 0; i < tChart.Series.Count; i++)
         {
             if (tChart.Series[i].Active)
             {
                 int index = this.tChart.Series[i].Clicked(e.X, e.Y);
                 if (index != -1)
                 {
                     Steema.TeeChart.Tools.Annotation annotation = new Steema.TeeChart.Tools.Annotation(tChart.Chart);
                     annotation.Text = Math.Round(this.tChart.Series[i].YValues.Value[index], 2).ToString();
                     annotation.Shape.CustomPosition = true;
                     annotation.Shape.Left           = e.X + 15;
                     annotation.Shape.Top            = e.Y + i * 20;
                 }
             }
         }
     }
 }