/// <summary> /// Chart를 초기화 합니다. /// </summary> /// <param name="chart"></param> public static void InitChart(BTChart chart, bool view3D) { chart.Tools.Clear(); chart.Series.Clear(); chart.Aspect.View3D = view3D; //chart.Aspect.ColorPaletteIndex = 1; //excel type chart.Aspect.ColorPaletteIndex = 9; //win xp type chart.Aspect.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; chart.Aspect.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; chart.Aspect.ThemeIndex = 4; chart.Panel.Brush.Color = Color.FromArgb(226, 236, 221); chart.Header.Visible = false; chart.Legend.Visible = false; chart.Axes.Bottom.Labels.Style = AxisLabelStyle.None; chart.Axes.Bottom.Title.Visible = false; //InitPanel(chart); InitAxes(chart); if (view3D) { InitWall(chart); } }
/// <summary> /// /// </summary> /// <param name="chart"></param> /// <param name="pTitle"></param> public static void InitHeader(BTChart chart, string pTitle) { chart.Header.Font.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(128))); chart.Header.Font.Name = "Tahoma"; chart.Header.Font.Shadow.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224))); chart.Header.Font.Shadow.Visible = true; chart.Header.Text = pTitle; chart.Header.Visible = true; }
/// <summary> /// /// </summary> /// <param name="chart"></param> public static void InitWall(BTChart chart) { chart.Walls.Bottom.Pen.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224))); chart.Walls.Bottom.Pen.Visible = false; chart.Walls.Bottom.Size = 5; chart.Walls.Left.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224))); chart.Walls.Left.Size = 5; chart.Walls.Right.Brush.Color = System.Drawing.Color.Silver; }
public static void DrawVerticalLine(BTChart objChart, Line lineSeries, float Value) { float[] HorizontalX = new float[2]; float[] HorizontalY = new float[2]; HorizontalX[0] = HorizontalX[1] = Value; HorizontalY[0] = (float)objChart.Axes.Left.Minimum; HorizontalY[1] = (float)objChart.Axes.Left.Maximum; lineSeries.Add(HorizontalX, HorizontalY); }
public static void SetChartHeaderTitle(BTChart chart, string titleText, System.Drawing.StringAlignment alignment, int titleFontSize) { chart.Header.Alignment = alignment; chart.Header.Font.Bold = false; chart.Header.Font.Name = "Tahoma"; chart.Header.Font.Size = titleFontSize; chart.Header.Font.Color = Color.Black; chart.Header.Text = titleText; chart.Header.Visible = true; }
/// <summary> /// clear chart /// </summary> /// <param name="objChart"></param> public static void ChartClear(BTChart chart) { chart.Panel.Color = Color.White; chart.Tools.Clear(); chart.Series.RemoveAllSeries(); chart.Aspect.View3D = false; chart.Header.Visible = false; chart.Axes.Bottom.Labels.Style = AxisLabelStyle.None; chart.Axes.Bottom.Title.Visible = false; }
/// <summary> /// /// </summary> /// <param name="chart"></param> public static void InitAxes(BTChart chart) { chart.Axes.Bottom.Grid.Color = System.Drawing.Color.Gray; chart.Axes.Bottom.Ticks.Length = 2; chart.Axes.Depth.Grid.Color = System.Drawing.Color.Gray; chart.Axes.Depth.Ticks.Length = 2; chart.Axes.Left.Grid.Color = System.Drawing.Color.Gray; chart.Axes.Left.Ticks.Length = 2; chart.Axes.Right.Grid.Color = System.Drawing.Color.Gray; chart.Axes.Right.Ticks.Length = 2; chart.Axes.Top.Grid.Color = System.Drawing.Color.Gray; chart.Axes.Top.Ticks.Length = 2; }
/// <summary> /// /// </summary> /// <param name="chart"></param> public static void InitPieChart(BTChart chart) { chart.Aspect.Chart3DPercent = 25; chart.Aspect.Elevation = 315; chart.Aspect.Orthogonal = false; chart.Aspect.Perspective = 0; chart.Aspect.Rotation = 360; chart.Tools.Clear(); chart.Series.Clear(); chart.Aspect.View3D = true; InitChart(chart, true); }
/// <summary> /// Gantt Zoom Chart만 적용됩니다. /// </summary> /// <param name="chart"></param> public static void InitZoomChart(BTChart chart) { chart.Aspect.View3D = false; chart.Tools.Clear(); chart.Series.Clear(); chart.Header.Visible = false; chart.Legend.Visible = false; chart.Aspect.ColorPaletteIndex = 9; //win xp type chart.Aspect.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; chart.Aspect.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; chart.Aspect.ThemeIndex = 4; chart.Axes.Depth.AxisPen.Visible = false; chart.Axes.Depth.Title.Visible = false; chart.Axes.Bottom.AxisPen.Visible = false; chart.Axes.Bottom.MinorTicks.Visible = false; chart.Axes.Bottom.Title.Visible = false; chart.Axes.Right.AxisPen.Visible = false; chart.Axes.Right.MinorTicks.Visible = false; chart.Axes.Right.Title.Visible = false; chart.Panel.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(254)), ((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))); chart.Axes.Bottom.Labels.Style = AxisLabelStyle.None; chart.Axes.Bottom.Title.Visible = false; chart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None; chart.Panel.MarginBottom = 0; chart.Panel.MarginLeft = 2.6; chart.Panel.MarginRight = 2.6; chart.Panel.MarginTop = 0; //zoom scroll mode 막기 chart.Panning.Allow = Steema.TeeChart.ScrollModes.None; chart.Panning.Active = false; chart.Zoom.Allow = true; chart.Zoom.Direction = Steema.TeeChart.ZoomDirections.Horizontal; chart.Tools.Clear(); chart.Series.Clear(); }
/// <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); }
/// <summary> /// Legend를 사용합니다. /// </summary> /// <param name="chart"></param> /// <param name="location"></param> /// <param name="visibleCheckBox"></param> public static void InitLegend(BTChart chart, LegendAlignments location, LegendStyles style, bool visibleCheckBox) { chart.Legend.Visible = true; chart.Legend.Alignment = location; chart.Legend.LegendStyle = style; chart.Legend.TextStyle = LegendTextStyles.Plain; chart.Legend.Font.Name = "Tahoma"; chart.Legend.Font.Size = 7; chart.Legend.Symbol.Pen.Visible = false; chart.Legend.Symbol.Width = 10; chart.Legend.Symbol.WidthUnits = LegendSymbolSize.Pixels; chart.Legend.TopLeftPos = 0; chart.Legend.CheckBoxes = visibleCheckBox; chart.Legend.Shadow.Visible = false; chart.Legend.Brush.Color = chart.Panel.Color; chart.Legend.Pen.Visible = false; chart.Legend.Font.Size = 7; }
/// <summary> /// /// </summary> /// <param name="chart"></param> public static void InitPanel(BTChart chart) { //chart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None; //chart.Panel.BorderRound = 10; chart.Panel.Brush.Color = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(236)), ((System.Byte)(221)), ((System.Byte)(192))); //chart.Panel.Brush.Gradient.EndColor = System.Drawing.Color.DarkGray; //chart.Panel.Brush.Gradient.MiddleColor = System.Drawing.Color.Empty; //chart.Panel.Brush.Gradient.StartColor = System.Drawing.Color.White; //chart.Panel.Gradient.EndColor = System.Drawing.Color.DarkGray; //chart.Panel.Gradient.MiddleColor = System.Drawing.Color.Empty; //chart.Panel.Gradient.StartColor = System.Drawing.Color.White; //chart.Panel.Pen.Color = System.Drawing.Color.Navy; chart.Panel.Pen.Visible = false; //chart.Panel.Pen.Width = 3; chart.Panel.Shadow.Height = 0; chart.Panel.Shadow.Width = 0; }
public static Point CaculateLocationOfAnnotation(int x, int y, Size annoOfSize, BTChart tchart) { int centerX = tchart.Width / 2; int centerY = tchart.Height / 2; int[] position = new int[2]; Point p = new Point(x, y); if (centerX >= x && centerY >= y) // 1영역 : 그냥 마우스 클릭 위치에.. { } else if (centerX <= x && centerY >= y) // 2 영역 : 마우스 클릭이 anno의 왼쪽 위 모서리가 된다. { p.X = x - annoOfSize.Width; } else if (centerX >= x && centerY <= y) // 3 영역 : 마우스 클릭위치의 anno의 오른쪽 아래 모서리 { p.Y = y - annoOfSize.Height; } else // 4 영역 : 마우스 클릭위치의 anno의 왼쪽 아래 모서리 { p.X = x - annoOfSize.Width; p.Y = y - annoOfSize.Height; } int chkDiff = tchart.Height - (annoOfSize.Height + p.Y); if (chkDiff < 0) { p.Y += chkDiff; } return(p); }
/// <summary> /// 차트의 header를 설정합니다. /// </summary> /// <param name="chart"></param> /// <param name="title"></param> public static void SetHeader(BTChart chart, string title) { chart.Header.Visible = true; chart.Header.Text = title; chart.Header.Font.Bold = true; }
/// <summary> /// Chart Image(jpeg)를 clipboard에 복사를 합니다. /// </summary> /// <param name="chart">복사할 Chart</param> public static void CopyToClipboard(BTChart chart) { chart.Export.Image.JPEG.CopyToClipboard(); }