//internal ExcelBarChart(ExcelDrawings drawings, XmlNode node) : // base(drawings, node/*, 1*/) //{ // SetChartNodeText(""); //} //internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, eChartType type) : // base(drawings, node, type) //{ // SetChartNodeText(""); // SetTypeProperties(drawings, type); //} internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { SetChartNodeText(""); SetTypeProperties(drawings, type); }
internal ExcelPicture(ExcelDrawings drawings, XmlNode node) : base(drawings, node, "xdr:pic/xdr:nvPicPr/xdr:cNvPr/@name") { XmlNode picNode = node.SelectSingleNode("xdr:pic/xdr:blipFill/a:blip", drawings.NameSpaceManager); if (picNode != null) { RelPic = drawings.Part.GetRelationship(picNode.Attributes["r:embed"].Value); UriPic = PackUriHelper.ResolvePartUri(drawings.UriDrawing, RelPic.TargetUri); Part = drawings.Part.Package.GetPart(UriPic); FileInfo f = new FileInfo(UriPic.OriginalString); ContentType = GetContentType(f.Extension); _image = Image.FromStream(Part.GetStream()); ImageConverter ic=new ImageConverter(); var iby=(byte[])ic.ConvertTo(_image, typeof(byte[])); var ii = _drawings._package.LoadImage(iby, UriPic, Part); ImageHash = ii.Hash; string relID = GetXmlNodeString("xdr:pic/xdr:nvPicPr/xdr:cNvPr/a:hlinkClick/@r:id"); if (!string.IsNullOrEmpty(relID)) { HypRel = drawings.Part.GetRelationship(relID); if (HypRel.TargetUri.IsAbsoluteUri) { _hyperlink = new ExcelHyperLink(HypRel.TargetUri.AbsoluteUri); } else { _hyperlink = new ExcelHyperLink(HypRel.TargetUri.OriginalString, UriKind.Relative); } ((ExcelHyperLink)_hyperlink).ToolTip = GetXmlNodeString("xdr:pic/xdr:nvPicPr/xdr:cNvPr/a:hlinkClick/@tooltip"); } } }
internal ExcelBubbleChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { ShowNegativeBubbles = false; BubbleScale = 100; _chartSeries = new ExcelBubbleChartSeries(this, drawings.NameSpaceManager, _chartNode, PivotTableSource!=null); //SetTypeProperties(); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType?type, ExcelChart topChart, ExcelPivotTable PivotTableSource, XmlDocument chartXml, ExcelGroupShape parent = null) : base(drawings, node, type, topChart, PivotTableSource, chartXml, parent) { }
internal static ExcelChart GetChart(ExcelDrawings drawings, XmlNode node/*, XmlNode chartTypeNode*/) { XmlNode chartNode = node.SelectSingleNode("xdr:graphicFrame/a:graphic/a:graphicData/c:chart", drawings.NameSpaceManager); if (chartNode != null) { var drawingRelation = drawings.Part.GetRelationship(chartNode.Attributes["r:id"].Value); var uriChart = UriHelper.ResolvePartUri(drawings.UriDrawing, drawingRelation.TargetUri); var part = drawings.Part.Package.GetPart(uriChart); var chartXml = new XmlDocument(); LoadXmlSafe(chartXml, part.GetStream()); ExcelChart topChart = null; foreach (XmlElement n in chartXml.SelectSingleNode(rootPath, drawings.NameSpaceManager).ChildNodes) { if (topChart == null) { topChart = GetChart(n, drawings, node, uriChart, part, chartXml, null); if(topChart!=null) { topChart.PlotArea.ChartTypes.Add(topChart); } } else { var subChart = GetChart(n, null, null, null, null, null, topChart); if (subChart != null) { topChart.PlotArea.ChartTypes.Add(subChart); } } } return topChart; } else { return null; } }
internal ExcelBarChart(ExcelDrawings drawings, XmlNode node) : base(drawings, node) { SetChartNodeText(); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart) : base(drawings, node, type, topChart) { //SetPaths(); }
private void InitChartLoad(ExcelDrawings drawings, XmlNode chartNode) { //SetChartType(); bool isPivot = false; Init(drawings, chartNode); _chartSeries = new ExcelChartSeries(this, drawings.NameSpaceManager, _chartNode, isPivot /*ChartXml.SelectSingleNode(_chartPath, drawings.NameSpaceManager)*/); LoadAxis(); }
//internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node) : // base(drawings, node) //{ // SetPaths(); //} internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) : base(drawings, node, type, isPivot) { //SetPaths(); }
internal ExcelShape(ExcelDrawings drawings, XmlNode node, eShapeStyle style) : base(drawings, node, "xdr:sp/xdr:nvSpPr/xdr:cNvPr/@name") { init(); XmlElement shapeNode = node.OwnerDocument.CreateElement("xdr", "sp", ExcelPackage.schemaSheetDrawings); shapeNode.SetAttribute("macro", ""); shapeNode.SetAttribute("textlink", ""); node.AppendChild(shapeNode); shapeNode.InnerXml = ShapeStartXml(); node.AppendChild(shapeNode.OwnerDocument.CreateElement("xdr", "clientData", ExcelPackage.schemaSheetDrawings)); }
internal ExcelSurfaceChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { Init(); }
internal ExcelSurfaceChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { Init(); }
internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot, ExcelGroupShape parent = null) : base(drawings, node, type, isPivot, parent) { SetTypeProperties(); }
internal ExcelFunnelChart(ExcelDrawings drawings, XmlNode drawingsNode, eChartType?type, XmlDocument chartXml = null, ExcelGroupShape parent = null) : base(drawings, drawingsNode, type, chartXml, parent) { StyleManager.SetChartStyle(Chart.Style.ePresetChartStyle.FunnelChartStyle1); }
internal ExcelControlListBox(ExcelDrawings drawings, XmlElement drawNode, string name, ExcelGroupShape parent = null) : base(drawings, drawNode, name, parent) { SetSize(150, 100); //Default size }
internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { SetChartNodeText(string.Empty); SetTypeProperties(drawings, type); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { //SetPaths(); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { //SetPaths(); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, System.IO.Packaging.PackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { //SetPaths(); }
public Drawings(ExcelDrawings drawings) { _drawings = drawings; }
private void CreateNewChart(ExcelDrawings drawings, eChartType type, ExcelChart topChart) { if (topChart == null) { XmlElement graphFrame = TopNode.OwnerDocument.CreateElement("graphicFrame", ExcelPackage.schemaSheetDrawings); graphFrame.SetAttribute("macro", ""); TopNode.AppendChild(graphFrame); graphFrame.InnerXml = string.Format("<xdr:nvGraphicFramePr><xdr:cNvPr id=\"{0}\" name=\"Chart 1\" /><xdr:cNvGraphicFramePr /></xdr:nvGraphicFramePr><xdr:xfrm><a:off x=\"0\" y=\"0\" /> <a:ext cx=\"0\" cy=\"0\" /></xdr:xfrm><a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"rId1\" /> </a:graphicData> </a:graphic>",_id); TopNode.AppendChild(TopNode.OwnerDocument.CreateElement("clientData", ExcelPackage.schemaSheetDrawings)); var package = drawings.Worksheet._package.Package; UriChart = GetNewUri(package, "/xl/charts/chart{0}.xml"); ChartXml = new XmlDocument(); ChartXml.PreserveWhitespace = ExcelPackage.preserveWhitespace; LoadXmlSafe(ChartXml, ChartStartXml(type), Encoding.UTF8); // save it to the package Part = package.CreatePart(UriChart, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", _drawings._package.Compression); StreamWriter streamChart = new StreamWriter(Part.GetStream(FileMode.Create, FileAccess.Write)); ChartXml.Save(streamChart); streamChart.Close(); package.Flush(); var chartRelation = drawings.Part.CreateRelationship(UriHelper.GetRelativeUri(drawings.UriDrawing, UriChart), Packaging.TargetMode.Internal, ExcelPackage.schemaRelationships + "/chart"); graphFrame.SelectSingleNode("a:graphic/a:graphicData/c:chart", NameSpaceManager).Attributes["r:id"].Value = chartRelation.Id; package.Flush(); _chartNode = ChartXml.SelectSingleNode(string.Format("c:chartSpace/c:chart/c:plotArea/{0}", GetChartNodeText()), NameSpaceManager); } else { ChartXml = topChart.ChartXml; Part = topChart.Part; _plotArea = topChart.PlotArea; UriChart = topChart.UriChart; _axis = topChart._axis; XmlNode preNode = _plotArea.ChartTypes[_plotArea.ChartTypes.Count - 1].ChartNode; _chartNode = ((XmlDocument)ChartXml).CreateElement(GetChartNodeText(), ExcelPackage.schemaChart); preNode.ParentNode.InsertAfter(_chartNode, preNode); if (topChart.Axis.Length == 0) { AddAxis(); } string serieXML = GetChartSerieStartXml(type, int.Parse(topChart.Axis[0].Id), int.Parse(topChart.Axis[1].Id), topChart.Axis.Length>2?int.Parse(topChart.Axis[2].Id) : -1); _chartNode.InnerXml = serieXML; } }
private void CreateNewChart(ExcelDrawings drawings, ExcelChart topChart, XmlDocument chartXml = null, eChartType?type = null) { if (topChart == null) { XmlElement graphFrame = TopNode.OwnerDocument.CreateElement("graphicFrame", ExcelPackage.schemaSheetDrawings); graphFrame.SetAttribute("macro", ""); TopNode.AppendChild(graphFrame); graphFrame.InnerXml = string.Format("<xdr:nvGraphicFramePr><xdr:cNvPr id=\"{0}\" name=\"Chart 1\" /><xdr:cNvGraphicFramePr /></xdr:nvGraphicFramePr><xdr:xfrm><a:off x=\"0\" y=\"0\" /> <a:ext cx=\"0\" cy=\"0\" /></xdr:xfrm><a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"rId1\" /> </a:graphicData> </a:graphic>", _id); TopNode.AppendChild(TopNode.OwnerDocument.CreateElement("clientData", ExcelPackage.schemaSheetDrawings)); var package = drawings.Worksheet._package.Package; UriChart = GetNewUri(package, "/xl/charts/chart{0}.xml"); if (chartXml == null) { ChartXml = new XmlDocument { PreserveWhitespace = ExcelPackage.preserveWhitespace }; LoadXmlSafe(ChartXml, ChartStartXml(type.Value), Encoding.UTF8); } else { ChartXml = chartXml; } // save it to the package Part = package.CreatePart(UriChart, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", _drawings._package.Compression); StreamWriter streamChart = new StreamWriter(Part.GetStream(FileMode.Create, FileAccess.Write)); ChartXml.Save(streamChart); streamChart.Close(); package.Flush(); var chartRelation = drawings.Part.CreateRelationship(UriHelper.GetRelativeUri(drawings.UriDrawing, UriChart), Packaging.TargetMode.Internal, ExcelPackage.schemaRelationships + "/chart"); graphFrame.SelectSingleNode("a:graphic/a:graphicData/c:chart", NameSpaceManager).Attributes["r:id"].Value = chartRelation.Id; package.Flush(); _chartNode = ChartXml.SelectSingleNode(string.Format("c:chartSpace/c:chart/c:plotArea/{0}", GetChartNodeText()), NameSpaceManager); } else { ChartXml = topChart.ChartXml; Part = topChart.Part; _plotArea = topChart.PlotArea; UriChart = topChart.UriChart; _axis = topChart._axis; XmlNode preNode = _plotArea.ChartTypes[_plotArea.ChartTypes.Count - 1].ChartNode; _chartNode = ((XmlDocument)ChartXml).CreateElement(GetChartNodeText(), ExcelPackage.schemaChart); preNode.ParentNode.InsertAfter(_chartNode, preNode); if (topChart.Axis.Length == 0) { AddAxis(); } string serieXML = GetChartSerieStartXml(type.Value, int.Parse(topChart.Axis[0].Id), int.Parse(topChart.Axis[1].Id), topChart.Axis.Length > 2 ? int.Parse(topChart.Axis[2].Id) : -1); _chartNode.InnerXml = serieXML; } GetPositionSize(); if (IsType3D()) { Init3DProperties(); } }
internal ExcelChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name") { ChartType = type; CreateNewChart(drawings, type, topChart); Init(drawings, _chartNode); _chartSeries = new ExcelChartSeries(this, drawings.NameSpaceManager, _chartNode, PivotTableSource!=null); if (PivotTableSource != null) SetPivotSource(PivotTableSource); SetTypeProperties(); if (topChart == null) LoadAxis(); else { _axis = topChart.Axis; if (_axis.Length > 0) { XAxis = _axis[0]; YAxis = _axis[1]; } } }
internal static ExcelDrawing GetControl(ExcelDrawings drawings, XmlElement drawNode, ControlInternal control, ExcelGroupShape parent) { var rel = drawings.Worksheet.Part.GetRelationship(control.RelationshipId); var controlUri = UriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri); var part = drawings.Worksheet._package.ZipPackage.GetPart(controlUri); var controlPropertiesXml = new XmlDocument(); XmlHelper.LoadXmlSafe(controlPropertiesXml, part.GetStream()); var objectType = controlPropertiesXml.DocumentElement.Attributes["objectType"]?.Value; var controlType = GetControlType(objectType); XmlNode node; if (parent == null) { node = drawNode.ParentNode; } else { node = drawNode; } switch (controlType) { case eControlType.Button: return(new ExcelControlButton(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.DropDown: return(new ExcelControlDropDown(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.GroupBox: return(new ExcelControlGroupBox(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.Label: return(new ExcelControlLabel(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.ListBox: return(new ExcelControlListBox(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.CheckBox: return(new ExcelControlCheckBox(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.RadioButton: return(new ExcelControlRadioButton(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.ScrollBar: return(new ExcelControlScrollBar(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.SpinButton: return(new ExcelControlSpinButton(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.EditBox: return(new ExcelControlEditBox(drawings, node, control, part, controlPropertiesXml, parent)); case eControlType.Dialog: return(new ExcelControlDialog(drawings, node, control, part, controlPropertiesXml, parent)); default: throw new NotSupportedException(); } throw new NotImplementedException(); }
internal static ExcelChart GetNewChart(ExcelDrawings drawings, XmlNode drawNode, eChartType chartType, ExcelChart topChart, ExcelPivotTable PivotTableSource) { switch(chartType) { case eChartType.Pie: case eChartType.PieExploded: case eChartType.Pie3D: case eChartType.PieExploded3D: return new ExcelPieChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.BarOfPie: case eChartType.PieOfPie: return new ExcelOfPieChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.Doughnut: case eChartType.DoughnutExploded: return new ExcelDoughnutChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.BarClustered: case eChartType.BarStacked: case eChartType.BarStacked100: case eChartType.BarClustered3D: case eChartType.BarStacked3D: case eChartType.BarStacked1003D: case eChartType.ConeBarClustered: case eChartType.ConeBarStacked: case eChartType.ConeBarStacked100: case eChartType.CylinderBarClustered: case eChartType.CylinderBarStacked: case eChartType.CylinderBarStacked100: case eChartType.PyramidBarClustered: case eChartType.PyramidBarStacked: case eChartType.PyramidBarStacked100: case eChartType.ColumnClustered: case eChartType.ColumnStacked: case eChartType.ColumnStacked100: case eChartType.Column3D: case eChartType.ColumnClustered3D: case eChartType.ColumnStacked3D: case eChartType.ColumnStacked1003D: case eChartType.ConeCol: case eChartType.ConeColClustered: case eChartType.ConeColStacked: case eChartType.ConeColStacked100: case eChartType.CylinderCol: case eChartType.CylinderColClustered: case eChartType.CylinderColStacked: case eChartType.CylinderColStacked100: case eChartType.PyramidCol: case eChartType.PyramidColClustered: case eChartType.PyramidColStacked: case eChartType.PyramidColStacked100: return new ExcelBarChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.XYScatter: case eChartType.XYScatterLines: case eChartType.XYScatterLinesNoMarkers: case eChartType.XYScatterSmooth: case eChartType.XYScatterSmoothNoMarkers: return new ExcelScatterChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.Line: case eChartType.Line3D: case eChartType.LineMarkers: case eChartType.LineMarkersStacked: case eChartType.LineMarkersStacked100: case eChartType.LineStacked: case eChartType.LineStacked100: return new ExcelLineChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.Bubble: case eChartType.Bubble3DEffect: return new ExcelBubbleChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.Radar: case eChartType.RadarFilled: case eChartType.RadarMarkers: return new ExcelRadarChart(drawings, drawNode, chartType, topChart, PivotTableSource); case eChartType.Surface: case eChartType.SurfaceTopView: case eChartType.SurfaceTopViewWireframe: case eChartType.SurfaceWireframe: return new ExcelSurfaceChart(drawings, drawNode, chartType, topChart, PivotTableSource); default: return new ExcelChart(drawings, drawNode, chartType, topChart, PivotTableSource); } }
internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { SetChartNodeText(chartNode.Name); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot, ExcelGroupShape parent = null) : base(drawings, node, type, isPivot, parent) { }
internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { }
internal ExcelTreemapChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode, ExcelGroupShape parent = null) : base(drawings, node, uriChart, part, chartXml, chartNode, parent) { Series.Init(this, NameSpaceManager, TopNode, false, base.Series._list); }
internal ExcelScatterChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { SetTypeProperties(); }
private void SetTypeProperties(ExcelDrawings drawings, eChartType type) { /******* Bar direction *******/ if (type == eChartType.BarClustered || type == eChartType.BarStacked || type == eChartType.BarStacked100 || type == eChartType.BarClustered3D || type == eChartType.BarStacked3D || type == eChartType.BarStacked1003D || type == eChartType.ConeBarClustered || type == eChartType.ConeBarStacked || type == eChartType.ConeBarStacked100 || type == eChartType.CylinderBarClustered || type == eChartType.CylinderBarStacked || type == eChartType.CylinderBarStacked100 || type == eChartType.PyramidBarClustered || type == eChartType.PyramidBarStacked || type == eChartType.PyramidBarStacked100) { Direction = eDirection.Bar; } else if ( type == eChartType.ColumnClustered || type == eChartType.ColumnStacked || type == eChartType.ColumnStacked100 || type == eChartType.Column3D || type == eChartType.ColumnClustered3D || type == eChartType.ColumnStacked3D || type == eChartType.ColumnStacked1003D || type == eChartType.ConeCol || type == eChartType.ConeColClustered || type == eChartType.ConeColStacked || type == eChartType.ConeColStacked100 || type == eChartType.CylinderCol || type == eChartType.CylinderColClustered || type == eChartType.CylinderColStacked || type == eChartType.CylinderColStacked100 || type == eChartType.PyramidCol || type == eChartType.PyramidColClustered || type == eChartType.PyramidColStacked || type == eChartType.PyramidColStacked100) { Direction = eDirection.Column; } /****** Shape ******/ if (/*type == eChartType.ColumnClustered || * type == eChartType.ColumnStacked || * type == eChartType.ColumnStacked100 ||*/ type == eChartType.Column3D || type == eChartType.ColumnClustered3D || type == eChartType.ColumnStacked3D || type == eChartType.ColumnStacked1003D || /*type == eChartType.BarClustered || * type == eChartType.BarStacked || * type == eChartType.BarStacked100 ||*/ type == eChartType.BarClustered3D || type == eChartType.BarStacked3D || type == eChartType.BarStacked1003D) { Shape = eShape.Box; } else if ( type == eChartType.CylinderBarClustered || type == eChartType.CylinderBarStacked || type == eChartType.CylinderBarStacked100 || type == eChartType.CylinderCol || type == eChartType.CylinderColClustered || type == eChartType.CylinderColStacked || type == eChartType.CylinderColStacked100) { Shape = eShape.Cylinder; } else if ( type == eChartType.ConeBarClustered || type == eChartType.ConeBarStacked || type == eChartType.ConeBarStacked100 || type == eChartType.ConeCol || type == eChartType.ConeColClustered || type == eChartType.ConeColStacked || type == eChartType.ConeColStacked100) { Shape = eShape.Cone; } else if ( type == eChartType.PyramidBarClustered || type == eChartType.PyramidBarStacked || type == eChartType.PyramidBarStacked100 || type == eChartType.PyramidCol || type == eChartType.PyramidColClustered || type == eChartType.PyramidColStacked || type == eChartType.PyramidColStacked100) { Shape = eShape.Pyramid; } }
internal ExcelScatterChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode, ExcelGroupShape parent) : base(drawings, node, uriChart, part, chartXml, chartNode, parent) { SetTypeProperties(); }
internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { Smooth = false; }
internal ExcelPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) : base(drawings, node, type, isPivot) { }
internal ExcelScatterChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { SetTypeProperties(); }
internal ExcelBubbleChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) : base(drawings, node, type, isPivot) { _chartSeries = new ExcelBubbleChartSeries(this, drawings.NameSpaceManager, _chartNode, isPivot); //SetTypeProperties(); }
internal ExcelShape(ExcelDrawings drawings, XmlNode node) : base(drawings, node, "xdr:sp/xdr:nvSpPr/xdr:cNvPr/@name") { init(); }
internal ExcelBubbleChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { _chartSeries = new ExcelBubbleChartSeries(this, _drawings.NameSpaceManager, _chartNode, false); //SetTypeProperties(); }
public ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, System.IO.Packaging.PackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { //SetPaths(); }
internal ExcelPieChart(ExcelDrawings drawings, XmlNode node, eChartType type) : base(drawings, node, type) { //_varyColorsPath = string.Format(_varyColorsPath, GetChartNodeText()); }
//internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node) : // base(drawings, node) //{ //} internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) : base(drawings, node, type, isPivot) { SetTypeProperties(); }
private void Init(ExcelDrawings drawings, XmlNode chartNode) { //_chartXmlHelper = new XmlHelper(drawings.NameSpaceManager, chartNode); _chartXmlHelper = XmlHelperFactory.Create(drawings.NameSpaceManager, chartNode); _chartXmlHelper.SchemaNodeOrder = new string[] { "title", "pivotFmt", "autoTitleDeleted", "view3D", "floor", "sideWall", "backWall", "plotArea", "wireframe", "barDir", "grouping", "scatterStyle", "radarStyle", "varyColors", "ser", "dLbls", "bubbleScale", "showNegBubbles", "dropLines", "upDownBars", "marker", "smooth", "shape", "legend", "plotVisOnly", "dispBlanksAs", "showDLblsOverMax", "overlap", "bandFmts", "axId", "spPr", "printSettings" }; WorkSheet = drawings.Worksheet; }
internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { SetTypeProperties(); }
internal ExcelChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) : base(drawings, node, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name") { ChartType = type; CreateNewChart(drawings, type, null); Init(drawings, _chartNode); _chartSeries = new ExcelChartSeries(this, drawings.NameSpaceManager, _chartNode, isPivot); SetTypeProperties(); LoadAxis(); }
internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { SetTypeProperties(); }
internal ExcelChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name") { UriChart = uriChart; Part = part; ChartXml = chartXml; _chartNode = chartNode; InitChartLoad(drawings, chartNode); ChartType = GetChartType(chartNode.LocalName); }
internal ExcelControlButton(ExcelDrawings drawings, XmlElement drawNode, string name, ExcelGroupShape parent = null) : base(drawings, drawNode, name, parent) { SetSize(90, 30); //Default size }
internal static ExcelChart GetChart(XmlElement chartNode, ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, ExcelChart topChart) { switch (chartNode.LocalName) { case "area3DChart": case "areaChart": case "stockChart": if (topChart == null) { return new ExcelChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelChart(topChart, chartNode); } case "surface3DChart": case "surfaceChart": if (topChart == null) { return new ExcelSurfaceChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelSurfaceChart(topChart, chartNode); } case "radarChart": if (topChart == null) { return new ExcelRadarChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelRadarChart(topChart, chartNode); } case "bubbleChart": if (topChart == null) { return new ExcelBubbleChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelBubbleChart(topChart, chartNode); } case "barChart": case "bar3DChart": if (topChart == null) { return new ExcelBarChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelBarChart(topChart, chartNode); } case "doughnutChart": if (topChart == null) { return new ExcelDoughnutChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelDoughnutChart(topChart, chartNode); } case "pie3DChart": case "pieChart": if (topChart == null) { return new ExcelPieChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelPieChart(topChart, chartNode); } case "ofPieChart": if (topChart == null) { return new ExcelOfPieChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelBarChart(topChart, chartNode); } case "lineChart": case "line3DChart": if (topChart == null) { return new ExcelLineChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelLineChart(topChart, chartNode); } case "scatterChart": if (topChart == null) { return new ExcelScatterChart(drawings, node, uriChart, part, chartXml, chartNode); } else { return new ExcelScatterChart(topChart, chartNode); } default: return null; } }
internal ExcelControlButton(ExcelDrawings drawings, XmlNode drawNode, ControlInternal control, ZipPackagePart part, XmlDocument controlPropertiesXml, ExcelGroupShape parent = null) : base(drawings, drawNode, control, part, controlPropertiesXml, parent) { }
private void SetTypeProperties(ExcelDrawings drawings, eChartType type) { /******* Bar direction *******/ if (type == eChartType.BarClustered || type == eChartType.BarStacked || type == eChartType.BarStacked100 || type == eChartType.BarClustered3D || type == eChartType.BarStacked3D || type == eChartType.BarStacked1003D || type == eChartType.ConeBarClustered || type == eChartType.ConeBarStacked || type == eChartType.ConeBarStacked100 || type == eChartType.CylinderBarClustered || type == eChartType.CylinderBarStacked || type == eChartType.CylinderBarStacked100 || type == eChartType.PyramidBarClustered || type == eChartType.PyramidBarStacked || type == eChartType.PyramidBarStacked100) { Direction = eDirection.Bar; } else if ( type == eChartType.ColumnClustered || type == eChartType.ColumnStacked || type == eChartType.ColumnStacked100 || type == eChartType.Column3D || type == eChartType.ColumnClustered3D || type == eChartType.ColumnStacked3D || type == eChartType.ColumnStacked1003D || type == eChartType.ConeCol || type == eChartType.ConeColClustered || type == eChartType.ConeColStacked || type == eChartType.ConeColStacked100 || type == eChartType.CylinderCol || type == eChartType.CylinderColClustered || type == eChartType.CylinderColStacked || type == eChartType.CylinderColStacked100 || type == eChartType.PyramidCol || type == eChartType.PyramidColClustered || type == eChartType.PyramidColStacked || type == eChartType.PyramidColStacked100) { Direction = eDirection.Column; } /****** Shape ******/ if (type == eChartType.ColumnClustered || type == eChartType.ColumnStacked || type == eChartType.ColumnStacked100 || type == eChartType.Column3D || type == eChartType.ColumnClustered3D || type == eChartType.ColumnStacked3D || type == eChartType.ColumnStacked1003D || type == eChartType.BarClustered || type == eChartType.BarStacked || type == eChartType.BarStacked100 || type == eChartType.BarClustered3D || type == eChartType.BarStacked3D || type == eChartType.BarStacked1003D) { Shape = eShape.Box; } else if ( type == eChartType.CylinderBarClustered || type == eChartType.CylinderBarStacked || type == eChartType.CylinderBarStacked100 || type == eChartType.CylinderCol || type == eChartType.CylinderColClustered || type == eChartType.CylinderColStacked || type == eChartType.CylinderColStacked100) { Shape = eShape.Cylinder; } else if ( type == eChartType.ConeBarClustered || type == eChartType.ConeBarStacked || type == eChartType.ConeBarStacked100 || type == eChartType.ConeCol || type == eChartType.ConeColClustered || type == eChartType.ConeColStacked || type == eChartType.ConeColStacked100) { Shape = eShape.Cone; } else if ( type == eChartType.PyramidBarClustered || type == eChartType.PyramidBarStacked || type == eChartType.PyramidBarStacked100 || type == eChartType.PyramidCol || type == eChartType.PyramidColClustered || type == eChartType.PyramidColStacked || type == eChartType.PyramidColStacked100) { Shape = eShape.Pyramid; } }
internal ExcelBubbleChart(ExcelDrawings drawings, XmlNode node, eChartType?type, ExcelChart topChart, ExcelPivotTable PivotTableSource, XmlDocument chartXml, ExcelGroupShape parent = null) : base(drawings, node, type, topChart, PivotTableSource, chartXml, parent) { ShowNegativeBubbles = false; BubbleScale = 100; }
internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) : base(drawings, node, type, topChart, PivotTableSource) { //_chartTopPath = string.Format(_chartTopPath, GetChartNodeText()); }
internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, Packaging.ZipPackagePart part, XmlDocument chartXml, XmlNode chartNode, ExcelGroupShape parent = null) : base(drawings, node, uriChart, part, chartXml, chartNode, parent) { }
internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) : base(drawings, node, type, isPivot) { //_chartTopPath = string.Format(_chartTopPath, GetChartNodeText()); }
internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) : base(drawings, node, uriChart, part, chartXml, chartNode) { //_chartTopPath = string.Format(_chartTopPath, chartNode.Name); }
internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, eChartType type) : base(drawings, node, type) { SetChartNodeText(); SetTypeProperties(drawings, type); }