Esempio n. 1
0
        public FileContentResult MyChart1(string coinid, string userId)
        {
            int coinid1 = Convert.ToInt32(coinid);
            IEnumerable <GetTotalBalance_Result> TotalbalanceResult = from result in db.GetTotalBalance(userId, coinid1).ToList()
                                                                      select new GetTotalBalance_Result
            {
                Transtype = result.Transtype,
                balance   = result.balance
            };

            List <GetTotalBalance_Result> asList = TotalbalanceResult.ToList();

            ArrayList transtype = new ArrayList();
            ArrayList balance   = new ArrayList();

            foreach (GetTotalBalance_Result obj in asList)
            {
                transtype.Add(obj.Transtype);
                balance.Add(obj.balance);
            }

            var bytes = new System.Web.Helpers.Chart(width: 350, height: 350, theme: ChartTheme.Blue)
                        .AddSeries(
                chartType: "pie",
                xValue: transtype,
                yValues: balance)
                        .GetBytes("png");

            return(File(bytes, "image/png"));
        }
        public ActionResult DadosColuna()
        {
            var chart = new System.Web.Helpers.Chart(width: 300, height: 220).AddTitle("Test");

            var xValues = new List <String>();
            var yValues = new List <String>();

            var lista = (from n in db.Naufragos
                         select new
            {
                n.Nome,
                n.Estado
            });

            foreach (var item in lista)
            {
                xValues.Add(item.Nome);
                yValues.Add(item.Estado);
            }

            chart.AddSeries(chartType: "Doughnut",
                            xValue: xValues,
                            yValues: yValues).Write("png");

            return(null);
        }
        public ActionResult CreateChart(string nameLv)
        {
            const string Blue  = "<Chart BackColor=\"#D3DFF0\" BackGradientStyle=\"TopBottom\" BackSecondaryColor=\"White\" BorderColor=\"26, 59, 105\" BorderlineDashStyle=\"Solid\" BorderWidth=\"15\" Palette=\"BrightPastel\">\r\n    <ChartAreas>\r\n        <ChartArea Name=\"Default\" _Template_=\"All\" BackColor=\"64, 165, 191, 228\" BackGradientStyle=\"TopBottom\" BackSecondaryColor=\"White\" BorderColor=\"64, 64, 64, 64\" BorderDashStyle=\"Solid\" ShadowColor=\"Transparent\" /> \r\n    </ChartAreas>\r\n    <Legends>\r\n        <Legend _Template_=\"All\" BackColor=\"Transparent\" Font=\"Trebuchet MS, 8.25pt, style=Bold\" IsTextAutoFit=\"False\" /> \r\n    </Legends>\r\n    <BorderSkin SkinStyle=\"Emboss\" /> \r\n  </Chart>";
            var          chart = new SimpleChart.Chart(width: 800, height: 300, theme: Blue).AddTitle(("Membership function: " + nameLv)).AddLegend();

            for (int i = 0; i < FKB.ListVar.Count; i++)
            {
                if (FKB.ListVar[i].Name == nameLv)
                {
                    chart.AddSeries(
                        name: FKB.ListVar[i].terms[0].Name,
                        chartType: "Line",
                        xValue: new[] { FKB.ListVar[i].terms[0].a, FKB.ListVar[i].terms[0].b, FKB.ListVar[i].terms[0].c },
                        yValues: new[] { 1, 1, 0 });


                    for (int j = 1; j < FKB.ListVar[i].terms.Count - 1; j++)
                    {
                        chart.AddSeries(
                            name: FKB.ListVar[i].terms[j].Name,
                            chartType: "Line",
                            xValue: new[] { FKB.ListVar[i].terms[j].a, FKB.ListVar[i].terms[j].b, FKB.ListVar[i].terms[j].c },
                            yValues: new[] { 0, 1, 0 });
                    }
                    chart.AddSeries(
                        name: FKB.ListVar[i].terms[FKB.ListVar[i].terms.Count - 1].Name,
                        chartType: "Line",
                        xValue: new[] { FKB.ListVar[i].terms[FKB.ListVar[i].terms.Count - 1].a, FKB.ListVar[i].terms[FKB.ListVar[i].terms.Count - 1].b, FKB.ListVar[i].terms[FKB.ListVar[i].terms.Count - 1].c },
                        yValues: new[] { 0, 1, 1 })
                    .Write();
                    break;
                }
            }
            return(null);
        }
