On my project, i'm using RadScheduler.
In result of the needs, i had to create a custom edit "window".
Basically in the main page i have:
and also a RadAjaxManager.
points to AdvancedForm.ascx
In AdvancedForm.ascx i have this javascript block
<script type=
"text/javascript"
>
var
chart;
// global
/*
* Request data from the server, add it to the graph
*/
function
requestData() {
$.ajaxSetup({ cache:
false
});
$.getJSON(
'exampleurl'
,
function
(data) {
//Clear the "old" series
while
(chart.series.length > 0) {
chart.series[0].remove(
true
);
}
//declare Json
var
jsonObj = {
series: []
};
//Cycle through each JSONobjcect returned by the url
$.each(data,
function
(i, item) {
var
key = item[
'tag'
];
var
value = item[
'data'
][
'Velocity'
];
jsonObj.series.push({
"name"
: key,
"data"
: value
});
});
//Add each of the key:value pair to the series
for
(
var
i
in
jsonObj.series) {
chart.addSeries(jsonObj.series[i]);
}
// call it again after ten seconds
setTimeout(requestData, 10000);
});
}
$(document).ready(
function
() {
chart =
new
Highcharts.Chart({
chart: {
renderTo:
'container'
,
defaultSeriesType:
'column'
,
events: {
load: requestData
}
},
title: {
text:
'Test Chart'
},
xAxis: {
title: {
text:
'Viaturas'
},
categories: [
''
]
},
yAxis: {
min: 0,
title: {
text:
'Velocidade (Km/h)'
}
},
tooltip: {
formatter:
function
() {
return
''
+
this
.series.name +
': '
+
this
.y +
' Km/h'
;
}
},
});
});
</script>
the problem i have is that the $(document).ready is never called...
Thanks in advance for the help..