public Chart GenerateChart(string title)
        {
            Chart chart1 = new Chart();
            Title title1 = GenerateTitle(title);
            PlotArea plotArea1 = new PlotArea();

            Layout layout2 = GeneratePlotAreaLayout();

            BarChart barChart1 = new BarChart();
            BarDirection barDirection1 = new BarDirection() { Val = BarDirectionValues.Column };
            BarGrouping barGrouping1 = new BarGrouping() { Val = BarGroupingValues.Clustered };

            AxisId axisId1 = new AxisId() { Val = (UInt32Value)92179456U };
            AxisId axisId2 = new AxisId() { Val = (UInt32Value)92463872U };

            barChart1.Append(barDirection1);
            barChart1.Append(barGrouping1);
            barChart1.Append(axisId1);
            barChart1.Append(axisId2);

            CategoryAxis categoryAxis1 = GenerateCategoryAxis(axisId1, AxisPositionValues.Bottom, categoryAxisFormat, axisId2);
            ValueAxis valueAxis1 = GenerateValueAxis(axisId2, AxisPositionValues.Left, valueAxisFormat, axisId1);

            ShapeProperties shapeProperties1 = new ShapeProperties();
            A::NoFill noFill3 = new A::NoFill();

            A::Outline outline8 = new A::Outline() { Width = 25400 };
            A::NoFill noFill4 = new A::NoFill();

            outline8.Append(noFill4);

            shapeProperties1.Append(noFill3);
            shapeProperties1.Append(outline8);

            plotArea1.Append(layout2);
            plotArea1.Append(barChart1);
            plotArea1.Append(categoryAxis1);
            plotArea1.Append(valueAxis1);
            plotArea1.Append(shapeProperties1);

            Legend legend1 = GenerateLegend(LegendPositionValues.Right);
            PlotVisibleOnly plotVisibleOnly1 = new PlotVisibleOnly() { Val = true };
            DisplayBlanksAs displayBlanksAs1 = new DisplayBlanksAs() { Val = DisplayBlanksAsValues.Gap };

            chart1.Append(title1);
            chart1.Append(plotArea1);
            chart1.Append(legend1);
            chart1.Append(plotVisibleOnly1);
            chart1.Append(displayBlanksAs1);

            return chart1;
        }
Example #2
0
        protected ChartShapeProperties GenerateChartShapeProperties(string colourHex, int width)
        {
            ChartShapeProperties chartShapeProperties2 = new ChartShapeProperties();

            A::SolidFill solidFill1 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex1 = new A::RgbColorModelHex() { Val = colourHex };
            solidFill1.Append(rgbColorModelHex1);

            A::Outline outline2 = new A::Outline() { Width = width };
            A::SolidFill solidFill2 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex2 = new A::RgbColorModelHex() { Val = "000000" };

            solidFill2.Append(rgbColorModelHex2);
            A::PresetDash presetDash1 = new A::PresetDash() { Val = A::PresetLineDashValues.Solid };

            outline2.Append(solidFill2);
            outline2.Append(presetDash1);

            chartShapeProperties2.Append(solidFill1);
            chartShapeProperties2.Append(outline2);

            return chartShapeProperties2;
        }
        protected override Legend GenerateLegend(LegendPositionValues position)
        {
            Legend legend1 = new Legend();
            LegendPosition legendPosition1 = new LegendPosition() { Val = position };

            Layout layout3 = GenerateLegendLayout();

            ChartShapeProperties chartShapeProperties8 = new ChartShapeProperties();

            A::SolidFill solidFill10 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex10 = new A::RgbColorModelHex() { Val = "FFFFFF" };

            solidFill10.Append(rgbColorModelHex10);

            A::Outline outline9 = new A::Outline() { Width = 3175 };

            A::SolidFill solidFill11 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex11 = new A::RgbColorModelHex() { Val = "000000" };

            solidFill11.Append(rgbColorModelHex11);
            A::PresetDash presetDash7 = new A::PresetDash() { Val = A::PresetLineDashValues.Solid };

            outline9.Append(solidFill11);
            outline9.Append(presetDash7);

            chartShapeProperties8.Append(solidFill10);
            chartShapeProperties8.Append(outline9);

            legend1.Append(legendPosition1);
            legend1.Append(layout3);
            legend1.Append(chartShapeProperties8);

            return legend1;
        }
