예제 #1
0
 public DrawMarkerData(ChControl cc, DecorateMarkers dm)
 {
     this.cc = cc;
     this.dm = dm;
     this.Children.Add(cc);
     this.cc.Parent = this;
 }
예제 #2
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="cd">Chart Data</param>
        /// <param name="cc">Chart Control</param>
        public DrawText(ChControl cc, ChartData cd)
        {
            //Init Properties
            this.Title  = cd.Title;
            this.XLabel = cd.TitleX;
//			this.YLabels = cd.TitlesY;
            this.XType = cd.AxisLabelX;
            this.YType = cd.AxisLabelY;


            if (cd.TitlesY != null && cd.TitlesY.Length == 1)
            {
                legendhorizontal = false;
            }
            //Set ChControl
            this.cc = cc;

            //Init legend
            ly = new DrawLegend();

            //Add legend and ChControl to Children
            this.Children.Add(cc);
            this.Children.Add(ly);

            //Set Parents of legend and ChControl
            ly.Parent = this;
            cc.Parent = this;
        }
예제 #3
0
        /// <summary>
        /// Constructor, adds prepaint handler to chart control and its children
        /// </summary>
        /// <param name="cc">Chart control</param>
        public DecorateChControlBase(ChControl cc)
        {
            this.cc       = cc;
            cc.PrePaint  += new PaintHandler(cc_PrePaint);
            cc.PostPaint += new PaintHandler(cc_PostPaint);

            //Add eventhandlers for PrePaint and PostPaint to all children
            RecursiveSearch(cc.Children);
        }
예제 #4
0
        protected override void OnPostPaint(ChControl cc, Graphics g)
        {
            DrawGrid gr = cc as DrawGrid;

            if (gr != null)
            {
                foreach (PointF p in points)
                {
                    DrawMarker(gr, g, p);
                }
            }
        }
예제 #5
0
 /// <summary>
 /// Recursivly find the location of a ChControl refered to top ChControl parent
 /// </summary>
 /// <param name="c"></param>
 /// <returns></returns>
 Point GetParentLocation(ChControl c)
 {
     if (c.Parent == null)
     {
         return(c.Location);
     }
     else
     {
         Point p  = GetParentLocation(c.Parent);
         Point pc = new Point(c.Location.X + p.X, c.Location.Y + p.Y);
         return(pc);
     }
 }
예제 #6
0
 /// <summary>
 /// Called after the control has been drawn
 /// </summary>
 /// <param name="cc">Chart Control</param>
 /// <param name="g">Graphic g</param>
 protected abstract void OnPostPaint(ChControl cc, Graphics g);
예제 #7
0
 //Call OPostPaint
 private void cc_PostPaint(ChControl cc, Graphics g)
 {
     OnPostPaint(cc, g);
 }
예제 #8
0
 //Call OPrePaint
 private void cc_PrePaint(ChControl sender, Graphics g)
 {
     OnPrePaint(sender, g);
 }
예제 #9
0
 /// <summary>
 /// Decorates the chart control
 /// </summary>
 /// <param name="cc">chart control</param>
 /// <param name="g">Graphics</param>
 protected override void OnPrePaint(ChControl cc, Graphics g)
 {
     cc.Font      = font;
     cc.BackColor = backcolor;
     cc.ForeColor = forecolor;
 }
예제 #10
0
 protected override void OnPostPaint(ChControl cc, Graphics g)
 {
 }
예제 #11
0
 /// <summary>
 /// constructor, calls base constructor
 /// </summary>
 /// <param name="cc">Chart control</param>
 /// <param name="ForeColor">Foreground color</param>
 /// <param name="BackColor">Background color</param>
 /// <param name="Font">Font</param>
 public DecorateSkin(ChControl cc, Color ForeColor, Color BackColor, Font Font) : base(cc)
 {
     forecolor = ForeColor;
     backcolor = BackColor;
     this.font = Font;
 }
예제 #12
0
 /// <summary>
 /// Add control to collection
 /// </summary>
 /// <param name="cc">Chart control</param>
 /// <returns>index</returns>
 public int Add(ChControl cc)
 {
     return(this.List.Add(cc));
 }