From e9f0527ccfc847a8d44998ba0dbd56832d1edd31 Mon Sep 17 00:00:00 2001 From: charithag Date: Tue, 4 Aug 2015 17:51:56 +0530 Subject: [PATCH] Fix time value issue in x axis --- .../analiytics-graphs/public/css/graph.css | 9 ++------ .../units/analytics/public/js/graph_util.js | 22 +++++-------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analiytics-graphs/public/css/graph.css b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analiytics-graphs/public/css/graph.css index 0a79c8ae..20379121 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analiytics-graphs/public/css/graph.css +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analiytics-graphs/public/css/graph.css @@ -25,7 +25,7 @@ opacity: 0.5; white-space: nowrap; margin-left: 3px; - bottom: 1px; + bottom: -17px; } /* annotations */ @@ -187,11 +187,6 @@ } .custom_slider { + top: 20px; left: 40px; -} - -.custom_x_axis { - position: relative; - left: 40px; - height: 40px; } \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js index e1af806e..038a8ad5 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js @@ -287,14 +287,12 @@ function drawLineGraph(graphId, chartDataRaw) { var chartDiv = "chart" + graphId; var sliderDiv = "slider" + graphId; - var x_axis = "x_axis" + graphId; var y_axis = "y_axis" + graphId; $(chartWrapperElmId).html("").html('
'); var graphConfig = { @@ -337,11 +335,8 @@ function drawLineGraph(graphId, chartDataRaw) { graph: graph }); - var xAxis = new Rickshaw.Graph.Axis.X({ - graph: graph, - orientation: 'bottom', - element: document.getElementById(x_axis), - tickFormat: graph.x.tickFormat() + var xAxis = new Rickshaw.Graph.Axis.Time({ + graph: graph }); xAxis.render(); @@ -379,14 +374,12 @@ function drawBarGraph(graphId, chartDataRaw) { var chartDiv = "chart" + graphId; var sliderDiv = "slider" + graphId; - var x_axis = "x_axis" + graphId; var y_axis = "y_axis" + graphId; $(chartWrapperElmId).html("").html('
'); var graphConfig = { @@ -426,11 +419,8 @@ function drawBarGraph(graphId, chartDataRaw) { graph.render(); - var xAxis = new Rickshaw.Graph.Axis.X({ - graph: graph, - orientation: 'bottom', - element: document.getElementById(x_axis), - tickFormat: graph.x.tickFormat() + var xAxis = new Rickshaw.Graph.Axis.Time({ + graph: graph }); xAxis.render();