refresh
This commit is contained in:
@@ -24,13 +24,12 @@ namespace MoonPro.WS
|
||||
|
||||
[WebMethod]
|
||||
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
|
||||
public void randomData()
|
||||
public void randomData(int numVal)
|
||||
{
|
||||
JavaScriptSerializer js = new JavaScriptSerializer();
|
||||
Context.Response.Clear();
|
||||
Context.Response.ContentType = "application/json";
|
||||
// genero numVal valori random inizio/fine...
|
||||
int numVal = 100;
|
||||
int maxMinutes = 30;
|
||||
Random random = new Random();
|
||||
visjsDsItem[] items = new visjsDsItem[numVal];
|
||||
|
||||
+6
-8
@@ -12,7 +12,7 @@
|
||||
$(document).ready(function () {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/WS/MPData.asmx/randomData",
|
||||
url: "/WS/MPData.asmx/randomData?numVal=200",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: ChartVis,
|
||||
@@ -88,22 +88,21 @@
|
||||
}
|
||||
function OnError(response) {
|
||||
var output = response.responseText.replace("{\"d\":null}", "");
|
||||
var items = JSON.parse(output);
|
||||
//console.log(items);
|
||||
|
||||
|
||||
//console.log(JSON.parse(response.responseText));
|
||||
// recupero il container grafico
|
||||
var container = document.getElementById('visualization');
|
||||
|
||||
// ITES da deserializzazione risposta
|
||||
var items = JSON.parse(output);
|
||||
// gruppi
|
||||
var groups = [
|
||||
{
|
||||
id: 1
|
||||
, content: 'Macc 1'
|
||||
, content: 'Stati'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: 'Macc 2'
|
||||
content: 'Tempi'
|
||||
// Optional: a field 'className', 'style', 'order', [properties]
|
||||
}
|
||||
// more groups...
|
||||
@@ -114,7 +113,6 @@
|
||||
};
|
||||
// Create a Timeline
|
||||
var timeline = new vis.Timeline(container, items, groups, options);
|
||||
|
||||
//container.append(response.responseText);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user