Exemplo n.º 1
0
        /// <summary>
        /// create chart plotarea style
        /// </summary>
        /// <param name="nodeStyle"></param>
        /// <returns></returns>

        public PlotAreaStyle   CreateChartPlotAreaStyle(XmlNode nodeStyle)
        {
            PlotAreaStyle plotareaStyle = new PlotAreaStyle(this.Chart.Document);

            plotareaStyle.Node = nodeStyle;

            IPropertyCollection pCollection = new IPropertyCollection();

            if (nodeStyle.HasChildNodes)
            {
                foreach (XmlNode nodeChild in nodeStyle.ChildNodes)
                {
                    IProperty property = this.GetProperty(plotareaStyle, nodeChild);
                    if (property != null)
                    {
                        pCollection.Add(property);
                    }
                }
            }

            plotareaStyle.Node.InnerXml = "";

            foreach (IProperty property in pCollection)
            {
                plotareaStyle.PropertyCollection.Add(property);
            }

            //this.Chart .Styles .Add (plotareaStyle);

            return(plotareaStyle);
        }
Exemplo n.º 2
0
        /// <summary>
        /// create chart plotarea style
        /// </summary>
        /// <param name="nodeStyle"></param>
        /// <returns></returns>
        public PlotAreaStyle CreateChartPlotAreaStyle(XElement nodeStyle)
        {
            PlotAreaStyle plotareaStyle = new PlotAreaStyle(Chart.Document)
            {
                Node = nodeStyle
            };

            IPropertyCollection pCollection = new IPropertyCollection();

            if (nodeStyle.HasElements)
            {
                foreach (XElement nodeChild in nodeStyle.Elements())
                {
                    IProperty property = GetProperty(plotareaStyle, nodeChild);
                    if (property != null)
                    {
                        pCollection.Add(property);
                    }
                }
            }

            plotareaStyle.Node.Value = "";

            foreach (IProperty property in pCollection)
            {
                plotareaStyle.PropertyCollection.Add(property);
            }

            //this.Chart .Styles .Add (plotareaStyle);

            return(plotareaStyle);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the ChartPlotArea class.
        /// </summary>
        /// <param name="chart">The chart.</param>
        /// <param name="styleName">The style name.</param>
        public ChartPlotArea(Chart chart, string styleName)
        {
            Chart    = chart;
            Document = chart.Document;
            Node     = new XElement(Ns.Chart + "plot-area");

            InitStandards();

            StyleName     = styleName;
            PlotAreaStyle = new PlotAreaStyle(chart.Document, styleName);
            chart.Styles.Add(PlotAreaStyle);
            InitPlotArea();

            chart.Content.Add(this);
        }