Esempio n. 4
0
        public ActionResult BoxPlot()
        {
            CultureInfo     cultureinfo    = CultureInfo.CreateSpecificCulture("en-IE");
            List <UINode>   nodeActivities = db.SampleNodes.ToList();
            List <DateTime> dateVals       = nodeActivities.Select(s => (DateTime)s.FromDate)
                                             .OrderBy(o => o.ToOADate()).ToList();

            if (dateVals.Count() < 1)
            {
                return(null);
            }
            DateTime      first     = dateVals.Min();
            DateTime      last      = dateVals.Max();
            int           noOfDays  = Math.Abs((last - first).Days);
            int           noOfHours = Math.Abs((last - first).Hours);
            List <double> tickDiff  = new List <double>();

            for (int i = 0; i < dateVals.Count; i++)
            {
                tickDiff.Add(Math.Abs(dateVals[i].ToOADate()));
            }
            // Create a list of vlues to plot
            List <int> HitVals = new List <int>();

            HitVals.AddRange(nodeActivities.Select(d => d.NumberOfHits).ToList());
            var chart = new System.Web.Helpers.Chart(width: 800, height: 600, theme: GetTheme(noOfDays, noOfHours))
                        .SetXAxis("Time between Hit sample", min: dateVals.Min().ToOADate(), max: dateVals.Max().ToOADate())
                        .AddLegend("Legend")
                        .AddSeries("No of Hits", chartType: "Point", xValue: dateVals, yValues: HitVals)
                        .AddSeries("No of Hits over time", chartType: "FastLine", xValue: dateVals, yValues: HitVals)
                        .Write("bmp");


            return(null);
        }
Esempio n. 5
0
        public ActionResult CreateODAChart()
        {
            Service service = new Service();

            var orders = service.GetOrders().ToList();

            IList <int> orderdates            = new List <int>();
            IDictionary <int, double> amounts = new Dictionary <int, double>();

            int i = 0;

            foreach (var o in orders)
            {
                if (orderdates.Contains(o.OrderDate.Day))
                {
                    int bb = orderdates.IndexOf(o.OrderDate.Day) + 1;
                    amounts[orderdates.IndexOf(o.OrderDate.Day)] = amounts.Values.ElementAt((orderdates.IndexOf(o.OrderDate.Day))) + o.Amount;
                }
                else
                {
                    orderdates.Add(o.OrderDate.Day);
                    amounts.Add(i++, o.Amount);
                }
            }

            var chart = new SimpleChart.Chart(width: 700, height: 300)
                        .AddTitle("Sales per day")
                        .AddSeries(
                chartType: "Line",
                xValue: orderdates, xField: "Day",
                yValues: amounts.Values, yFields: "Sales")
                        .Write();

            return(null);
        }
Esempio n. 6
0
        public ActionResult CreateSAAChart()
        {
            Service service = new Service();

            int i = 0;

            var                       orders  = service.GetOrders().ToList();
            IList <string>            sanames = new List <string>();
            IDictionary <int, double> amounts = new Dictionary <int, double>();

            foreach (var o in orders)
            {
                if (sanames.Contains(o.ShopAssistant))
                {
                    amounts[sanames.IndexOf(o.ShopAssistant)] = amounts.Values.ElementAt((sanames.IndexOf(o.ShopAssistant))) + Convert.ToDouble(o.Amount);
                }
                else
                {
                    amounts.Add(i++, Convert.ToDouble(o.Amount));
                    sanames.Add(o.ShopAssistant);
                }
            }

            var chart = new SimpleChart.Chart(width: 700, height: 300)
                        .AddTitle("Product sales of each shop assistant")
                        .AddSeries("Default",
                                   xValue: sanames, xField: "Name",
                                   yValues: amounts.Values, yFields: "Amount")
                        .Write();

            return(null);
        }
