/// <summary> /// create a single series /// </summary> /// <param name="rowStartIndex">the start row index</param> /// <param name="rowEndINdex">the end row index</param> /// <param name="colStartIndex">the start col index</param> /// <param name="colEndIndex">the end col index</param> private void CreateSingleSeries(int rowStartIndex,int rowEndINdex,int colStartIndex,int colEndIndex) { for(int i=rowStartIndex; i<= rowEndINdex; i++) { string styleRowname= "ch1"+i.ToString (); ChartSeries series = new ChartSeries (this,styleRowname); if (this.ChartType =="Circle") { for(int j=colStartIndex; j<=colEndIndex; j++) { string styleColname = "ch2"+j.ToString (); ChartDataPoint dataPoint = new ChartDataPoint (this,styleColname); series.DataPointCollection .Add (dataPoint); } } else { string pointStylename = "ch3"+i.ToString (); ChartDataPoint dataPoint= new ChartDataPoint (this,pointStylename); int Repeated = colEndIndex-colStartIndex+1; dataPoint.Repeated =Repeated.ToString (); series.DataPointCollection .Add (dataPoint); } this.ChartPlotArea .SeriesCollection .Add (series); } }
/// <summary> /// create the chart series /// </summary> /// <param name="node"></param> /// <returns></returns> 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); } }