Fix time value issue in x axis

merge-requests/1/head
charithag 9 years ago
parent f278ac3266
commit e9f0527ccf

@ -25,7 +25,7 @@
opacity: 0.5; opacity: 0.5;
white-space: nowrap; white-space: nowrap;
margin-left: 3px; margin-left: 3px;
bottom: 1px; bottom: -17px;
} }
/* annotations */ /* annotations */
@ -187,11 +187,6 @@
} }
.custom_slider { .custom_slider {
top: 20px;
left: 40px; left: 40px;
} }
.custom_x_axis {
position: relative;
left: 40px;
height: 40px;
}

@ -287,14 +287,12 @@ function drawLineGraph(graphId, chartDataRaw) {
var chartDiv = "chart" + graphId; var chartDiv = "chart" + graphId;
var sliderDiv = "slider" + graphId; var sliderDiv = "slider" + graphId;
var x_axis = "x_axis" + graphId;
var y_axis = "y_axis" + graphId; var y_axis = "y_axis" + graphId;
$(chartWrapperElmId).html("").html('<div id = "' + y_axis $(chartWrapperElmId).html("").html('<div id = "' + y_axis
+ '" class="custom_y_axis"></div><div class="legend_container" id="legend_container' + '" class="custom_y_axis"></div><div class="legend_container" id="legend_container'
+ graphId + '"><div id="smoother' + graphId + '" title="Smoothing"></div><div class="legend" id="legend' + graphId + '"><div id="smoother' + graphId + '" title="Smoothing"></div><div class="legend" id="legend'
+ graphId + '"></div></div><div id="' + chartDiv + graphId + '"></div></div><div id="' + chartDiv
+ '" class="custom_rickshaw_graph"></div><div id="' + x_axis + '" class="custom_rickshaw_graph"></div><div id="' + sliderDiv
+ '" class="custom_x_axis"></div><div id="' + sliderDiv
+ '" class="custom_slider"></div>'); + '" class="custom_slider"></div>');
var graphConfig = { var graphConfig = {
@ -337,11 +335,8 @@ function drawLineGraph(graphId, chartDataRaw) {
graph: graph graph: graph
}); });
var xAxis = new Rickshaw.Graph.Axis.X({ var xAxis = new Rickshaw.Graph.Axis.Time({
graph: graph, graph: graph
orientation: 'bottom',
element: document.getElementById(x_axis),
tickFormat: graph.x.tickFormat()
}); });
xAxis.render(); xAxis.render();
@ -379,14 +374,12 @@ function drawBarGraph(graphId, chartDataRaw) {
var chartDiv = "chart" + graphId; var chartDiv = "chart" + graphId;
var sliderDiv = "slider" + graphId; var sliderDiv = "slider" + graphId;
var x_axis = "x_axis" + graphId;
var y_axis = "y_axis" + graphId; var y_axis = "y_axis" + graphId;
$(chartWrapperElmId).html("").html('<div id = "' + y_axis $(chartWrapperElmId).html("").html('<div id = "' + y_axis
+ '" class="custom_y_axis"></div><div class="legend_container" id="legend_container' + '" class="custom_y_axis"></div><div class="legend_container" id="legend_container'
+ graphId + '"><div id="smoother' + graphId + '" title="Smoothing"></div><div class="legend" id="legend' + graphId + '"><div id="smoother' + graphId + '" title="Smoothing"></div><div class="legend" id="legend'
+ graphId + '"></div></div><div id="' + chartDiv + graphId + '"></div></div><div id="' + chartDiv
+ '" class="custom_rickshaw_graph"></div><div id="' + x_axis + '" class="custom_rickshaw_graph"></div><div id="' + sliderDiv
+ '" class="custom_x_axis"></div><div id="' + sliderDiv
+ '" class="custom_slider"></div>'); + '" class="custom_slider"></div>');
var graphConfig = { var graphConfig = {
@ -426,11 +419,8 @@ function drawBarGraph(graphId, chartDataRaw) {
graph.render(); graph.render();
var xAxis = new Rickshaw.Graph.Axis.X({ var xAxis = new Rickshaw.Graph.Axis.Time({
graph: graph, graph: graph
orientation: 'bottom',
element: document.getElementById(x_axis),
tickFormat: graph.x.tickFormat()
}); });
xAxis.render(); xAxis.render();

Loading…
Cancel
Save