Ejemplo n.º 1
0
        protected void DrawValueAxisGrid(Report rpt, Graphics g, ChartGridLines gl, Point s, Point e)
        {
            if (gl == null || !gl.ShowGridLines)
            {
                return;
            }

            if (gl.Style != null)
            {
                gl.Style.DrawStyleLine(rpt, g, null, s, e);
            }
            else
            {
                g.DrawLine(Pens.Black, s, e);
            }

            return;
        }
Ejemplo n.º 2
0
        bool _CanOmit = false;    // When display values don't fit, is it OK to drop some from display

        internal Axis(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _Visible        = false;
            _Style          = null;
            _Title          = null;
            _Title2         = null;// 20022008 AJM GJL
            _Margin         = false;
            _MajorTickMarks = AxisTickMarksEnum.None;
            _MinorTickMarks = AxisTickMarksEnum.None;
            _MajorGridLines = null;
            _MinorGridLines = null;
            _MajorInterval  = null;
            _MinorInterval  = null;
            _Reverse        = false;
            _CrossAt        = 0;
            _Interlaced     = false;
            _Scalar         = false;
            _Min            = null;
            _Max            = null;
            _LogScale       = false;
            _Month          = false; //12052008 WP

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Visible":
                    _Visible = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Style":
                    _Style = new Style(r, this, xNodeLoop);
                    break;

                case "Title":
                    _Title = new Title(r, this, xNodeLoop);
                    break;

                // 20022008 AJM GJL - Second Y axis
                case "Title2":
                case "fyi:Title2":
                    _Title2 = new Title(r, this, xNodeLoop);
                    break;

                case "Margin":
                    _Margin = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "MajorTickMarks":
                    _MajorTickMarks = AxisTickMarks.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "MinorTickMarks":
                    _MinorTickMarks = AxisTickMarks.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "MajorGridLines":
                    _MajorGridLines = new ChartGridLines(r, this, xNodeLoop);
                    break;

                case "MinorGridLines":
                    _MinorGridLines = new ChartGridLines(r, this, xNodeLoop);
                    break;

                case "MajorInterval":
                    _MajorInterval = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    OwnerReport.rl.LogError(4, "Axis element MajorInterval is currently ignored.");
                    break;

                case "MinorInterval":
                    _MinorInterval = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    OwnerReport.rl.LogError(4, "Axis element MinorInterval is currently ignored.");
                    break;

                case "Reverse":
                    _Reverse = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "CrossAt":
                    _CrossAt = XmlUtil.Integer(xNodeLoop.InnerText);
                    break;

                case "Interlaced":
                    _Interlaced = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Scalar":
                    _Scalar = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Min":
                    _Min = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    break;

                case "Max":
                    _Max = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                    break;

                case "LogScale":
                    _LogScale = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "Month":
                case "fyi:Month":
                    _Month = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                case "fyi:CanOmit":
                    _CanOmit = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown Axis element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        protected void DrawValueAxisTick(Report rpt, Graphics g, bool bMajor, AxisTickMarksEnum tickType, ChartGridLines gl, Point p)
        {
            if (tickType == AxisTickMarksEnum.None)
                return;

            int len = bMajor? AxisTickMarkMajorLen: AxisTickMarkMinorLen;
            Point s, e;
            switch (tickType)
            {
                case AxisTickMarksEnum.Inside:
                    s = new Point(p.X, p.Y);
                    e = new Point(p.X+len, p.Y);
                    break;
                case AxisTickMarksEnum.Cross:
                    s = new Point(p.X-len, p.Y);
                    e = new Point(p.X+len, p.Y);
                    break;
                case AxisTickMarksEnum.Outside:
                default:
                    s = new Point(p.X-len, p.Y);
                    e = new Point(p.X, p.Y);
                    break;
            }
            Style style = gl.Style;

            if (style != null)
                style.DrawStyleLine(rpt, g, null, s, e);
            else
                g.DrawLine(Pens.Black, s, e);

            return;
        }
Ejemplo n.º 4
0
        //*******************************************************************************************************************************
        protected void DrawValueAxisGrid(Report rpt, Graphics g, ChartGridLines gl, Point s, Point e)
        {
            if (gl == null || !gl.ShowGridLines)
                return;

            if (gl.Style != null)
                gl.Style.DrawStyleLine(rpt, g, null, s, e);
            else
                g.DrawLine(Pens.Black, s, e);

            return;
        }
Ejemplo n.º 5
0
        bool _Visible; // Whether the axis labels are displayed. Defaults to false.

        #endregion Fields

        #region Constructors

        internal Axis(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            _Visible =false;
            _Style = null;
            _Title = null;
            _Title2 = null;// 20022008 AJM GJL
            _Margin = false;
            _MajorTickMarks = AxisTickMarksEnum.None;
            _MinorTickMarks = AxisTickMarksEnum.None;
            _MajorGridLines = null;
            _MinorGridLines = null;
            _MajorInterval = null;
            _MinorInterval =null;
            _Reverse = false;
            _CrossAt = 0;
            _Interlaced = false;
            _Scalar=false;
            _Min=null;
            _Max=null;
            _LogScale=false;
            _Month = false; //12052008 WP

            // Loop thru all the child nodes
            foreach(XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                    continue;
                switch (xNodeLoop.Name)
                {
                    case "Visible":
                        _Visible = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "Style":
                        _Style = new Style(r, this, xNodeLoop);
                        break;
                    case "Title":
                        _Title = new Title(r, this, xNodeLoop);
                        break;
                    // 20022008 AJM GJL - Second Y axis
                    case "Title2":
                    case "fyi:Title2":
                        _Title2 = new Title(r, this, xNodeLoop);
                       break;
                    case "Margin":
                        _Margin = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "MajorTickMarks":
                        _MajorTickMarks = AxisTickMarks.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "MinorTickMarks":
                        _MinorTickMarks = AxisTickMarks.GetStyle(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "MajorGridLines":
                        _MajorGridLines = new ChartGridLines(r, this, xNodeLoop);
                        break;
                    case "MinorGridLines":
                        _MinorGridLines = new ChartGridLines(r, this, xNodeLoop);
                        break;
                    case "MajorInterval":
                        _MajorInterval = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                        OwnerReport.rl.LogError(4, "Axis element MajorInterval is currently ignored.");
                        break;
                    case "MinorInterval":
                        _MinorInterval = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                        OwnerReport.rl.LogError(4, "Axis element MinorInterval is currently ignored.");
                        break;
                    case "Reverse":
                        _Reverse = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "CrossAt":
                        _CrossAt = XmlUtil.Integer(xNodeLoop.InnerText);
                        break;
                    case "Interlaced":
                        _Interlaced = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "Scalar":
                        _Scalar = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "Min":
                        _Min = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                        break;
                    case "Max":
                        _Max = new Expression(OwnerReport, this, xNodeLoop, ExpressionType.Integer);
                        break;
                    case "LogScale":
                        _LogScale = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "Month":
                    case "fyi:Month":
                        _Month = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    case "fyi:CanOmit":
                        _CanOmit = XmlUtil.Boolean(xNodeLoop.InnerText, OwnerReport.rl);
                        break;
                    default:
                        // don't know this element - log it
                        OwnerReport.rl.LogError(4, "Unknown Axis element '" + xNodeLoop.Name + "' ignored.");
                        break;
                }
            }
        }
Ejemplo n.º 6
0
        protected void DrawValueAxisTick(Report rpt, Graphics g, bool bMajor, AxisTickMarksEnum tickType, ChartGridLines gl, Point p)
        {
            if (tickType == AxisTickMarksEnum.None)
            {
                return;
            }

            int   len = bMajor? AxisTickMarkMajorLen: AxisTickMarkMinorLen;
            Point s, e;

            switch (tickType)
            {
            case AxisTickMarksEnum.Inside:
                s = new Point(p.X, p.Y);
                e = new Point(p.X, p.Y - len);
                break;

            case AxisTickMarksEnum.Cross:
                s = new Point(p.X, p.Y - len);
                e = new Point(p.X, p.Y + len);
                break;

            case AxisTickMarksEnum.Outside:
            default:
                s = new Point(p.X, p.Y + len);
                e = new Point(p.X, p.Y);
                break;
            }
            Style style = gl.Style;

            if (style != null)
            {
                style.DrawStyleLine(rpt, g, null, s, e);
            }
            else
            {
                g.DrawLine(Pens.Black, s, e);
            }

            return;
        }