private void DrawHeader(Graphics graphics, Rectangle clipRect)
        {
            var info     = _mHeaderInfo;
            var viewRect = _mViewport.Rectangle;

            // Draw header backgrounds
            var e = new HeaderPaintEventArgs(graphics, clipRect, this, this.Font, this.HeaderFormat);

            OnPaintHeader(e);
            var gradient = new LinearGradientBrush(info.H1Rect, e.Format.GradientLight, e.Format.GradientDark, LinearGradientMode.Vertical);

            graphics.FillRectangles(gradient, new RectangleF[] { info.H1Rect, info.H2Rect });
            graphics.DrawRectangles(e.Format.Border, new RectangleF[] { info.H1Rect, info.H2Rect });

            // Draw the header scales
            __DrawScale(graphics, clipRect, e.Font, e.Format, info.LabelRects, info.DateTimes);

            // draw "Now" line
            float xf  = GetSpan(Scheduler.Now);
            var   pen = new Pen(e.Format.Border.Color)
            {
                DashStyle = DashStyle.Dash, Color = Color.Red
            };

            graphics.DrawLine(pen, new PointF(xf, _mViewport.Y), new PointF(xf, _mViewport.Rectangle.Bottom));
        }
 protected virtual void OnPaintHeader(HeaderPaintEventArgs e)
 {
     PaintHeader?.Invoke(this, e);
 }