Exemplo n.º 1
0
        private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
        {
            if (idx1 != -1)
            {
                int adjustY = 0;
                if (((lineSeries1.CalcYPos(idx1) - 5) - tChart1.Axes.Left.CalcYPosValue(tChart1.Axes.Left.Maximum)) < (g.FontHeight + 2))
                {
                    adjustY = g.FontHeight;
                }
                else if ((tChart1.Axes.Bottom.Position - lineSeries1.CalcYPos(idx1)) < (g.FontHeight + 2))
                {
                    adjustY = -(g.FontHeight + 2);
                }

                g.Sphere(lineSeries1.CalcXPos(idx1), lineSeries1.CalcYPos(idx1), 0, 4);

                String msg = "Value: " + Steema.TeeChart.Utils.FormatFloat("#.00", lineSeries1.YValues[idx1]);

                g.Brush.Transparency = 50;
                g.Pen.Color          = Color.DarkGray;
                g.Rectangle(lineSeries1.CalcXPos(idx1) + 5 - 1, lineSeries1.CalcYPos(idx1) + adjustY - 5,
                            lineSeries1.CalcXPos(idx1) + (int)g.TextWidth(msg) + 3 + 5 + 1,
                            lineSeries1.CalcYPos(idx1) + adjustY + g.FontHeight + 2 - 5);

                g.TextOut(lineSeries1.CalcXPos(idx1) + 5, lineSeries1.CalcYPos(idx1) - 5 + adjustY, msg);
            }
        }