Exemplo n.º 1
0
        /// <summary>
        /// Creates the content of the local style.
        /// </summary>
        private void CreateLocalStyleContent()
        {
            XElement nodeAutomaticStyles = ChartDoc.Elements(Ns.Office + "document-content")
                                           .Elements(Ns.Office + "automatic-styles").First();

            nodeAutomaticStyles.RemoveAll();
            foreach (IStyle style in Styles.ToValueList())
            {
                nodeAutomaticStyles.Add(new XElement(style.Node));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the content body
        /// </summary>
        private void CreateContentBody()
        {
            XElement nodeRoot = ChartDoc.Elements(Ns.Office + "document-content")
                                .Elements(Ns.Office + "body")
                                .Elements(Ns.Office + "chart").First();


            nodeRoot.RemoveAll();
            XElement nodeChart = new XElement(Node);

            nodeRoot.Add(nodeChart);


            foreach (IContent iContent in Content)
            {
                //if (iContent is Chart)
                //nodeChart.AppendChild(((Chart)iContent).Node );
                if (iContent is ChartLegend)
                {
                    nodeChart.Add(new XElement(((ChartLegend)iContent).Node));
                }

                if (iContent is ChartTitle)
                {
                    nodeChart.Add(new XElement(((ChartTitle)iContent).Node));
                }

                if (iContent is ChartPlotArea)
                {
                    nodeChart.Add(new XElement(((ChartPlotArea)iContent).BuildNode()));
                }

                if (iContent is Table)
                {
                    nodeChart.Add(new XElement(((Table)iContent).BuildNode()));
                }
            }

            CreateLocalStyleContent();
            //this.CreateCommonStyleContent();
        }