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); } }
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { Chart tChart1 = (Chart)sender; ColorGrid colorGrid1 = (ColorGrid)tChart1[0]; g.Font.Size = 20; string myStr = ""; Color newColor; ColorList lstColor = new ColorList(); double y, x; for (int i = 0; i < colorGrid1.Count; i++) { myStr = colorGrid1.YValues.Value[i].ToString("0.00"); y = colorGrid1.GetVertAxis.CalcPosValue(colorGrid1.ZValues[i]); x = colorGrid1.GetHorizAxis.CalcPosValue(colorGrid1.XValues[i]); newColor = colorGrid1.ValueColor(i).Luminosity > 0.5f ? Color.Black : Color.White; g.Font.Color = newColor; g.TextOut( x + colorGrid1.GetHorizAxis.CalcSizeValue(0.25), y - colorGrid1.GetVertAxis.CalcSizeValue(1.25), myStr); } }
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { g.Font.Color = Color.Blue; g.Font.Bold = true; g.Font.Size = 11; g.TextAlign = StringAlignment.Near; if (checkBox1.Checked) { g.TextOut(10, 10, "DateTime values"); } else { g.TextOut(10, 10, "DateTime as double"); } }
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { if (this.checkBox1.Checked) { if (this.checkBox1.Checked) { System.Drawing.Rectangle legRect = this.tChart1.Legend.ShapeBounds; Steema.TeeChart.Drawing.Graphics3D gr = tChart1.Graphics3D; gr.HorizontalLine(legRect.Left, legRect.Right, legRect.Bottom - 30); gr.TextAlign = System.Drawing.StringAlignment.Near; gr.Font.Size = 8; gr.Font.Color = Color.Navy; gr.TextOut(legRect.Left + 8, legRect.Bottom - 28, "Additional text"); gr.TextOut(legRect.Left + 8, legRect.Bottom - 16, "displayed here."); } } }
void ChartAfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { if (currentIndex != -1) { double xCenter = LineChart.Chart.Series[0].CalcXPos(currentIndex); double yCenter = LineChart.Chart.Series[0].CalcYPos(currentIndex); g.Font.Size = g.Font.Size * 1.5; double offSet = 0; g.TextOut(xCenter - offSet, yCenter - (g.Font.Size * 4), " Value: " + LineChart.Chart.Series[0].YValues[currentIndex].ToString()); Rectangle r = new Rectangle(xCenter - 25, yCenter - 25, 50, 50); g.Brush = pBrush; g.Pen.Width = 4; g.Ellipse(r); } }
private void DrawBannerText() { Steema.TeeChart.Drawing.Graphics3D c = tChart1.Graphics3D; c.Font.Color = Color.Gray; c.Font.Shadow.Height = 1; c.Font.Shadow.Width = 1; for (int i = 0; i < bt.Length; i++) { bt[i].tmpSizeCount += 1; if (bt[i].tmpSizeCount >= 1) { bt[i].tmpSizeCount = 0; bt[i].tmpSize += bt[i].DeltaSize; if (bt[i].tmpSize < 2) { bt[i].DeltaSize = 1; } else if (bt[i].tmpSize > 22) { bt[i].DeltaSize = -1; } } c.Font.Size = bt[i].tmpSize; bt[i].tmpX += bt[i].DeltaX; if ((bt[i].tmpX < -30) || (bt[i].tmpX > tChart1.Width)) { bt[i].DeltaX = -bt[i].DeltaX; } bt[i].tmpY += bt[i].DeltaY; if ((bt[i].tmpY < 0) || (bt[i].tmpY > tChart1.Height)) { bt[i].DeltaY = -bt[i].DeltaY; } c.TextOut(bt[i].tmpX, bt[i].tmpY, bt[i].SomeText); } }
private void movAvg_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g) { Series series = sender as Series; Chart tChart2 = series.Chart; if ((tChart2.Series.Count > 2) && (sender == tChart2.Series[2]) && (tChart2.Series[2].Function is Steema.TeeChart.Functions.MovingAverage)) { g.Font.Color = Color.White; g.Font.Size = 16; Steema.TeeChart.Drawing.PointDouble point = new Steema.TeeChart.Drawing.PointDouble(tChart2.Series[2].CalcXPos(3), tChart2.Series[2].CalcYPos(3)); string seriesLabel = AppResources.DeltaAverage; double textWidth = g.TextWidth(seriesLabel); double textHeight = g.TextHeight(seriesLabel); g.Brush.Color = Color.Black; g.Brush.Transparency = 40; g.Pen.Color = tChart2.Series[2].Color; g.Pen.Width = 2; g.Pen.Visible = true; g.Rectangle(point.X - 4, point.Y, point.X + textWidth + 4, point.Y + textHeight + 4); g.TextAlign = TextAlignment.Start; g.TextOut(point.X, point.Y, seriesLabel); } }
private void tChart1_AfterDrawMaxMin(object sender, Steema.TeeChart.Drawing.Graphics3D g) { Chart tChart1 = (Chart)sender; Line minTempLine = (Line)tChart1[0]; int textMargin = 4; g.Font.Size = 12; g.BackColor = Color.White; g.Font.Color = Color.White; List <int> indexMin = new List <int>(); List <int> indexMax = new List <int>(); bool down = false; double x, y; if (minTempLine[0].Y > minTempLine[1].Y) { down = true; } for (int i = 1; i <= minTempLine.Count; i++) { if (down) { if (minTempLine[i].Y > minTempLine[i - 1].Y) { down = false; indexMin.Add(i - 1); } } else { if (minTempLine[i].Y < minTempLine[i - 1].Y) { down = true; indexMax.Add(i - 1); } } } foreach (int i in indexMin) { //low y = minTempLine.GetVertAxis.CalcYPosValue(minTempLine.YValues[i]); x = minTempLine.GetHorizAxis.CalcXPosValue(minTempLine.XValues[i]); string outStr = minTempLine.YValues[i].ToString("0.0") + (App.DegTempScale == TempScale.celsius ? " ºC" : " ºF").ToString(); double strWdth = g.TextWidth(outStr); double strHght = g.TextHeight(outStr); //g.Rectangle(x - (strWdth / 2) - textMargin, y - (textMargin/2), x + (strWdth / 2) + textMargin, y + (strHght * 1.2) + textMargin); g.TextOut( x - (g.TextWidth(outStr) / 2), y, outStr); } foreach (int i in indexMax) { //high y = minTempLine.GetVertAxis.CalcYPosValue(minTempLine.YValues[i]); x = minTempLine.GetHorizAxis.CalcXPosValue(minTempLine.XValues[i]); string outStr = minTempLine.YValues[i].ToString("0.0") + (App.DegTempScale == TempScale.celsius ? " ºC" : " ºF").ToString(); double strWdth = g.TextWidth(outStr); double strHght = g.TextHeight(outStr); // g.Rectangle(x - (strWdth / 2) - textMargin, y - strHght - textMargin, x + (strWdth / 2), y + textMargin); g.TextOut( x - (g.TextWidth(outStr) / 2), y - (g.TextHeight("W") * 1.2), outStr); } }
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { g.TextOut(10, 10, counter.ToString()); }