Example #1
0
        /// <summary>
        /// Creates a default axis style.
        /// </summary>
        public AxisLineStyle(bool showTicks, CSAxisSide preferredTickSide, Main.Properties.IReadOnlyPropertyBag context)
        {
            double penWidth        = GraphDocument.GetDefaultPenWidth(context);
            double majorTickLength = GraphDocument.GetDefaultMajorTickLength(context);
            var    color           = GraphDocument.GetDefaultForeColor(context);

            _axisPen         = new PenX3D(color, penWidth);
            _majorTickPen    = new PenX3D(color, penWidth);
            _minorTickPen    = new PenX3D(color, penWidth);
            _majorTickLength = majorTickLength;
            _minorTickLength = majorTickLength / 2;

            if (showTicks)
            {
                _showFirstUpMajorTicks    = preferredTickSide == CSAxisSide.FirstUp;
                _showFirstDownMajorTicks  = preferredTickSide == CSAxisSide.FirstDown;
                _showSecondUpMajorTicks   = preferredTickSide == CSAxisSide.SecondUp;
                _showSecondDownMajorTicks = preferredTickSide == CSAxisSide.SecondDown;

                _showFirstUpMinorTicks    = preferredTickSide == CSAxisSide.FirstUp;
                _showFirstDownMinorTicks  = preferredTickSide == CSAxisSide.FirstDown;
                _showSecondUpMinorTicks   = preferredTickSide == CSAxisSide.SecondUp;
                _showSecondDownMinorTicks = preferredTickSide == CSAxisSide.SecondDown;
            }
        }
Example #2
0
        /// <summary>
        /// Creates a default axis style.
        /// </summary>
        public AxisLineStyle(Main.Properties.IReadOnlyPropertyBag context)
        {
            double penWidth        = GraphDocument.GetDefaultPenWidth(context);
            double majorTickLength = GraphDocument.GetDefaultMajorTickLength(context);
            var    color           = GraphDocument.GetDefaultForeColor(context);

            _axisPen = new PenX(color, penWidth)
            {
                ParentObject = this
            };
            _majorTickPen = new PenX(color, penWidth)
            {
                ParentObject = this
            };
            _minorTickPen = new PenX(color, penWidth)
            {
                ParentObject = this
            };
            _majorTickLength         = majorTickLength;
            _minorTickLength         = majorTickLength / 2;
            _showFirstUpMajorTicks   = true; // true if right major ticks should be visible
            _showFirstDownMajorTicks = true; // true if left major ticks should be visible
            _showFirstUpMinorTicks   = true; // true if right minor ticks should be visible
            _showFirstDownMinorTicks = true; // true if left minor ticks should be visible
        }