Esempio n. 7
0
        public ActionResult CreateSAPChart()
        {
            Service service = new Service();

            var orders = service.GetOrders().ToList();

            IList <string>            sanames  = new List <string>();
            IDictionary <int, double> revenues = new Dictionary <int, double>();

            int i = 0;

            foreach (var o in orders)
            {
                if (sanames.Contains(o.ShopAssistant))
                {
                    int bb = sanames.IndexOf(o.ShopAssistant) + 1;
                    revenues[sanames.IndexOf(o.ShopAssistant)] = revenues.Values.ElementAt((sanames.IndexOf(o.ShopAssistant))) + o.Price;
                }
                else
                {
                    revenues.Add(i++, o.Price);
                    sanames.Add(o.ShopAssistant);
                }
            }

            var chart = new SimpleChart.Chart(width: 700, height: 300)
                        .AddTitle("Effectiveness of each shop assistant")
                        .AddSeries("Default",
                                   xValue: sanames, xField: "Name",
                                   yValues: revenues.Values, yFields: "Revenue")
                        .Write();

            return(null);
        }
Esempio n. 8
0
        public ActionResult MyChart()
        {
            var userId  = User.Identity.GetUserId();
            int coinid1 = 104;
            IEnumerable <GetTotalBalance_Result> TotalbalanceResult = from result in db.GetTotalBalance(userId, coinid1).ToList()
                                                                      select new GetTotalBalance_Result
            {
                Transtype = result.Transtype,
                balance   = result.balance
            };

            List <GetTotalBalance_Result> asList = TotalbalanceResult.ToList();

            ArrayList transtype = new ArrayList();
            ArrayList balance   = new ArrayList();

            foreach (GetTotalBalance_Result obj in asList)
            {
                transtype.Add(obj.Transtype);
                balance.Add(obj.balance);
            }

            var bytes = new System.Web.Helpers.Chart(width: 350, height: 350, theme: ChartTheme.Blue)
                        .AddSeries(
                chartType: "pie",
                xValue: transtype,
                yValues: balance)
                        .GetBytes("png");

            return(File(bytes, "image/png"));
        }
Esempio n. 9
0
        public byte[] GetChart()
        {
            int           Width = 0, Height = 0;
            string        chartTitle = "", xTitle = "", yTitle = "", chartType = "Column";
            List <string> xValues = new List <string>();
            List <string> yValues = new List <string>();

            if (_ChartParameters.ContainsKey("width"))
            {
                Width = Convert.ToInt32(_ChartParameters["width"]);
            }
            if (_ChartParameters.ContainsKey("height"))
            {
                Height = Convert.ToInt32(_ChartParameters["height"]);
            }
            if (_ChartParameters.ContainsKey("chartTitle"))
            {
                chartTitle = Convert.ToString(_ChartParameters["chartTitle"]);
            }
            if (_ChartParameters.ContainsKey("xTitle"))
            {
                xTitle = Convert.ToString(_ChartParameters["xTitle"]);
            }
            if (_ChartParameters.ContainsKey("yTitle"))
            {
                yTitle = Convert.ToString(_ChartParameters["yTitle"]);
            }
            if (_ChartParameters.ContainsKey("chartType"))
            {
                chartType = Convert.ToString(_ChartParameters["chartType"]);
            }


            foreach (KeyValuePair <string, object> data in _Data)
            {
                xValues.Add(data.Key);
                yValues.Add(data.Value.ToString());
            }


            var myChart = new System.Web.Helpers.Chart(width: Width, height: Height, theme: CHARTS_THEME)
                          .SetXAxis(title: xTitle)
                          .SetYAxis(title: yTitle)

                          .AddTitle(chartTitle)
                          .AddSeries(
                chartType: chartType,
                xValue: xValues, xField: xTitle,
                yValues: yValues, yFields: yTitle

                );

            return(myChart.GetBytes());
        }
