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 revChart_BeforeDrawSeries(object sender, Steema.TeeChart.Drawing.Graphics3D g) { if (warningOn) //display rev warning light { g.Brush.Image = SubaruBRZSimul.Properties.Resources.redline_warning; g.Pen.Transparency = 100; g.Rectangle(309, 207, 349, 247); } }
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { if (cursorTool1.XValue > tChart1.Axes.Bottom.Minimum && cursorTool1.XValue < tChart1.Axes.Bottom.Maximum) { g.Brush.Color = Color.Red; g.Brush.Visible = true; int xpos = cursorTool1.GetHorizAxis.CalcPosValue(cursorTool1.XValue); int ypos = cursorTool1.GetVertAxis.CalcPosValue(cursorTool1.YValue); g.Rectangle(xpos - 5, ypos + 5, xpos + 5, ypos - 5); } }
private void chart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { for (int i = 0; i < bar3D1.Count; i++) { double left = bar3D1.CalcXPos(i); // -(bar3D1.BarBounds.Width / 2); double right = bar3D1.CalcXPos(i) + (bar3D1.BarBounds.Width / 2); double top = Chart1.Axes.Left.CalcPosValue(0); double bottom = Chart1.Axes.Left.CalcPosValue(bar3D1.ValuesLists[2][i]); if (bottom > top) { Rectangle r = new Rectangle(Steema.TeeChart.Utils.Round(left), Steema.TeeChart.Utils.Round(top), Steema.TeeChart.Utils.Round(bar3D1.BarBounds.Width), Steema.TeeChart.Utils.Round(bottom - top)); g.Brush.Color = Color.FromArgb(255, 164, 189, 255); g.Pen.Visible = false; g.Rectangle(r); } } }
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); } }