Hallo, I find the wrong code.
Code: Select all
Steema.TeeChart.Styles.Line line1;
private void InitializeChart()
{
tChart1.Legend.Visible = false;
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
}
void tChart1_DoubleClick(object sender, EventArgs e)
{
tChart1.Clear();
tChart1.Aspect.View3D = false;
tChart1.Aspect.ZOffset = 0;
tChart1.Axes.Bottom.AxisPen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Bottom.Increment = 0.041666666666666664 / 3600;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "HH:mm:ss";
tChart1.Axes.Bottom.Labels.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Bottom.Labels.Font.Name = "Trebuchet MS";
tChart1.Axes.Bottom.MaximumOffset = 5;
tChart1.Axes.Bottom.MinimumOffset = 5;
tChart1.Axes.Bottom.Automatic = true;
tChart1.Axes.Bottom.Title.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
//tChart1.Axes.Bottom.Title.Transparent = true;
//tChart1.Axes.Depth.Title.Transparent = true;
//tChart1.Axes.DepthTop.Title.Transparent = true;
tChart1.Axes.Left.AxisPen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Left.AxisPen.Width = 0;
tChart1.Axes.Left.Labels.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Left.Labels.Font.Name = "Trebuchet MS";
tChart1.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
tChart1.Axes.Left.MaximumOffset = 5;
tChart1.Axes.Left.MinimumOffset = 5;
tChart1.Axes.Left.Title.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
//tChart1.Axes.Left.Title.Transparent = true;
tChart1.Axes.Right.AxisPen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Right.Grid.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Right.MinorGrid.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Right.MinorGrid.Visible = true;
tChart1.Axes.Right.MinorTicks.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Right.Title.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
//tChart1.Axes.Right.Title.Transparent = true;
tChart1.Axes.Right.Visible = false;
tChart1.Axes.Top.Automatic = false;
tChart1.Axes.Top.AutomaticMaximum = false;
tChart1.Axes.Top.AutomaticMinimum = false;
tChart1.Axes.Top.AxisPen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
tChart1.Axes.Top.Labels.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Axes.Top.Maximum = 0;
tChart1.Axes.Top.Minimum = 0;
//tChart1.Axes.Top.Title.Transparent = true;
tChart1.Axes.Top.Visible = false;
//tChart1.BackColor = System.Drawing.Color.Transparent;
tChart1.Header.AdjustFrame = false;
tChart1.Header.Alignment = System.Drawing.StringAlignment.Near;
tChart1.Header.Bottom = 30;
tChart1.Header.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
tChart1.Header.CustomPosition = true;
tChart1.Header.Font.Bold = true;
tChart1.Header.Font.Brush.Color = System.Drawing.Color.White;
tChart1.Header.Font.Name = "Trebuchet MS";
tChart1.Header.Left = 23;
tChart1.Header.Lines = new string[] {
""};
tChart1.Header.Right = 212;
tChart1.Header.Top = 15;
tChart1.Legend.Bevel.ColorOne = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
tChart1.Legend.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
//tChart1.Legend.Brush.Gradient.Transparency = 70;
tChart1.Legend.DividingLines.Width = 0;
tChart1.Legend.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(0)))));
tChart1.Legend.FontSeriesColor = true;
tChart1.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series;
tChart1.Legend.Pen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
//tChart1.Legend.Pen.Transparency = 80;
tChart1.Legend.Pen.Visible = false;
tChart1.Legend.Shadow.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
//tChart1.Legend.Shadow.Brush.Gradient.Transparency = 70;
tChart1.Legend.Shadow.Visible = false;
tChart1.Legend.Symbol.Width = 25;
tChart1.Legend.Title.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
//tChart1.Legend.Title.Brush.Gradient.Transparency = 80;
tChart1.Legend.Title.Font.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
tChart1.Legend.Title.Font.Name = "Trebuchet MS";
tChart1.Legend.Title.Lines = new string[] {
"Legende"};
tChart1.Legend.Title.Shadow.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(169)))), ((int)(((byte)(169)))), ((int)(((byte)(169)))));
//tChart1.Legend.Title.Shadow.Brush.Gradient.Transparency = 80;
tChart1.Legend.Title.Visible = true;
tChart1.Legend.TopLeftPos = 0;
tChart1.Panel.Bevel.ColorOne = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
tChart1.Panel.Bevel.ColorTwo = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Panel.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
tChart1.Panel.Brush.ForegroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(106)))), ((int)(((byte)(106)))), ((int)(((byte)(106)))));
tChart1.Panel.Brush.Gradient.Direction = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
tChart1.Panel.Brush.Gradient.EndColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
tChart1.Panel.Brush.Gradient.MiddleColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
tChart1.Panel.Brush.Gradient.StartColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
tChart1.Panel.Brush.Gradient.Style.Direction = Steema.TeeChart.Drawing.PathGradientMode.Radial;
tChart1.Panel.Brush.Gradient.Visible = false;
tChart1.Panel.Brush.Solid = false;
tChart1.Panel.Brush.Style = System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal;
tChart1.Panel.MarginBottom = 18;
tChart1.Panel.MarginLeft = 0;
tChart1.Panel.MarginRight = 5;
tChart1.Panel.MarginTop = 36;
tChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels;
tChart1.Panel.Pen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
tChart1.Panel.Pen.Visible = true;
tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
tChart1.Panning.MouseButton = System.Windows.Forms.MouseButtons.Left;
tChart1.TabIndex = 0;
tChart1.Walls.Back.Visible = false;
tChart1.Walls.Bottom.Visible = false;
tChart1.Zoom.Allow = false;
// 2. Function
tChart1.Aspect.View3D = false; // 3D ausschalten
tChart1.Axes.Bottom.AxisPen.Color = Color.White; // Farbe Achse unten
tChart1.Axes.Bottom.Labels.Font.Brush.Color = Color.White; // Farbe Achsenbeschriftung unten
tChart1.Axes.Left.AxisPen.Color = Color.White; // Farbe Achse links
tChart1.Axes.Left.Labels.Font.Brush.Color = Color.White;
tChart1.Axes.Left.Title.Font.Brush.Color = Color.White;
/* // ERROR CODE
tChart1.Panel.Color = Color.Gray;
tChart1.Panel.Brush.Gradient.Visible = false;
tChart1.Panel.Brush.Visible = false;
tChart1.Walls.Back.Visible = false;
tChart1.Walls.Bottom.Visible = false;
*/
line1.LinePen.Color = Color.Gray;
line1.LinePen.Width = 2;
line1.Brush.Visible = false;
line1.ColorEach = false;
line1.Dark3D = false;
// Meßdaten erfassen
tChart1.Series.Clear();
//line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1.Series.Add(line1);
Random rnd = new Random();
tChart1.AutoRepaint = false;
line1.Clear();
line1.Add(rnd.Next(100));
for (int i = 1; i < 20; i++)
{
line1.Add(line1.YValues.Value[i - 1] + rnd.Next(10) - 5);
}
tChart1.AutoRepaint = true;
tChart1.Refresh();
}
The error is
tChart1.Panel.Brush.Gradient.Visible = false;
tChart1.Panel.Brush.Visible = false;
tChart1.Walls.Back.Visible = false;
tChart1.Walls.Bottom.Visible = false;
Note: In my programm I change the chart typ (line / bar ...) and the color ...
The wrong code is not necessary for me.
Thank you