Esempio n. 10
0
 public ActionResult RateChart()
 {
     Dictionary<string, float> d = new Dictionary<string, float>();
     d.Keys.ToArray();
     var them1 = "<Chart BackColor=\"#FADA5E\" BackGradientStyle=\"TopBottom\" BorderColor=\"#B8860B\" BorderWidth=\"2\" BorderlineDashStyle=\"Solid\" Palette=\"EarthTones\">\r\n <ChartAreas>\r\n <ChartArea Name=\"Default\" _Template_=\"All\" BackColor=\"Transparent\" BackSecondaryColor=\"White\" BorderColor=\"64, 64, 64, 64\" BorderDashStyle=\"Solid\" ShadowColor=\"Transparent\">\r\n <AxisY Enabled=\"False\">\r\n <LabelStyle Font=\"Trebuchet MS, 8.25pt, style=Bold\" />\r\n </AxisY>\r\n <AxisX LineColor=\"64, 64, 64, 64\">\r\n<MajorGrid Enabled=\"false\" />\r\n<LabelStyle Font=\"Trebuchet MS, 6.25pt, style=Bold\" />\r\n </AxisX>\r\n </ChartArea>\r\n </ChartAreas>\r\n <Legends>\r\n <Legend _Template_=\"All\" BackColor=\"Transparent\" Docking=\"Bottom\" Font=\"Trebuchet MS, 8.25pt, style=Bold\" LegendStyle=\"Row\">\r\n </Legend>\r\n </Legends>\r\n <BorderSkin SkinStyle=\"Emboss\" />\r\n</Chart>";
     var key = new System.Web.Helpers.Chart(width: 100, height: 120, theme: them1)
         .AddSeries(
             chartType: "bar",
             xValue: new[] { "1 star: ", "2 star: ", "3 star: ", "4 star: ", "5 star: " },
             yValues: new[] { "20", "20", "40", "10", "10" }
             ).Write();
     return null;
 }
        public ActionResult ShowThemeChart(int id)
        {
            BizInfo p = BizInfoRepository.GetBizInfoById(id);

            var myChart = new System.Web.Helpers.Chart(width: 200, height: 160, theme: ChartTheme.Green)
                          .AddTitle(p.AverageRating.ToString() + " out of 5 stars")
                          .AddSeries(
                name: "Reviews",
                xValue: new[] { "5 Star(" + p.FiveStarVotes.ToString() + "):", "4 Star(" + p.FourStarVotes.ToString() + "):", "3 Star(" + p.ThreeStarVotes.ToString() + "):", "2 Star(" + p.TwoStarVotes.ToString() + "):", "1 Star(" + p.OneStarVotes.ToString() + "):" },
                yValues: new[] { (p.FiveStarVotes * 5).ToString(), (p.FourStarVotes * 4).ToString(), (p.ThreeStarVotes * 3).ToString(), (p.TwoStarVotes * 2).ToString(), p.OneStarVotes.ToString() })
                          .GetBytes("png");

            return(File(myChart, "image/png"));
        }
Esempio n. 12
0
        private Chart GetChart(string[] xValues, string[] yValues, string url)
        {
            var myChart = new Chart(width: 600, height: 400, theme: ChartTheme.Green)
                          .AddTitle(url)
                          .AddSeries(
                name: "ChartTitle",
                xValue: xValues,
                yValues: yValues
                )
                          .SetXAxis("Seconds")
                          .SetYAxis("Page Hits");

            return(myChart);
        }
