|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
|
|
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
|
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
|
|
* Version 2.0 (the "License"); you may not use this file except
|
|
|
|
* Version 2.0 (the "License"); you may not use this file except
|
|
|
@ -16,34 +16,40 @@
|
|
|
|
* under the License.
|
|
|
|
* under the License.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
var palette = new Rickshaw.Color.Palette({scheme: "classic9"});
|
|
|
|
var palette = new Rickshaw.Color.Palette({scheme: "munin"});
|
|
|
|
var graphMap = {};
|
|
|
|
var graphMap = {};
|
|
|
|
|
|
|
|
|
|
|
|
function drawGraph_android_sense(from, to) {
|
|
|
|
function drawGraph_android_sense(from, to) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from = new Date();
|
|
|
|
|
|
|
|
from.setDate(from.getDate()-1);
|
|
|
|
|
|
|
|
from.setHours(0,0,0,0);
|
|
|
|
|
|
|
|
from = parseInt(from.getTime());
|
|
|
|
|
|
|
|
to = parseInt(new Date().getTime());
|
|
|
|
|
|
|
|
|
|
|
|
var devices = $("#android_sense-details").data("devices");
|
|
|
|
var devices = $("#android_sense-details").data("devices");
|
|
|
|
var tzOffset = new Date().getTimezoneOffset() * 60;
|
|
|
|
var tzOffset = new Date().getTimezoneOffset() * 60;
|
|
|
|
|
|
|
|
|
|
|
|
var streamIndex = 0;
|
|
|
|
var streamIndex = 0;
|
|
|
|
var streams = ["battery", "light", "pressure", "proximity", "accelerometer", "magnetic", "rotation", "gyroscope", "gravity"];
|
|
|
|
var streams = ["battery", "light", "pressure", "proximity", "magnetic", "rotation", "gyroscope", "gravity", "accelerometer"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var graphType = $(".y-axis-label").text();
|
|
|
|
populateGraph();
|
|
|
|
populateGraph();
|
|
|
|
|
|
|
|
|
|
|
|
function populateGraph() {
|
|
|
|
function populateGraph() {
|
|
|
|
if (streamIndex < 4) {
|
|
|
|
if (streams.indexOf(graphType) < 4) {
|
|
|
|
retrieveDataAndDrawLineGraph(streams[streamIndex], from, to);
|
|
|
|
retrieveDataAndDrawGraph(graphType, from, to);
|
|
|
|
} else if (streamIndex < 9) {
|
|
|
|
} else if (streams.indexOf(graphType) < 9) {
|
|
|
|
retrieveDataAndDrawMultiLineGraph(streams[streamIndex], from, to);
|
|
|
|
retrieveDataAndDrawMultiLineGraph(graphType, from, to);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
streamIndex++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function clearContent(type) {
|
|
|
|
function clearContent(type) {
|
|
|
|
$("#y_axis-" + type).html("");
|
|
|
|
$("#y-axis-" + type).html("");
|
|
|
|
$("#smoother-" + type).html("");
|
|
|
|
$("#smoother-" + type).html("");
|
|
|
|
$("#legend-" + type).html("");
|
|
|
|
$("#legend-" + type).html("");
|
|
|
|
$("#chart-" + type).html("");
|
|
|
|
$("#chart-" + type).html("");
|
|
|
|
$("#x_axis-" + type).html("");
|
|
|
|
$("#x_axis-" + type).html("");
|
|
|
|
$("#slider-" + type).html("");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initGraph(type, isMultilined) {
|
|
|
|
function initGraph(type, isMultilined) {
|
|
|
@ -52,17 +58,14 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var chartWrapperElmId = "#android_sense-div-chart";
|
|
|
|
var chartWrapperElmId = "#android_sense-div-chart";
|
|
|
|
var graphWidth = $(chartWrapperElmId).width() - 50;
|
|
|
|
var graphWidth = $(chartWrapperElmId).width() - 100;
|
|
|
|
|
|
|
|
|
|
|
|
var graphConfig = {
|
|
|
|
var graphConfig = {
|
|
|
|
element: document.getElementById("chart-" + type),
|
|
|
|
element: document.getElementById("chart-" + type),
|
|
|
|
width: graphWidth,
|
|
|
|
width: graphWidth,
|
|
|
|
height: 400,
|
|
|
|
height: 400,
|
|
|
|
strokeWidth: 2,
|
|
|
|
strokeWidth: 2,
|
|
|
|
renderer: 'line',
|
|
|
|
|
|
|
|
interpolation: "linear",
|
|
|
|
interpolation: "linear",
|
|
|
|
unstack: true,
|
|
|
|
|
|
|
|
stack: false,
|
|
|
|
|
|
|
|
xScale: d3.time.scale(),
|
|
|
|
xScale: d3.time.scale(),
|
|
|
|
padding: {top: 0.2, left: 0.02, right: 0.02, bottom: 0.2},
|
|
|
|
padding: {top: 0.2, left: 0.02, right: 0.02, bottom: 0.2},
|
|
|
|
series: []
|
|
|
|
series: []
|
|
|
@ -89,7 +92,7 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
y: 0
|
|
|
|
y: 0
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
'name': "x"
|
|
|
|
'name': "x " + type
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
'color': palette.color(),
|
|
|
|
'color': palette.color(),
|
|
|
@ -97,7 +100,7 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
y: 0
|
|
|
|
y: 0
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
'name': "y"
|
|
|
|
'name': "y " + type
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
'color': palette.color(),
|
|
|
|
'color': palette.color(),
|
|
|
@ -105,7 +108,7 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
y: 0
|
|
|
|
y: 0
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
'name': "z"
|
|
|
|
'name': "z " + type
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -116,13 +119,12 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
x: parseInt(new Date().getTime() / 1000),
|
|
|
|
y: 0
|
|
|
|
y: 0
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
'name': $("#android_sense-details").data("devicename")
|
|
|
|
'name': type
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var graph = new Rickshaw.Graph(graphConfig);
|
|
|
|
var graph = new Rickshaw.Graph(graphConfig);
|
|
|
|
graph.render();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var xAxis = new Rickshaw.Graph.Axis.Time({
|
|
|
|
var xAxis = new Rickshaw.Graph.Axis.Time({
|
|
|
|
graph: graph
|
|
|
|
graph: graph
|
|
|
@ -132,17 +134,15 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
var yAxis = new Rickshaw.Graph.Axis.Y({
|
|
|
|
var yAxis = new Rickshaw.Graph.Axis.Y({
|
|
|
|
graph: graph,
|
|
|
|
graph: graph,
|
|
|
|
orientation: 'left',
|
|
|
|
orientation: 'left',
|
|
|
|
element: document.getElementById("y_axis-" + type),
|
|
|
|
|
|
|
|
width: 40,
|
|
|
|
width: 40,
|
|
|
|
height: 410
|
|
|
|
height: 410,
|
|
|
|
});
|
|
|
|
tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
|
|
|
|
yAxis.render();
|
|
|
|
element: document.getElementById("y-axis-" + type)
|
|
|
|
|
|
|
|
|
|
|
|
var slider = new Rickshaw.Graph.RangeSlider.Preview({
|
|
|
|
|
|
|
|
graph: graph,
|
|
|
|
|
|
|
|
element: document.getElementById("slider-" + type)
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yAxis.render();
|
|
|
|
|
|
|
|
|
|
|
|
var legend = new Rickshaw.Graph.Legend({
|
|
|
|
var legend = new Rickshaw.Graph.Legend({
|
|
|
|
graph: graph,
|
|
|
|
graph: graph,
|
|
|
|
element: document.getElementById("legend-" + type)
|
|
|
|
element: document.getElementById("legend-" + type)
|
|
|
@ -159,34 +159,35 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var shelving = new Rickshaw.Graph.Behavior.Series.Toggle({
|
|
|
|
new Rickshaw.Graph.Behavior.Series.Toggle({
|
|
|
|
graph: graph,
|
|
|
|
graph: graph,
|
|
|
|
legend: legend
|
|
|
|
legend: legend
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var order = new Rickshaw.Graph.Behavior.Series.Order({
|
|
|
|
new Rickshaw.Graph.Behavior.Series.Order({
|
|
|
|
graph: graph,
|
|
|
|
graph: graph,
|
|
|
|
legend: legend
|
|
|
|
legend: legend
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var highlighter = new Rickshaw.Graph.Behavior.Series.Highlight({
|
|
|
|
new Rickshaw.Graph.Behavior.Series.Highlight({
|
|
|
|
graph: graph,
|
|
|
|
graph: graph,
|
|
|
|
legend: legend
|
|
|
|
legend: legend
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
graph.render();
|
|
|
|
|
|
|
|
|
|
|
|
graphMap[type] = {};
|
|
|
|
graphMap[type] = {};
|
|
|
|
graphMap[type].graph = graph;
|
|
|
|
graphMap[type].graph = graph;
|
|
|
|
graphMap[type].config = graphConfig;
|
|
|
|
graphMap[type].config = graphConfig;
|
|
|
|
return graphMap[type];
|
|
|
|
return graphMap[type];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function retrieveDataAndDrawLineGraph(type, from, to) {
|
|
|
|
function retrieveDataAndDrawGraph(type, from, to) {
|
|
|
|
clearContent(type);
|
|
|
|
clearContent(type);
|
|
|
|
|
|
|
|
|
|
|
|
var graphObj = initGraph(type, false);
|
|
|
|
var graphObj = initGraph(type, false);
|
|
|
|
var graph = graphObj.graph;
|
|
|
|
var graph = graphObj.graph;
|
|
|
|
var graphConfig = graphObj.config;
|
|
|
|
var graphConfig = graphObj.config;
|
|
|
|
|
|
|
|
|
|
|
|
var deviceIndex = 0;
|
|
|
|
var deviceIndex = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (devices) {
|
|
|
|
if (devices) {
|
|
|
@ -195,12 +196,10 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
var backendApiUrl = $("#android_sense-div-chart").data("backend-api-url") + type + "?from=" + from + "&to=" + to;
|
|
|
|
var backendApiUrl = $("#android_sense-div-chart").data("backend-api-url") + type + "?from=" + from + "&to=" + to;
|
|
|
|
var successCallback = function (data) {
|
|
|
|
var successCallback = function (data) {
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
drawLineGraph(JSON.parse(data));
|
|
|
|
drawGraph(JSON.parse(data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
populateGraph();
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
|
|
|
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
|
|
|
populateGraph();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -212,7 +211,7 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
+ "/sensors/" + type + "?from=" + from + "&to=" + to;
|
|
|
|
+ "/sensors/" + type + "?from=" + from + "&to=" + to;
|
|
|
|
var successCallback = function (data) {
|
|
|
|
var successCallback = function (data) {
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
drawLineGraph(JSON.parse(data));
|
|
|
|
drawGraph(JSON.parse(data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
deviceIndex++;
|
|
|
|
deviceIndex++;
|
|
|
|
getData();
|
|
|
|
getData();
|
|
|
@ -223,21 +222,21 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drawLineGraph(data) {
|
|
|
|
function drawGraph(data) {
|
|
|
|
if (data.length === 0 || data.length === undefined) {
|
|
|
|
if (data.length === 0 || data.length === undefined) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var chartData = [];
|
|
|
|
var chartData = [];
|
|
|
|
|
|
|
|
console.log(data.length);
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
chartData.push(
|
|
|
|
chartData.push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x: parseInt(data[i].values.time) - tzOffset,
|
|
|
|
x: parseInt((data[i].values.meta_timestamp - tzOffset)/1000),
|
|
|
|
y: parseInt(getFieldData(data[i], type))
|
|
|
|
y: parseInt(getFieldData(data[i], type))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
graphConfig.series[deviceIndex].data = chartData;
|
|
|
|
graphConfig.series[deviceIndex].data = chartData;
|
|
|
|
graph.update();
|
|
|
|
graph.update();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -258,12 +257,10 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
var backendApiUrl = $("#android_sense-div-chart").data("backend-api-url") + type + "?from=" + from + "&to=" + to;
|
|
|
|
var backendApiUrl = $("#android_sense-div-chart").data("backend-api-url") + type + "?from=" + from + "&to=" + to;
|
|
|
|
var successCallback = function (data) {
|
|
|
|
var successCallback = function (data) {
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
drawLineGraph(JSON.parse(data));
|
|
|
|
drawGraph(JSON.parse(data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
populateGraph();
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
|
|
|
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
|
|
|
populateGraph();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -276,7 +273,7 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
+ "/sensors/" + type + "?from=" + from + "&to=" + to;
|
|
|
|
+ "/sensors/" + type + "?from=" + from + "&to=" + to;
|
|
|
|
var successCallback = function (data) {
|
|
|
|
var successCallback = function (data) {
|
|
|
|
if (data) {
|
|
|
|
if (data) {
|
|
|
|
drawLineGraph(JSON.parse(data));
|
|
|
|
drawGraph(JSON.parse(data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
deviceIndex++;
|
|
|
|
deviceIndex++;
|
|
|
|
getData();
|
|
|
|
getData();
|
|
|
@ -287,7 +284,7 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drawLineGraph(data) {
|
|
|
|
function drawGraph(data) {
|
|
|
|
if (data.length === 0 || data.length === undefined) {
|
|
|
|
if (data.length === 0 || data.length === undefined) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -297,32 +294,53 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
chartData.push(
|
|
|
|
chartData.push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x: parseInt(data[i].values.time) - tzOffset,
|
|
|
|
x: parseInt(data[i].values.meta_timestamp) - tzOffset,
|
|
|
|
y: sqrt(pow(parseInt(data[i].values.y), 2) + pow(parseInt(data[i].values.x), 2) + pow(parseInt(data[i].values.z), 2))
|
|
|
|
y: sqrt(pow(parseInt(data[i].values.Y), 2) + pow(parseInt(data[i].values.X), 2) + pow(parseInt(data[i].values.z), 2))
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
graphConfig.series[deviceIndex].data = chartData;
|
|
|
|
graphConfig.series[deviceIndex].data = chartData;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var chartDataX = [], chartDataY = [], chartDataZ = [];
|
|
|
|
var chartDataX = [], chartDataY = [], chartDataZ = [];
|
|
|
|
|
|
|
|
console.log(data.length);
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
|
|
|
if (data[i].values.axis==="X"){
|
|
|
|
|
|
|
|
console.log(new Date(parseInt(data[i].values.meta_timestamp)- tzOffset));
|
|
|
|
chartDataX.push(
|
|
|
|
chartDataX.push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x: parseInt(data[i].values.time) - tzOffset,
|
|
|
|
x: parseInt(((data[i].values.meta_timestamp) - tzOffset)/1000),
|
|
|
|
y: parseInt(data[i].values.y)
|
|
|
|
y: parseInt(data[i].values.value)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(data[i].values.axis==="Y"){
|
|
|
|
chartDataY.push(
|
|
|
|
chartDataY.push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x: parseInt(data[i].values.time) - tzOffset,
|
|
|
|
x: parseInt(((data[i].values.meta_timestamp) - tzOffset)/1000),
|
|
|
|
|
|
|
|
y: parseInt(data[i].values.value)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(data[i].values.axis==="Z"){
|
|
|
|
|
|
|
|
chartDataZ.push(
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x: parseInt(((data[i].values.meta_timestamp) - tzOffset)/1000),
|
|
|
|
|
|
|
|
y: parseInt(data[i].values.value)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(data[i].values.hasOwnProperty("x") && data[i].values.hasOwnProperty("y") && data[i].values.hasOwnProperty("z")){
|
|
|
|
|
|
|
|
chartDataX.push(
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x: parseInt(((data[i].values.meta_timestamp) - tzOffset)/1000),
|
|
|
|
y: parseInt(data[i].values.x)
|
|
|
|
y: parseInt(data[i].values.x)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
chartDataY.push(
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x: parseInt(((data[i].values.meta_timestamp) - tzOffset)/1000),
|
|
|
|
|
|
|
|
y: parseInt(data[i].values.y)
|
|
|
|
|
|
|
|
});
|
|
|
|
chartDataZ.push(
|
|
|
|
chartDataZ.push(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x: parseInt(data[i].values.time) - tzOffset,
|
|
|
|
x: parseInt(((data[i].values.meta_timestamp) - tzOffset)/1000),
|
|
|
|
y: parseInt(data[i].values.z)
|
|
|
|
y: parseInt(data[i].values.z)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
graphConfig.series[0].data = chartDataX;
|
|
|
|
graphConfig.series[0].data = chartDataX;
|
|
|
|
graphConfig.series[1].data = chartDataY;
|
|
|
|
graphConfig.series[1].data = chartDataY;
|
|
|
|
graphConfig.series[2].data = chartDataZ;
|
|
|
|
graphConfig.series[2].data = chartDataZ;
|
|
|
@ -352,5 +370,21 @@ function drawGraph_android_sense(from, to) {
|
|
|
|
|
|
|
|
|
|
|
|
return columnData;
|
|
|
|
return columnData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$("input:radio").click(function(e) {
|
|
|
|
|
|
|
|
var offsetMode = e.target.value;
|
|
|
|
|
|
|
|
var graphType = e.target.className;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (offsetMode == 'lines') {
|
|
|
|
|
|
|
|
graphMap[graphType].graph.setRenderer('line');
|
|
|
|
|
|
|
|
graphMap[graphType].graph.offset = 'zero';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
graphMap[graphType].graph.setRenderer('stack');
|
|
|
|
|
|
|
|
graphMap[graphType].graph.offset = offsetMode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
graphMap[graphType].graph.update();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|