当前位置: 首页>>代码示例>>C#>>正文


C# Chart.Append方法代码示例

本文整理汇总了C#中Chart.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.Append方法的具体用法?C# Chart.Append怎么用?C# Chart.Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chart的用法示例。


在下文中一共展示了Chart.Append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateChart

        public Chart GenerateChart(string title, List<AssetWeighting> model)
        {
            Chart chart1 = new Chart();
            Title title1 = GenerateTitle(title);

            View3D view3D1 = new View3D();
            RotateX rotateX1 = new RotateX() { Val = 30 };
            Perspective perspective1 = new Perspective() { Val = 30 };

            view3D1.Append(rotateX1);
            view3D1.Append(perspective1);

            PlotArea plotArea1 = new PlotArea();
            Layout layout1 = new Layout();

            Pie3DChart pie3DChart1 = new Pie3DChart();
            VaryColors varyColors1 = new VaryColors() { Val = true };

            PieChartSeries pieChartSeries1 = new PieChartSeries();
            Index index1 = new Index() { Val = (UInt32Value)0U };
            Order order1 = new Order() { Val = (UInt32Value)0U };

            // c:tx series text
            SeriesText seriesText1 = GenerateSeriesText(title, GraphData.DataColumn);

            // c:cat category axis data
            var categoryData = model.OrderByDescending(m => m.Weighting).Select(n => n.AssetClass);
            GraphData.AddTextColumn(categoryName, categoryData);
            CategoryAxisData categoryAxisData1 = GenerateCategoryAxisData(categoryData, GraphData.TextColumn);

            // c:val values
            var valuesData = model.OrderByDescending(m => m.Weighting).Select(n => n.Weighting ?? 0).ToArray();
            string valuesColumn = GraphData.AddDataColumn(seriesName, valuesData);
            Values values1 = GenerateValues(valueFormat, valuesData, valuesColumn);

            //var series = from m in model
            //             orderby m.Weighting descending
            //             select new TextSeries { Name = m.AssetClass, Values = (new List<double>() { m.Weighting ?? 0 }) };

            //string[] headers = { categoryName, seriesName };
            //GraphData.AddTextSeries(headers, series);

            pieChartSeries1.Append(index1);
            pieChartSeries1.Append(order1);
            pieChartSeries1.Append(seriesText1);
            pieChartSeries1.Append(categoryAxisData1);
            pieChartSeries1.Append(values1);

            pie3DChart1.Append(varyColors1);
            pie3DChart1.Append(pieChartSeries1);

            plotArea1.Append(layout1);
            plotArea1.Append(pie3DChart1);

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

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

            return chart1;
        }
开发者ID:garsiden,项目名称:Report-Generator,代码行数:65,代码来源:AllocationPieChart.cs

示例2: GenerateChart

        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;
        }
开发者ID:garsiden,项目名称:Report-Generator,代码行数:52,代码来源:StressTestBarChart.cs

示例3: GenerateChart

        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;
        }
开发者ID:garsiden,项目名称:Report-Generator,代码行数:62,代码来源:AllocationComparisonBarChart.cs


注:本文中的Chart.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。