Esempio n. 13
0
        public string SavePersonCompanyTicketChart(string userName, int reportId, DateTime startDate, DateTime endDate)
        {
            AccountController ac       = new AccountController();
            string            realName = ac.GetRealName(userName);
            //读取两周的数据,自己客户的票量,按照日期展示曲线图
            OtaCrmModel db           = new OtaCrmModel();
            var         companyNames = from c in db.OtaCompany
                                       where c.SalesUserName == realName
                                       select c.CompanyName;

            var q = from p in db.AgentGradeOperation
                    where p.statDate.Value >= startDate && p.statDate.Value <= endDate && companyNames.Contains(p.agentName)
                    group p by p.statDate
                    into g
                    orderby g.Key
                    select new { ticketSum = g.Sum(b => b.CurDateTicketCount.Value), ticketDay = g.Key };

            List <string> dateList      = new List <string>();
            List <int>    ticketSumList = new List <int>();

            foreach (var item in q)
            {
                dateList.Add(item.ticketDay.Value.ToString("yyyyMMdd"));
                ticketSumList.Add(item.ticketSum);
            }

            System.Web.Helpers.Chart chart = new System.Web.Helpers.Chart(width: 500, height: 300, theme: ChartTheme.Blue, themePath: null);
            chart.AddTitle(text: userName + "客户票量统计", name: userName + "_CompanyTicketSum");
            chart.AddSeries(name: "票量"
                            , chartType: "Column"
                            , chartArea: ""
                            , axisLabel: "张"
                            , legend: "票量合计"
                            , markerStep: 1
                            , xValue: dateList
                            , xField: "日期"
                            , yValues: ticketSumList
                            , yFields: "票量");

            string filePath = Server.MapPath("~/CompanyImages/Reports/" + reportId.ToString());
            CompanyBusinessDailyPhotoesController cbd = new CompanyBusinessDailyPhotoesController();

            cbd.CreateFolderIfNeeded(filePath);
            string fileName = userName + "_CompanyTicketSum_" + startDate.ToString("yyyyMMdd") + "_" + endDate.ToString("yyyyMMdd") + ".jpg";

            chart.Save(path: Path.Combine(filePath, fileName), format: "jpeg");

            return(fileName);
        }
Esempio n. 14
0
        public ActionResult BudgetChart()
        {
            string Yellow1 = @"<Chart BackColor=""darkorange"" BackGradientStyle=""TopBottom"" BorderColor=""black"" BorderWidth=""0"" BorderlineDashStyle=""Solid"" Palette=""BrightPastel"">
                                <ChartAreas>
	                                <ChartArea Name=""Default"" _Template_=""All"" BackColor=""Transparent"" BackSecondaryColor=""Black"" BorderColor=""64, 64, 64, 64"" BorderDashStyle=""Solid"" ShadowColor=""Transparent"">
		                                <AxisY>
			                                <LabelStyle Font=""Trebuchet MS, 8.25pt, style=Bold"" />
		                                </AxisY>
		                                <AxisX LineColor=""64, 64, 64, 64"" Interval=""1"" >
			                                <LabelStyle Font=""Trebuchet MS, 8.25pt, style=Bold"" />
		                                </AxisX>
	                                </ChartArea>
                                </ChartAreas>
                                <Legends>
                                <Legend _Template_=""All"" BackColor=""Transparent"" Docking=""Bottom"" Font=""Trebuchet MS, 8.25pt, style=Bold"" LegendStyle=""Row"">
                                </Legend>
                                </Legends>
                                </Chart>";

            double?[] profit = new double?[12];

            for (int i = 1; i < 13; i++)
            {
                var netProfit = db.Budgets.Where(p => p.MonthId == i && p.UserName == User.Identity.Name).Select(p => p.NetProfit).SingleOrDefault();
                if (netProfit == default(double))
                {
                    profit[i - 1] = 0;
                }
                else
                {
                    profit[i - 1] = netProfit;
                }
            }
            var chart = new System.Web.Helpers.Chart(width: 800, height: 400, theme: Yellow1)
                        .AddTitle("Monthly Profits")
                        .SetXAxis("Months")
                        .SetYAxis("Money")
                        .AddSeries(
                chartType: "Line",
                name: "Employee",
                xValue: new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" },
                xField: "Months",
                yValues: profit,
                yFields: "$").Write();

            return(null);
        }
