AODL.Document.Content.Charts.ChartImporter.CreateChartSeries C# (CSharp) Method

CreateChartSeries() private method

create the chart series
private CreateChartSeries ( XmlNode node ) : IContent
node System.Xml.XmlNode
return IContent
		private IContent CreateChartSeries(XmlNode node)
		{
			try
			{
				ChartSeries series          = new ChartSeries(this.Chart .Document ,node);
				series.Chart                = this.Chart ;

				ChartStyleProcessor csp     = new ChartStyleProcessor (this.Chart );
				XmlNode nodeStyle           = csp.ReadStyleNode(series.StyleName);
				IStyle style                = csp.ReadStyle (nodeStyle,"series");
				ContentCollection iColl    = new ContentCollection ();

				if (style != null)
				{
					series.Style            =style;
					this.Chart .Styles .Add (style);
				}

				foreach(XmlNode nodeChild in series.Node .ChildNodes )
				{
					IContent icontent       = CreateContent(nodeChild);

					if (icontent!= null)
						AddToCollection(icontent,iColl);
				}

				series.Node.InnerXml  ="";

				foreach(IContent iContent in iColl)
				{
					if (iContent is ChartDataPoint )
						series.DataPointCollection .Add (iContent as ChartDataPoint);
					
				}
				
				return series;
			}

			catch(Exception ex)
			{
				throw new AODLException("Exception while creating the chart series!", ex);
			}
		}