Example #4
0
        protected ChartShapeProperties GenerateChartShapeProperties(string colourHex)
        {
            ChartShapeProperties chartShapeProperties1 = new ChartShapeProperties();

            A::Outline outline1 = new A::Outline();
            A::SolidFill solidFill1 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex1 = new A::RgbColorModelHex() { Val = colourHex };
            solidFill1.Append(rgbColorModelHex1);
            outline1.Append(solidFill1);
            chartShapeProperties1.Append(outline1);

            return chartShapeProperties1;
        }
Example #5
0
        protected ChartShapeProperties GenerateChartShapeProperties(int width)
        {
            ChartShapeProperties chartShapeProperties5 = new ChartShapeProperties();

            A::Outline outline5 = new A::Outline() { Width = width };

            A::SolidFill solidFill7 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex7 = new A::RgbColorModelHex() { Val = "000000" };

            solidFill7.Append(rgbColorModelHex7);
            A::PresetDash presetDash4 = new A::PresetDash() { Val = A::PresetLineDashValues.Solid };

            outline5.Append(solidFill7);
            outline5.Append(presetDash4);

            chartShapeProperties5.Append(outline5);

            return chartShapeProperties5;
        }
        public Chart GenerateChart(string title, List<AssetWeighting> data)
        {
            string[] pointNames = data.Select(p => p.AssetClass).ToArray();
            double[] values = data.Select(v => v.Weighting ?? 0).ToArray();

            Chart chart1 = new Chart();

            Title title1 = GenerateTitle(title, 1200);
            PlotArea plotArea1 = new PlotArea();

            Layout layout2 = GeneratePlotAreaLayout();
            LayoutTarget layoutTarget1 = new LayoutTarget() { Val = LayoutTargetValues.Inner };
            LeftMode leftMode2 = new LeftMode() { Val = LayoutModeValues.Edge };
            TopMode topMode2 = new TopMode() { Val = LayoutModeValues.Edge };
            Left left2 = new Left() { Val = 0.10397108399455671D };
            Top top2 = new Top() { Val = 0.13928263342174291D };
            Width width1 = new Width() { Val = 0.88016518444392156D };
            Height height1 = new Height() { Val = 0.59349350997070749D };

            BarChart barChart1 = new BarChart();
            BarDirection barDirection1 = new BarDirection() { Val = BarDirectionValues.Column };
            BarGrouping barGrouping1 = new BarGrouping() { Val = BarGroupingValues.Clustered };
            BarChartSeries barChartSeries1 = GenerateBarChartSeries(seriesName, pointNames, values, colourHex, valueFormat);

            AxisId axisId1 = new AxisId() { Val = (UInt32Value)97045504U };
            AxisId axisId2 = new AxisId() { Val = (UInt32Value)97055488U };

            barChart1.Append(barDirection1);
            barChart1.Append(barGrouping1);
            barChart1.Append(barChartSeries1);
            barChart1.Append(axisId1);
            barChart1.Append(axisId2);

            ValueAxis valueAxis1 = GenerateValueAxis(axisId2, AxisPositionValues.Left, valueAxisFormat, axisId1);
            CategoryAxis categoryAxis1 = GenerateCategoryAxis(axisId1, AxisPositionValues.Bottom, categoryAxisFormat, axisId2);

            ShapeProperties shapeProperties1 = new ShapeProperties();
            A::NoFill noFill3 = new A::NoFill();

            A::Outline outline6 = new A::Outline() { Width = 25400 };
            A::NoFill noFill4 = new A::NoFill();

            outline6.Append(noFill4);

            shapeProperties1.Append(noFill3);
            shapeProperties1.Append(outline6);

            plotArea1.Append(layout2);
            plotArea1.Append(barChart1);
            plotArea1.Append(categoryAxis1);
            plotArea1.Append(valueAxis1);
            plotArea1.Append(shapeProperties1);
            PlotVisibleOnly plotVisibleOnly1 = new PlotVisibleOnly() { Val = true };
            DisplayBlanksAs displayBlanksAs1 = new DisplayBlanksAs() { Val = DisplayBlanksAsValues.Gap };

            chart1.Append(title1);
            chart1.Append(plotArea1);
            chart1.Append(plotVisibleOnly1);
            chart1.Append(displayBlanksAs1);

            return chart1;
        }