public void TestRealLife_Chart22()
        {
            const string fileName = @"d:\temp\ScottPlott_Chart22.png";

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            var data = new ChartData
            {
                Title      = "Test portfolio",
                Copyright  = "Testfirma",
                XLabelText = "Anlageklassen",
                YLabelText = "Anteil in %",
                FileName   = fileName,
                ChartType  = ChartType.LineChart,
                //PaperColor = Color.Red
            };

            TestHelper.LoadDefaultChartStyle(data, HighResolution);

            var dt = TestHelper.GetDataTable("chart22.xml");

            ChartUtility.DataTableToChartItemData(dt, "1;5;6;7", data);

            var x = new ChartHandler
            {
                ChartData = data
            };

            x.Export();

            TestHelper.StartFile(fileName);
        }
        public void TestRealLife_Chart3()
        {
            const string fileName = @"d:\temp\ScottPlott_Chart3.png";

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            var data = new ChartData
            {
                Title      = "Test portfolio",
                Copyright  = "Testfirma",
                XLabelText = "Anlageklassen",
                YLabelText = "Anteil in %",
                FileName   = fileName,
                ChartType  = ChartType.LineChart,
                //PaperColor = Color.Red
            };

            TestHelper.LoadDefaultChartStyle(data, HighResolution);

            var dt = TestHelper.GetDataTable("chart3.xml");

            ChartUtility.DataTableToChartItemData(dt, "", data);

            data.ChartStyle.XAxisNumberformat = "dd.MM.yyyy";

            data.PropertiesToUseForChart.Add("XValue");
            data.PropertiesToUseForChart.Add("YValue1");
            data.PropertiesToUseForChart.Add("YValue2");
            data.PropertiesToUseForChart.Add("YValue3");

            data.LabelsForSeries.Add("Aktien");
            data.LabelsForSeries.Add("Renten");
            data.LabelsForSeries.Add("Liquidität");

            var x = new ChartHandler
            {
                ChartData = data
            };

            x.Export();

            TestHelper.StartFile(fileName);
        }
示例#3
0
        /// <summary>
        /// Get data for a samplebar chart
        /// </summary>
        /// <param name="useDatabase"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public static void BarChartSample(bool useDatabase, ChartData data)
        {
            var erg = data.DataSource;

            if (useDatabase)
            {
                var dt = TestHelper.GetDataTable("BarChart.xml");
                ChartUtility.DataTableToChartItemData(dt, "1;3", data);
            }
            else
            {
                // shares
                var item = new ChartItemData
                {
                    Label   = "Aktien",
                    YValue1 = 0.5
                };

                erg.Add(item);

                // fixed income
                item = new ChartItemData
                {
                    Label   = "Anleihen",
                    YValue1 = 0.4
                };

                erg.Add(item);

                // liquidity
                item = new ChartItemData
                {
                    YValue1 = 0.1,
                    Label   = "Liquidität",
                };

                erg.Add(item);

                data.PropertiesToUseForChart.Add("XValue");
                data.PropertiesToUseForChart.Add("YValue");
            }
        }
        public void TestStackedColumn100Chart()
        {
            // const string sql = "EXEC Vermoegen_Db.[dbo].SetFinDBUser 'bodoprivate' exec Vermoegen_Db.[dbo].[GetAnteilswerte] 120, 1";

            const string fileName = @"d:\temp\ScottPlott_Db_StackedColumn100Chart.png";

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            var data = new ChartData
            {
                Title      = "Test portfolio",
                Copyright  = "Testfirma",
                XLabelText = "Anlageklassen",
                YLabelText = "Anteilswert",
                FileName   = fileName,
                ChartType  = ChartType.StackedColumn100Chart,
            };

            TestHelper.LoadDefaultChartStyle(data);

            var dt = TestHelper.GetDataTable("StackedColumnChart.xml");

            ChartUtility.DataTableToChartItemData(dt, "", data);

            var x = new ChartHandler
            {
                ChartData = data
            };

            x.Export();

            TestHelper.StartFile(fileName);
        }
示例#5
0
        public static void ChartSample(bool useDatabase, ChartData data)
        {
            var erg = data.DataSource;


            if (useDatabase)
            {
                var dt = TestHelper.GetDataTable("LineChart.xml");
                ChartUtility.DataTableToChartItemData(dt, "", data);
            }
            else
            {
                var date = DateTime.Now;

                //
                var item = new ChartItemData
                {
                    XValue  = date.AddMonths(-2).ToOADate(),
                    YValue1 = 276137,
                    YValue2 = 71735,
                    YValue3 = 69805,
                    IsDate  = true,
                };

                erg.Add(item);

                //
                item = new ChartItemData
                {
                    XValue  = date.AddMonths(-1).ToOADate(),
                    YValue1 = 76137,
                    YValue2 = 171735,
                    YValue3 = 269805,
                    IsDate  = true,
                };

                erg.Add(item);

                //
                item = new ChartItemData
                {
                    XValue  = date.ToOADate(),
                    YValue1 = 276137,
                    YValue2 = 71735,
                    YValue3 = 69805,
                    IsDate  = true,
                };

                erg.Add(item);

                data.PropertiesToUseForChart.Add("XValue");
                data.PropertiesToUseForChart.Add("YValue1");
                data.PropertiesToUseForChart.Add("YValue2");
                data.PropertiesToUseForChart.Add("YValue3");

                data.LabelsForSeries.Add("Aktien");
                data.LabelsForSeries.Add("Renten");
                data.LabelsForSeries.Add("Liquidität");
            }

            data.ChartStyle.XAxisNumberformat = "dd.MM.yyyy";
        }