Esempio n. 1
0
        /// <summary>
        /// Adds a <c>txPr</c> node (Text properties) to the node of type <c>valAx</c> (Value Axis), <c>catAx</c> (Category Axis Data), <c>dateAx</c> (Date Axis), <c>serAx</c> (Series Axis) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="node">Node of type <c>valAx</c> (Value Axis), <c>catAx</c> (Category Axis Data), <c>dateAx</c> (Date Axis), <c>serAx</c> (Series Axis).</param>
        /// <param name="model">Axis from model.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-draw-chart_txPr-1.html">http://www.schemacentral.com/sc/ooxml/e-draw-chart_txPr-1.html</a>
        /// </remarks>
        private static void AddTextPropertiesNode(this XmlNode node, AxisDefinitionLabelsModel model)
        {
            var textPropertiesNode = ChartXmlHelper.CreateOrDefaultAndAppendElementToNode(node, "c", "txPr");

            textPropertiesNode.AddBodyPropertiesNode(model.Orientation);
            textPropertiesNode.AddTextListStylesNode();
            textPropertiesNode.AddTextParagraphsNode(model.Font);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds label properties (orientation, alignment, color and font) to the specified axis. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="axis"><c>Xml</c> node than represent an axis definition.</param>
        /// <param name="model">Axis from model.</param>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="axis" /> is <c>null</c>.</exception>
        /// <exception cref="T:System.ArgumentNullException">If <paramref name="model" /> is <c>null</c>.</exception>
        /// <exception cref="T:System.InvalidOperationException">If <paramref name="axis" /> is not an axis.</exception>
        public static void AddAxisLabelProperties(this XmlNode axis, AxisDefinitionLabelsModel model)
        {
            SentinelHelper.ArgumentNull(axis);
            SentinelHelper.ArgumentNull(model);
            SentinelHelper.IsFalse(axis.Name.Contains("catAx") || axis.Name.Contains("valAx") || axis.Name.Contains("dateAx"), "Imposible extraer tipo. el nodo no es de tipo eje");

            axis.AddTextPropertiesNode(model);
        }