1 | <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
|
---|
2 | <%@ Import Namespace="HLWebOKBQueryPlugin.Models" %>
|
---|
3 | <%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
|
---|
4 |
|
---|
5 |
|
---|
6 | <% using (Html.BeginForm("UpdateBubbleChart","Chart")) %>
|
---|
7 | <% { %>
|
---|
8 |
|
---|
9 | <%: Html.Label("x axis")%>
|
---|
10 | <%: Html.DropDownList("valuesAxisXCombobox", new SelectList(((ChartModel)Model).valuesAxisX))%>
|
---|
11 |
|
---|
12 | <%: Html.Label("y axis")%>
|
---|
13 | <%: Html.DropDownList("valuesAxisYCombobox", new SelectList(((ChartModel)Model).valuesAxisY))%>
|
---|
14 |
|
---|
15 | <%: Html.Label("bubble size")%>
|
---|
16 | <%: Html.DropDownList("bubbleSizeCombobox", new SelectList(((ChartModel)Model).bubbleSize))%>
|
---|
17 |
|
---|
18 | <input type="submit" value="update chart" />
|
---|
19 |
|
---|
20 | <% } %>
|
---|
21 |
|
---|
22 |
|
---|
23 | <asp:Chart ID="bubbleChart" runat="server" Visible="true" />
|
---|
24 |
|
---|
25 |
|
---|
26 | <%
|
---|
27 | if (((ChartModel)Model).Series != null) {
|
---|
28 | //bubbleChart = new Chart();
|
---|
29 | bubbleChart.Width = 150;
|
---|
30 | bubbleChart.Height = 300;
|
---|
31 | bubbleChart.Attributes.Add("align", "left");
|
---|
32 | bubbleChart.Titles.Add("bubbe chart");
|
---|
33 | bubbleChart.ChartAreas.Add(new ChartArea());
|
---|
34 | Response.Write(((ChartModel)Model).Series.Points.Count);
|
---|
35 | bubbleChart.Series.Add(((ChartModel)Model).Series);
|
---|
36 | bubbleChart.Legends.Add(new Legend("DBAs"));
|
---|
37 | bubbleChart.Legends[0].TableStyle = LegendTableStyle.Auto;
|
---|
38 | bubbleChart.Legends[0].Docking = Docking.Bottom;
|
---|
39 | bubbleChart.DataBind();
|
---|
40 | }
|
---|
41 |
|
---|
42 |
|
---|
43 |
|
---|
44 | //Chart chart = new Chart();
|
---|
45 | //chart.BackColor = System.Drawing.Color.Transparent;
|
---|
46 | //chart.Width = Unit.Pixel(250);
|
---|
47 | //chart.Height = Unit.Pixel(100);
|
---|
48 |
|
---|
49 | //Series series1 = new Series("Series1");
|
---|
50 | //series1.ChartArea = "ca1";
|
---|
51 | //series1.ChartType = SeriesChartType.Pie;
|
---|
52 | //series1.Font = new System.Drawing.Font("Verdana", 8.25f, System.Drawing.FontStyle.Regular);
|
---|
53 | //series1.Points.Add(new DataPoint {
|
---|
54 | // AxisLabel = "Value1", YValues = new double[] { 1, 2, 3.1 }
|
---|
55 | //});
|
---|
56 | //series1.Points.Add(new DataPoint {
|
---|
57 | // AxisLabel = "Value2", YValues = new double[] { 1, 2, 3.1 }
|
---|
58 | //});
|
---|
59 | //chart.Series.Add(series1);
|
---|
60 |
|
---|
61 | //ChartArea ca1 = new ChartArea("ca1");
|
---|
62 | //ca1.BackColor = System.Drawing.Color.Transparent;
|
---|
63 | //chart.ChartAreas.Add(ca1);
|
---|
64 |
|
---|
65 | //using (var ms = new System.IO.MemoryStream()) {
|
---|
66 | // chart.SaveImage(ms, ChartImageFormat.Png);
|
---|
67 | // ms.Seek(0, System.IO.SeekOrigin.Begin);
|
---|
68 |
|
---|
69 | // Response.Write(new FileStreamResult(ms, "image/png"));
|
---|
70 | //}
|
---|
71 |
|
---|
72 |
|
---|
73 | %>
|
---|
74 |
|
---|
75 |
|
---|