Esempio n. 15
0
        public ActionResult ShowChart(int id)
        {
            BizInfo b       = BizInfoRepository.GetBizInfoById(id);
            string  myTheme = @"<Chart BackColor=""#e6e5e5"" >
                                    <ChartAreas>
                                        <ChartArea Name=""Default"" BackColor=""Transparent""></ChartArea>
                                    </ChartAreas>
                                </Chart>";

            var myChart = new System.Web.Helpers.Chart(width: 220, height: 170, theme: myTheme)
                          .AddTitle(b.AverageRating.ToString() + " out of 5 stars")
                          .AddSeries(
                chartType: "bar",
                name: "Reviews",
                xValue: new[] { "5 Star(" + b.FiveStarVotes.ToString() + "):", "4 Star(" + b.FourStarVotes.ToString() + "):", "3 Star(" + b.ThreeStarVotes.ToString() + "):", "2 Star(" + b.TwoStarVotes.ToString() + "):", "1 Star(" + b.OneStarVotes.ToString() + "):" },
                yValues: new[] { (b.FiveStarVotes * 5).ToString(), (b.FourStarVotes * 4).ToString(), (b.ThreeStarVotes * 3).ToString(), (b.TwoStarVotes * 2).ToString(), b.OneStarVotes.ToString() })
                          .GetBytes("png");

            return(File(myChart, "image/png"));
        }
 private string generateSchoolChart(string[] sources, int[] sourceCounts)
 {
     string uuid = Guid.NewGuid().ToString();
     var filePath = getChartPath(uuid);
     //Theme to hide slice labels
     string chartTheme = @"<Chart>
                             <Series>
                                 <Series Name=""Programs"" ChartType=""Pie"" LegendText=""#VALX (#PERCENT{P2})"" CustomProperties=""PieLabelStyle=Disabled"">
                                 </Series>
                             </Series>
                             <Legends>
                                 <Legend _Template_=""All"" Docking=""Bottom"">
                                 </Legend>
                             </Legends>
                         </Chart>";
     var myChart = new System.Web.Helpers.Chart(width: 250, height: 400, theme: chartTheme);
     myChart.AddTitle("Candidates Selected");
     myChart.AddSeries(
         "Programs", chartType: SeriesChartType.Pie.ToString(),
         xValue: sources,
         yValues: sourceCounts
         );
     myChart.AddLegend("Programs");
     myChart.Save(filePath, "jpg");
     return uuid;
 }
Esempio n. 17
0
        private Chart GetChart(string[] xValues, string[] yValues, string url)
        {
            var myChart = new Chart(width: 600, height: 400, theme: ChartTheme.Green)
                .AddTitle(url)
                .AddSeries(
                    name: "ChartTitle",
                    xValue: xValues,
                    yValues: yValues
                    )
                .SetXAxis("Seconds")
                .SetYAxis("Page Hits");

            return myChart;
        }
