Exemplo n.º 1
0
        /// <summary>
        /// Adds a numeric dimension
        /// </summary>
        /// <param name="formula">The formula or address</param>
        /// <returns>The numeric data</returns>
        public ExcelChartExNumericData AddNumericDimension(string formula)
        {
            var node = CreateNode("cx:numDim", false, true);
            var nd   = new ExcelChartExNumericData(_serie._chart.WorkSheet.Name, NameSpaceManager, node)
            {
                Formula = formula
            };

            _list.Add(nd);
            return(nd);
        }
Exemplo n.º 2
0
        internal void SetTypeNumeric(int index, eNumericDataType type)
        {
            if (index < 0 || index >= _list.Count)
            {
                throw (new IndexOutOfRangeException("index is out of range"));
            }
            if (_list[index] is ExcelChartExStringData data)
            {
                var node     = data.TopNode;
                var innerXml = data.TopNode.InnerXml;
                node.ParentNode.RemoveChild(node);

                var newNode = CreateNode("cx:numDim", false, true);
                newNode.InnerXml = innerXml;
                var nd = new ExcelChartExNumericData(_serie._chart.WorkSheet.Name, NameSpaceManager, newNode);
                nd.Type      = type;
                _list[index] = nd;
            }
            else
            {
                ((ExcelChartExNumericData)_list[index]).Type = type;
            }
        }