Trend Binding Callback
The Trend Binding Callback function that you implement must have the following definition:
function myCallbackFunction(data) {
... your custom implementation here ...
}
You can name the function anything, as long as it takes a single argument. An example of how this might be used along with a set of Trend Bindings follows:
<script type="text/javascript">
OAS_config = {
token:'7e61b230-481d-4551-b24b-ba9046e3d8f2',
serverURL: 'http://localhost:58725',
trend_bindings: [
{
chartid: "myChart",
samplerate: 1,
timeframe: 100,
tags:[
{
label:"ramp",
tag:"Ramp.Value",
color:"#090"
},
{
label: "random",
tag: "Random.Value",
color: "#f00"
}
],
retain: 100,
callback: myTrendCallback
}
]
};
function myTrendCallback(data) {
// display raw data in debug console
console.log(data);
}
</script>
