Example #1
0
        public static C::ChartSpace GenerateChartSpaceWithData(C::Chart chart, string externalDataId)
        {
            // c:chartSpace (ChartSpace)
            C::ChartSpace chartSpace1 = new C::ChartSpace();
            chartSpace1.AddNamespaceDeclaration("c", "http://schemas.openxmlformats.org/drawingml/2006/chart");
            chartSpace1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            chartSpace1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");

            // c:lang (EditingLanguage)
            C::EditingLanguage editingLanguage1 = new C::EditingLanguage() { Val = Graph.DEFAULT_LANG };

            C::ExternalData externalData1 = new C::ExternalData() { Id = externalDataId };

            chartSpace1.Append(editingLanguage1);
            chartSpace1.Append(chart);
            chartSpace1.Append(externalData1);

            return chartSpace1;
        }
        internal static C.AxisPositionValues GetOppositePosition(C.AxisPositionValues Position)
        {
            C.AxisPositionValues result = Position;
            switch (Position)
            {
                case C.AxisPositionValues.Bottom:
                    result = C.AxisPositionValues.Top;
                    break;
                case C.AxisPositionValues.Left:
                    result = C.AxisPositionValues.Right;
                    break;
                case C.AxisPositionValues.Right:
                    result = C.AxisPositionValues.Left;
                    break;
                case C.AxisPositionValues.Top:
                    result = C.AxisPositionValues.Bottom;
                    break;
            }

            return result;
        }
Example #3
0
        public static C::ChartSpace GenerateChartSpace(C::Chart chart, bool withDate1904)
        {
            // c:chartSpace (ChartSpace)
            C::ChartSpace chartSpace1 = new C::ChartSpace();
            chartSpace1.AddNamespaceDeclaration("c", "http://schemas.openxmlformats.org/drawingml/2006/chart");
            chartSpace1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            chartSpace1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");

            C::Date1904 date1904 = null;
            if (withDate1904) {
                date1904 = generateDate1904();
            }

            // c:lang (EditingLanguage)
            C::EditingLanguage editingLanguage1 = new C::EditingLanguage() { Val = Graph.DEFAULT_LANG };

            if (date1904 != null) {
                chartSpace1.Append(date1904);
            }
            chartSpace1.Append(editingLanguage1);
            chartSpace1.Append(chart);

            return chartSpace1;
        }
 /// <summary>
 /// Set the position of the data label.
 /// </summary>
 /// <param name="Position">The data label position.</param>
 public void SetLabelPosition(C.DataLabelPositionValues Position)
 {
     this.vLabelPosition = Position;
 }
Example #5
0
 public static C::ChartSpace GenerateChartSpace(C::Chart chart)
 {
     return GenerateChartSpace(chart, false);
 }
Example #6
0
 /// <summary>
 /// Show the chart legend.
 /// </summary>
 /// <param name="Position">Position of the legend. Default is Right.</param>
 /// <param name="Overlay">True if the legend overlaps the plot area. False otherwise.</param>
 public void ShowChartLegend(C.LegendPositionValues Position, bool Overlay)
 {
     this.ShowLegend = true;
     this.Legend.LegendPosition = Position;
     this.Legend.Overlay = Overlay;
 }