Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 6170 was 6165, checked in by fruehrli, 14 years ago

#1503 BubbleChart without exception

File size: 2.0 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  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}
Note: See TracBrowser for help on using the repository browser.