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

CreateChart() private method

create the chart
private CreateChart ( XmlNode node ) : IContent
node System.Xml.XmlNode
return IContent
		private IContent CreateChart(XmlNode node)
		{
			try
			{
				this.Chart .Node             = node;
				ContentCollection iColl     = new ContentCollection ();
				ChartStyleProcessor csp      = new ChartStyleProcessor (this.Chart );
				XmlNode nodeStyle            = csp.ReadStyleNode(this.Chart .StyleName);
				IStyle style                 = csp.ReadStyle (nodeStyle,"chart");

				if ( style!=null )
				{
					this.Chart .ChartStyle   = (ChartStyle)style;
					this.Chart .Styles .Add (style);

				}
				
				foreach(XmlNode nodeChild in this.Chart .Node .ChildNodes )
				{
					IContent icontent       = CreateContent(nodeChild);
					if (icontent!=null)

						AddToCollection(icontent,iColl );
				}

				this.Chart.Node .InnerXml ="";
				foreach(IContent icontent in iColl)
				{
					AddToCollection(icontent,this.Chart .Content );
				}

				return this.Chart ;
			}

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


		}