Ejemplo n.º 1
0
        public CRBIDocChartData LoadContent_4_2()
        {
            CRBIDocChartData data = new CRBIDocChartData();
            //data.AddHeader(new List<string>() { "s", "a", "s" });
            //data.ChartCode = "";
            //data.ChartType = "pie";
            //data.Columns.Add(new CRBIDocChartData.CRBIDocChartDataItem(new List<double>() { 24.0, 26.0, 50.0 }, "rt", 0));
            //data.HeaderColumns.Add("sa");

            ChartJson json = new ChartJson();

            json.chart     = true;
            json.charttype = "";
            json.xAxis.Add(new xAxisItemJson()
            {
                categories = new List <string>()
                {
                    "甘肃", "陕西", "山西"
                }, crosshair = true
            });
            json.series.Add(new SeriesItemJson("蒸发量")); // { data = new List<int>() { 15,17,19 }, data_f = new List<double>() { 15.0,17.0,19.0 } });
            json.series.Add(new SeriesItemJson("降水量")); // { data = new List<int>() { 15, 21, 36 }, data_f = new List<double>() { 15.0, 21.0, 36.0 } });
            for (int i = 0; i < 3; i++)
            {
                json.series[0].data.Add(i + 1);
                json.series[1].data.Add(i + 2);
                json.series[0].data_f.Add(i + 1.1);
                json.series[1].data_f.Add(i + 2.2);
            }


            convertJsonToPieData(json, data);

            return(data);
        }
Ejemplo n.º 2
0
        public CRBIDocChartData LoadContent_4_3()
        {
            CRBIDocChartData data = new CRBIDocChartData();
            //data.AddHeader(new List<string>() { "s", "a", "s" });
            //data.ChartCode = "";
            //data.ChartType = "pie";
            //data.Columns.Add(new CRBIDocChartData.CRBIDocChartDataItem(new List<double>() { 24.0, 26.0, 50.0 }, "rt", 0));
            //data.HeaderColumns.Add("sa");

            ChartJson json = new ChartJson();

            json.chart     = true;
            json.charttype = "bar";
            json.series    = new List <SeriesItemJson>();
            json.series.Add(new SeriesItemJson("蒸发量")
            {
                data = new List <int>()
                {
                    15, 17, 19
                }, data_f = new List <double>()
                {
                    15.0, 17.0, 19.0
                }
            });
            json.series.Add(new SeriesItemJson("降水量")
            {
                data = new List <int>()
                {
                    15, 21, 36
                }, data_f = new List <double>()
                {
                    15.0, 21.0, 36.0
                }
            });

            json.xAxis = new List <xAxisItemJson>();
            json.xAxis.Add(new xAxisItemJson()
            {
                categories = new List <string>()
                {
                    "aa", "bb", "cc"
                }, crosshair = true
            });
            convertJsonToPieData(json, data);
            return(data);
        }
Ejemplo n.º 3
0
        public CRBIDocChartData LoadContent_4_1()
        {
            CRBIDocChartData data = new CRBIDocChartData();

            ChartJson json = new ChartJson();

            //json.chart = true;
            //json.charttype = "line";
            //json.xAxis.Add(new xAxisItemJson() { categories = new List<string>() { "直接访问", "邮件营销", "联盟广告", "视频广告", "搜索引擎" }, crosshair = true });

            //json.series.Add(new SeriesItemJson("访问来源"));// { data = new List<int>() { 15,17,19 }, data_f = new List<double>() { 15.0,17.0,19.0 } });
            ////json.series.Add(new SeriesItemJson("降水量"));// { data = new List<int>() { 15, 21, 36 }, data_f = new List<double>() { 15.0, 21.0, 36.0 } });
            //json.series[0].data.Add(330);
            //json.series[0].data.Add(334);
            //json.series[0].data.Add(530);
            //json.series[0].data.Add(300);
            //json.series[0].data.Add(377);

            //convertJsonToPieData(json, data);

            data = new CRBIDocChartData("pie");
            data.Columns.Add(new CRBIDocChartData.CRBIDocChartDataItem(new List <int>()
            {
                30
            }, "直接访问", 1));
            data.Columns.Add(new CRBIDocChartData.CRBIDocChartDataItem(new List <int>()
            {
                40
            }, "邮件营销", 2));
            data.Columns.Add(new CRBIDocChartData.CRBIDocChartDataItem(new List <int>()
            {
                30
            }, "联盟广告", 3));

            data.AddHeader(new List <string>()
            {
                "直接访问"
            });
            return(data);
        }
        public CRBIDocChartData LoadContent_4_2()
        {
            CRBIDocChartData data = new CRBIDocChartData();

            return(data);
        }