public ChartBuilderHelper(IDocument document, ChartPlotArea chartPlotArea, CellRanges tableData) { this.m_document = document; this.ChartPlotArea = chartPlotArea; this.m_tableData = tableData; startRowIndex = m_tableData.startcell.rowIndex; endRowIndex = m_tableData.endcell.rowIndex; startColumnIndex = m_tableData.startcell.columnIndex; endColumnIndex = m_tableData.endcell.columnIndex; table = new Table(m_document, "local-table", null); DataTable = m_tableData.table; }
public void New() { IsNewed = true; LoadBlankContent(); LoadBlankStyles(); InitStandards(); ChartLegend = new ChartLegend(this, "ch2"); ChartTitle = new ChartTitle(this, "ch3"); ChartTitle.InitTitle(); Content.Add(ChartTitle); ChartPlotArea = new ChartPlotArea(this, "ch4"); if (Frame == null) { Frame = new Frame(Document, "gr1"); //this.CreateParentNode (null); Frame.Content.Add(this); } InitChart(); }
public ChartBuilderHelper(IDocument document, ChartPlotArea chartPlotArea, CellRanges tableData) { this.m_document = document; this.ChartPlotArea = chartPlotArea; this.m_tableData = tableData; startRowIndex = m_tableData.startcell.rowIndex ; endRowIndex = m_tableData.endcell .rowIndex ; startColumnIndex = m_tableData.startcell .columnIndex ; endColumnIndex = m_tableData.endcell .columnIndex ; table = new Table (m_document ,"local-table",null); DataTable = m_tableData.table ; }
/// <summary> /// create the chart plotarea /// </summary> /// <param name="node"></param> /// <returns></returns> private IContent CreateChartPlotArea(XmlNode node) { try { ChartPlotArea plotarea = new ChartPlotArea(this.Chart.Document, node); plotarea.Chart = this.Chart; //plotarea.Node = node; this.Chart.ChartPlotArea = plotarea; ChartStyleProcessor csp = new ChartStyleProcessor(this.Chart); XmlNode nodeStyle = csp.ReadStyleNode(plotarea.StyleName); IStyle style = csp.ReadStyle(nodeStyle, "plotarea"); ContentCollection iColl = new ContentCollection(); if (style != null) { plotarea.Style = style; this.Chart.Styles.Add(style); } foreach (XmlNode nodeChild in plotarea.Node.ChildNodes) { IContent icontent = CreateContent(nodeChild); if (icontent != null) { AddToCollection(icontent, iColl); } } plotarea.Node.InnerXml = ""; foreach (IContent icontent in iColl) { if (icontent is Dr3dLight) { ((Dr3dLight)icontent).PlotArea = plotarea; plotarea.Dr3dLightCollection.Add(icontent as Dr3dLight); } else if (icontent is ChartAxis) { ((ChartAxis)icontent).PlotArea = plotarea; plotarea.AxisCollection.Add(icontent as ChartAxis); } else if (icontent is ChartSeries) { ((ChartSeries)icontent).PlotArea = plotarea; plotarea.SeriesCollection.Add(icontent as ChartSeries); } else { AddToCollection(icontent, plotarea.Content); } } return(plotarea); } catch (Exception ex) { throw new AODLException("Exception while creating the chart plotarea!", ex); } }
/// <summary> /// create the chart plotarea /// </summary> /// <param name="node"></param> /// <returns></returns> private IContent CreateChartPlotArea(XmlNode node) { try { ChartPlotArea plotarea = new ChartPlotArea (this.Chart .Document ,node); plotarea.Chart = this.Chart ; //plotarea.Node = node; this.Chart .ChartPlotArea = plotarea; ChartStyleProcessor csp = new ChartStyleProcessor (this.Chart ); XmlNode nodeStyle = csp.ReadStyleNode(plotarea .StyleName); IStyle style = csp.ReadStyle (nodeStyle,"plotarea"); ContentCollection iColl = new ContentCollection (); if (style != null) { plotarea.Style =style; this.Chart .Styles .Add (style); } foreach(XmlNode nodeChild in plotarea.Node .ChildNodes ) { IContent icontent = CreateContent(nodeChild); if (icontent!= null) AddToCollection(icontent,iColl); } plotarea.Node.InnerXml =""; foreach(IContent icontent in iColl) { if (icontent is Dr3dLight) { ((Dr3dLight)icontent).PlotArea =plotarea; plotarea.Dr3dLightCollection .Add (icontent as Dr3dLight ); } else if (icontent is ChartAxis) { ((ChartAxis)icontent).PlotArea=plotarea; plotarea.AxisCollection .Add (icontent as ChartAxis ); } else if (icontent is ChartSeries ) { ((ChartSeries)icontent).PlotArea =plotarea; plotarea.SeriesCollection .Add (icontent as ChartSeries ); } else { AddToCollection(icontent,plotarea.Content ); } } return plotarea; } catch(Exception ex) { throw new AODLException("Exception while creating the chart plotarea!", ex); } }