Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs @ 6136

Last change on this file since 6136 was 6118, checked in by mjesner, 14 years ago

#1503 base architecture for chart control

File size: 2.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6using HLWebOKBQueryPlugin.Models;
7using HLWebOKBQueryPlugin.Helpers;
8using HLWebOKBQueryPlugin.OKBQueryService;
9
10namespace HLWebOKBQueryPlugin.Controllers
11{
12    public class ChartController : Controller
13    {
14        //
15        // GET: /Chart/
16
17
18        public ActionResult UpdateBubbleChart(FormCollection collection)
19        {
20
21
22            String selectedAxisX = collection.Get("valuesAxisXCombobox");
23            String selectedAxisY = collection.Get("valuesAxisYCombobox");
24            String selectedBubbleSize = collection.Get("bubbleSizeCombobox");
25           
26               
27            ChartModel cm = new ChartModel();
28
29            // Later, we will get the runs from the session ...
30            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
31
32            long[] runIds = new long[5];
33            for (int i = 0; i < 5; i++)
34            {
35                runIds[i] = i;
36            }
37            Run[] runs = client.GetRuns(runIds, false);
38
39            cm.UpdateRunCollection(runs);
40            cm.UpdateBubbleChart(selectedAxisY, selectedAxisX, selectedBubbleSize);
41
42            return View(cm);
43        }
44
45
46        public ActionResult Index()
47        {
48            ChartModel cm = new ChartModel();
49
50            // Later, we will get the runs from the session ...
51            QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
52
53            long[] runIds = new long[5];
54            for (int i = 0; i < 5; i++)
55            {
56                runIds[i] = i;
57            }
58            Run[] runs = client.GetRuns(runIds, false);
59
60            cm.UpdateRunCollection(runs);
61
62
63            return View(cm);
64        }
65
66        // [ChildActionOnly]
67        public ActionResult BubbleChart()
68        {
69            ChartModel cm = new ChartModel();
70
71            return PartialView("BubbleChart",cm); // name of usercontrol
72        }
73
74
75        //public ActionResult BoxPlot()
76        //{
77        //    return View();
78        //}
79
80    }
81}
Note: See TracBrowser for help on using the repository browser.