Esempio n. 18
0
        public ActionResult Chart()
        {
            //essayons de retourner tous les etudiants
            EtudiantContext db   = new EtudiantContext();
            List <Etudiant> list = db.etudiants.ToList();
            //initialisation des compteurs des filieres
            int info = 0, indus = 0, gtr = 0, gpmc = 0;

            //variable pour les nombre totale et le reste qui n'a pas choisi les filieres
            int nbrTotal = list.Count, nbrReste = 0;

            for (int i = 0; i < nbrTotal; i++)
            {
                if (list[i].Choix == null)
                {
                    //un etudiant avec null dans choix alors on va l'es ajouter dans le reste
                    nbrReste++;
                }
                //sinon on va traiter les choix comme ca
                else
                {
                    if (list[i].Validated)
                    {
                        char[] chiffr = (list[i].Choix).ToCharArray();

                        if (chiffr[0] == 'F')
                        {
                            info++;
                        }
                        if (chiffr[0] == 'P')
                        {
                            gpmc++;
                        }
                        if (chiffr[0] == 'T')
                        {
                            gtr++;
                        }
                        if (chiffr[0] == 'D')
                        {
                            indus++;
                        }
                    }
                }
            }

            //les pourcentages
            //double nbrTotalP = Convert.ToDouble(nbrTotal) / Convert.ToDouble(nbrTotal) * 100;
            //double nbrResteP = Convert.ToDouble(nbrReste) / Convert.ToDouble(nbrTotal) * 100;
            double infoP  = Convert.ToDouble(info) / Convert.ToDouble(nbrTotal) * 100;
            double gtrP   = Convert.ToDouble(gtr) / Convert.ToDouble(nbrTotal) * 100;
            double gpmcP  = Convert.ToDouble(gpmc) / Convert.ToDouble(nbrTotal) * 100;
            double indusP = Convert.ToDouble(indus) / Convert.ToDouble(nbrTotal) * 100;


            string[] vx = { "info", "indus", "gtr", "gpmc" };
            double[] vy = { infoP, indusP, gtrP, gpmcP };

            System.Web.Helpers.Chart chart = new System.Web.Helpers.Chart(width: 900, height: 400, theme: ChartTheme.Blue);


            chart.AddSeries(chartType: "Column", xValue: vx, yValues: vy);
            chart.Write("png");
            return(null);
        }
 private string generateFYChart(int[,] sourceCounts, string[] sources, bool byFY)
 {
     string uuid = Guid.NewGuid().ToString(); // Generate unique ID for file name
     var filePath = getChartPath(uuid);
     string chartTheme = @"<Chart>
                             <ChartAreas>
                                 <ChartArea Name=""Default"" _Template_=""All"">
                                     <AxisX>
                                         <LabelStyle Interval=""1""/>
                                     </AxisX>
                                 </ChartArea>
                             </ChartAreas>
                             <Legends>
                                 <Legend _Template_=""All"" Docking=""Top"" LegendStyle=""Column"" DockedToChartArea=""Default"" IsDockedInsideChartArea=""true"" BackColor=""Transparent"" Font=""Times New Roman, 6pt"">
                                 </Legend>
                             </Legends>";
     chartTheme += "<Series>";
     for (var i = 0; i < sources.Length; i++)
     {
         chartTheme += "" +
                         "<Series Name='" + sources[i] + "' ChartType='StackedColumn' Label='#VALY{#}' CustomProperties='SmartLabelStyle=Enabled'>" +
                         "</Series>";
     }
     chartTheme += "</Series></Chart>";
     var myChart = new System.Web.Helpers.Chart(width: 900, height: 130, theme: chartTheme);
     string[] months;
     if (byFY)
     {
         months = new[] { "Prior", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept" };
     }
     else
     {
         months = new[] { "Prior", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
     }
     for (var i = 0; i < sources.Length; i++)
     {
         int[] temp = new int[13];
         for (var j = 0; j < 13; j++)
         {
             temp[j] = sourceCounts[i, j];
         }
         myChart.AddSeries(sources[i],
                 chartType: SeriesChartType.StackedColumn.ToString(),
                 xValue: months,
                 yValues: temp);
     }
     myChart.AddLegend();
     myChart.Save(filePath, "jpg");
     return uuid;
 }
Esempio n. 20
0
        public ActionResult GetRainfallChart()
        {
            var key = new System.Web.Helpers.Chart(width: 600, height: 400)
                .AddSeries(
                    chartType: "area",
                    legend: "Rainfall",
                    xValue: new[] { "Jan", "Feb", "Mar", "Apr", "May" },
                    yValues: new[] { "20", "20", "40", "10", "10" })
                .Write();

            return null;
        }
Esempio n. 21
0
 public ActionResult GetMonths()
 {
     var d = new DateTimeFormatInfo();
     var key = new System.Web.Helpers.Chart(width: 600, height: 400)
         .AddSeries(chartType: "column")
         .DataBindTable(d.MonthNames)
         .Write(format: "gif");
     return null;
 }