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